由於php.net上的SOAP手冊不是很友好,我找不到任何好的示例,所以我會在這裏發佈我的問題。使用CURL PHP的SOAP請求
如何創建PHP SOAP請求,看起來像這樣?
POST /MySERVER/myWSDLservice.asmx HTTP/1.1
Host: connection.mywebsite.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://connection.mywebsite.com/MySERVER/GetCarType"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetCarType xmlns="http://connection.mywebsite.com/MySERVER/">
<IDNumber>string</IDNumber>
</GetCarType>
</soap:Body>
</soap:Envelope>
請注意:
- 沒有用戶名/密碼身份驗證
- SSL連接
任何建議/鏈接/例如大加讚賞。
[PHP :: SOAP](http://php.net/manual/en/book.soap.php) – J0HN
[ SoapClient類](http://www.php.net/manual/en/class.soapclient.php) – hakre