我有两个代码项目都使用 CXF 来使用 Web 服务。当我从项目 A 调用项目 B 时,我正在调用的方法接收空参数。我打开了日志记录,入站消息确实包含正确的参数。我还尝试从 SoapUI(一种网络服务测试工具)调用我的服务。正如我所料,这会传递参数。有人知道出了什么问题吗?
服务接口:
@WebService
public interface IShortlistService {
public IShortlist createOrUpdateShortlist(@WebParam(name = "sessionId") String sessionId,
@WebParam(name = "datastoreInstance") String datastoreInstance,
@WebParam(name = "datastoreRecordId") String datastoreRecordId);
}
服务内涵:
@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 注释
- 以编程方式配置
- Aegis 数据绑定(JAXWS 不喜欢接口)