我有两个使用CXF来使用Web服务的代码项目。当我从项目A调用项目B时,我调用的方法会收到空参数。我打开了日志记录,并且入站消息确实包含正确的参数。我也尝试从SoapUI(一个web服务测试工具)调用我的服务。这正如我所期望的那样传递参数。任何人有任何想法出了什么问题?通过CXF的Web服务调用提供空参数
服务接口:
@WebService
public interface IShortlistService {
public IShortlist createOrUpdateShortlist(@WebParam(name = "sessionId") String sessionId,
@WebParam(name = "datastoreInstance") String datastoreInstance,
@WebParam(name = "datastoreRecordId") String datastoreRecordId);
}
服务IMPL:
@Name("shortlistService")
@WebService(endpointInterface = "com.oobjects.shortlist.service.IShortlistService", serviceName = "ShortlistService")
@Features(features = "org.apache.cxf.feature.LoggingFeature")
@Transactional
public class ShortlistService implements IShortlistService {
public IShortlist createOrUpdateShortlist(String sessionId, String datastoreInstance,
String datastoreRecordId) {
// At this point all inputs are null
}
}
记录入站的消息,证明它是确定:
INFO: Inbound Message
----------------------------
Encoding: UTF-8
Content-Type: text/xml; charset=UTF-8
Headers: {cache-control=[no-cache], content-type=[text/xml; charset=UTF-8], connection=[keep-alive], host=[mypc.mycompany.com:8080], content-length=[391], SOAPAction=[""], user-agent=[Apache CXF 2.2.5], Accept=[*/*], pragma=[no-cache]}
Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns1:createOrUpdateShortlist xmlns:ns1="http://service.shortlist.mycompany.com/"><sessionId>854a48b5-922f-4081-9c76-b6d08b58a341</sessionId><datastoreInstance>http://mypc.mycompany.com:8080/shortlist-app/services/ShortlistService</datastoreInstance></ns1:createOrUpdateShortlist></soap:Body></soap:Envelope>
--------------------------------------
CXF的版本是相同的( 2.2.5)。我想不出还有什么要检查的!
一些要求信息...
- @Name是Seam的注释
- 编程
- 宙斯盾绑定配置(JAXWS不喜欢接口)
你怎么配置?哪些数据绑定?什么名字? – bmargulies 2010-01-18 16:29:37
我已在最后添加了您请求的信息。 – 2010-01-18 17:20:14
简单的前端呢?它不会尊重这些@WebService注释。 恐怕这对cxf用户会更好。这不是一个简单的“我可以回答你的问题”的事情,这将是一个扩展的诊断练习。 – bmargulies 2010-01-18 17:40:38