如果请求中未提供名称空间前缀,则java @webservice接收空参数值

时间:2012-10-16 08:31:44

标签: java web-services parameters null

如果请求

中未提供名称空间前缀,则java @webservice会收到空参数值

webservice客户端正在发送如下所示的请求,我必须让它工作         我试图将目标命名空间删除为@WebService(targetNamespace =“”)

    and

    @WebMethod()
        @WebResult(name = "fusionIntegrationResponse", targetNamespace = "")
        @RequestWrapper(targetNamespace = "")
        @ResponseWrapper(targetNamespace = "")
        @Override`enter code here`
        public FusionIntegrationResponse activateFusion(String agentId, String ucn, String companyId) {

    WSDL always add targetnamespace and if I remove explicitly it says invalid definition.

    **webservice receives null values for all parameter for following soap request message.**

    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <SOAP-ENV:Body>
    <activateFusion xmlns="http://ws.fusionintegration.service.fnb.co.za/">
    <arg0>F3015505</arg0>
    <arg1>96334</arg1>
    <arg2>15</arg2>
    </activateFusion>
    </SOAP-ENV:Body></SOAP-ENV:Envelope>


    **following works fine**
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.fusionintegration.service.fnb.co.za/">
       <soapenv:Header/>
       <soapenv:Body>
          <ws:activateFusion>
            <arg0>F3015505</arg0>
           <arg1>96334</arg1>
           <arg2>15</arg2>
          </ws:activateFusion>
       </soapenv:Body>
    </soapenv:Envelope>

1 个答案:

答案 0 :(得分:0)

根据您的工作请求,您的参数看起来没有命名空间,因此以下内容应该有效:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
  <SOAP-ENV:Body>
    <activateFusion xmlns="http://ws.fusionintegration.service.fnb.co.za/">
      <arg0 xmlns="">F3015505</arg0>
      <arg1 xmlns="">96334</arg1>
      <arg2 xmlns="">15</arg2>
    </activateFusion>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>