通过CXF进行的Web服务调用给出了空参数 [英] Web Service Call Via CXF Gives Null Parameters

查看:218
本文介绍了通过CXF进行的Web服务调用给出了空参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个都使用CXF来使用Web服务的代码项目。当我从项目A调用项目B时,我正在调用的方法将接收空参数。我已打开日志记录,入站消息确实包含正确的参数。我还尝试过从SoapUI(一种Web服务测试工具)调用我的服务。如我所料,这会传递参数。任何人都知道出了什么问题吗?

I have two code projects both using CXF to use web services. When I make a call from project A to project B, the method I am calling receives null parameters. I've turned on logging and the inbound message does indeed contain the correct parameters. I have also tried calling my service from SoapUI (a webservice testing tool). This passes over the parameters as I expect. Anyone have any ideas what's going wrong?

服务界面:

@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
  }
}

记录证明没问题的入站消息:

Logging for inbound message that proves it's OK:

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)。我想不到还有什么要检查的!

The versions of CXF are the same (2.2.5). I can't think what else to check!

某些请求的信息...

Some requested information...


  • @Name是一个Seam批注

  • 以编程方式配置

  • 宙斯盾数据绑定(JAXWS不喜欢接口)

推荐答案

@Lee Theobald ...在您所发布的问题中,没有任何明显的东西可以揭示为什么它对您不起作用。在这种情况下,答案应为 CXF用户的要求,并在必要时打开JIRA。在问题注释中播放20个问题的效率不是很高,此时,列表上的CXF专家眼球比这里要多得多。揭开谜底后,我们可以在这里提出修改后的问题和答案。

@Lee Theobald ... there's nothing obvious in your posted question that reveals why it isn't working for you. In this case, the 'answer,' such as it is, is to request assistance on "CXF Users" , and, if necessary, open a JIRA. Playing 20 questions in the question comments isn't very efficient, and there are a lot more CXF-expert eyeballs on that list than here at this point. We could bring an amended question and answer back over here once the mystery is revealed.

这篇关于通过CXF进行的Web服务调用给出了空参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆