Axis客户端.NET Web服务:参数在WebMethod中为空但在SOAP请求中为空

时间:2011-10-11 10:07:12

标签: .net web-services soap axis

我有一个由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 ..任何想法?

0 个答案:

没有答案
相关问题