Axis 客户端 .NET Web 服务:WebMethod 中的参数为 Null,但 SOAP 请求中的参数为 Null
我有一个由 Axis 客户端调用的 .NET Web 服务;但是,由于某种原因,我收到的所有参数值均为空。客户端不传递 SOAPAction 属性,因此我需要将 Routing 设置为 RequestElement,如下所示:
[SoapDocumentService(RoutingStyle=SoapServiceRoutingStyle.RequestElement)]
我已将命名空间设置为与调用方相同。
[WebService(Namespace = "http://aaa.com")]
正在调用 SOAP 请求中指定的适当方法,但所有参数仍然为空。
我的方法看起来像
[WebMethod(MessageName = "method1")]
public string method1(int param1, string param2, string param3)
这就是请求的样子
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:method1 soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://aaa.com">
<param1 href="#id0"/>
<param2 xsi:type="xsd:string">value</param2>
<param3 xsi:type="xsd:string">value</param3>
</ns1:method1>
<multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="xsd:int" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">11</multiRef>
</soapenv:Body>
</soapenv:Envelope>
但是,在该方法中,我为所有字符串获取 null,为整数获取 0。有什么想法吗?
I have a .NET web service being called by an Axis client; however, for some reason all of the parameter values I am receiving are null. The client does not pass the SOAPAction attribute, so I need to set the Routing to RequestElement as follows:
[SoapDocumentService(RoutingStyle=SoapServiceRoutingStyle.RequestElement)]
I have set the namespace same as the caller.
[WebService(Namespace = "http://aaa.com")]
The appropriate method specified in the SOAP Request is being called but still all of the parameters are null.
My method looks like
[WebMethod(MessageName = "method1")]
public string method1(int param1, string param2, string param3)
This is what the request looks like
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:method1 soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://aaa.com">
<param1 href="#id0"/>
<param2 xsi:type="xsd:string">value</param2>
<param3 xsi:type="xsd:string">value</param3>
</ns1:method1>
<multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="xsd:int" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">11</multiRef>
</soapenv:Body>
</soapenv:Envelope>
However, in the method I get null for all the strings and 0 for the ints.. Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论