我是使用SOAP与Web服务进行通信的新手,我最近在php中编写了一个与Web服务进行通信的客户端,但是收到了此错误消息:
“错误响应不是text / xml类型:text / html”
我发送的格式有问题吗?请找到 请求如下:
Request
POST /MobileCashPayout.asmx HTTP/1.0
Host: www.mtn.com
User-Agent: NuSOAP/0.9.5 (1.123)
Content-Type: text/xml; charset=ISO-8859-1
SOAPAction: ""
Content-Length: 971
<?xml version="1.0" encoding="ISO-8859-1"?><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><ns5667:Payout xmlns:ns5667="http://tempuri.org"><__numeric_0 xsi:type="xsd:string">testmerc</__numeric_0><__numeric_1 xsi:type="xsd:string">testmerc</__numeric_1><__numeric_2 xsi:type="xsd:string">256750000005</__numeric_2><__numeric_3 xsi:type="xsd:string">256753986532</__numeric_3><__numeric_4 xsi:type="xsd:string">256750000005</__numeric_4><__numeric_5 xsi:type="xsd:string">100.00</__numeric_5><__numeric_6 xsi:type="xsd:string">2222</__numeric_6><__numeric_7 xsi:type="xsd:string"></__numeric_7><__numeric_8 xsi:type="xsd:string">BETNET</__numeric_8></ns5667:Payout></SOAP-ENV:Body></SOAP-ENV:Envelope>
答案 0 :(得分:1)
您可能希望尝试发送“Accept:text / xml”标头,以通知服务器您正在等待XML响应。