我是肥皂的初學者,我如何發送soap請求?我在谷歌搜索和嘗試不同的方法,但可悲的是它沒有爲我工作。如何發送curl中的SOAP請求
我真的很感謝你的幫助。
這裏,我應該送樣要求:
POST /Universal/WebService.asmx HTTP/1.1
Host: www.sample.com
Content-Type: text/xml;charset="utf-8"
Content-Length: length
SOAPAction: https://www.sample.com/Universal/WebService.asmx/Request
<?xml version=\"1.0\" encoding=\"utf-8\"?>
<soap:Envelope xmlns:xsi="http://wwww.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<Request xmlns="https://www.sample.com/Universal/WebService.asmx">
<ID>CPHK01</ID>
<UID>TEST</UID>
<PWD>TEST</PWD>
<target_mpn>09183530925</target_mpn>
<amount>115</amount>
<ref_no>20060830143030112</ref_no>
<source_mpn>67720014</source_mpn>
</Request>
</soap:Body>
</soap:Envelope>
這裏的響應:
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?xml version = "1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://wwww.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<RequestResponse xmlns="https://www.sample.com/Universal/WebService.asmx">
<RequestResult>
<Ref_no>20060830143030112</Ref_no>
<StatusCode>101</StatusCode>
</RequestResult>
</RequestResponse>
</soap:Body>
</soap:Envelope>
我對'SOAP'的主要建議是**不要丟棄!**。 * [抱歉,無法阻止拖動:)。] * – CodeAngry
[PHP的CURL中的SOAP請求]的可能重複(http://stackoverflow.com/questions/7120586/soap-request-in-php-with-curl ) - 和其他一些。在提問前請使用搜索。 – hakre
@hakre **喜歡**放棄'SOAP' – Jimbo