我正在将.net网络服务转换为适用于我的android应用的php nusoap网络服务,但两个网络服务的响应并不完全匹配。
我在Soap Ui中进行了测试,并且收到了此回复
.Net下面
Request:-
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:tem="http://tempuri.org/">
<soap:Header/>
<soap:Body>
<tem:Userlogin>
<!--Optional:-->
<tem:Username>?</tem:Username>
<!--Optional:-->
<tem:Password>?</tem:Password>
<!--Optional:-->
<tem:Role>?</tem:Role>
</tem:Userlogin>
</soap:Body>
</soap:Envelope>
Result:-
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<UserloginResponse xmlns="http://tempuri.org/">
<UserloginResult>{"Response":[{"username":"COC61","name":"sum1love","mobile":"8808879249","email":"","gender":"0","dateofbirth":null,"address":null,"role":"U","sponsorid":"sum1145961","playstatus":"True","Totalcontest":"0","Imageurl":"","Totalwallet":"433","Totallife":"4"}]}</UserloginResult>
</UserloginResponse>
</soap:Body>
</soap:Envelope>
``
IN PHP响应
Request:
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
8808879249
123456
?
``
Result:
``
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:UserloginResponse xmlns:ns1="http://tempuri.org/">
<UserloginResult xsi:type="xsd:string">{"Response":[{"username":"COC61","name":"sum1love","mobile":"8808879249","email":"","gender":"Male","dateofbirth":null,"address":"","role":"U","sponsorid":"sum1145961","playstatus":"1","Totalcontest":1,"Imageurl":"","Totalwallet":1,"Totallife":1}]}</UserloginResult>
</ns1:UserloginResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
``
在php中,它具有额外的前缀ns1,并且还有一些额外的东西正在获取与.Net响应相同的方法。