2
我試圖實現一個SOAP API。但我沒有得到如何發送請求到給定的URL。在肥皂請求和附加證書中發送XML PHP
我對該API沒有任何支持,只有幾行作爲指令。
我之前沒有使用SOAP,有人可以幫助理解如何使用證書創建和發送XML請求。
下面是說明使用該API
Test API Link
https://202.82.66.148:8443/ptms4541/ws/CksServices
Worksite:BST-API
Account:BST-API01
Response to connect (Have to set header of the following)
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<tns:RequestSOAPHeader xmlns:tns="https://202.82.66.148:8443/ptms4541/ws/CksServices">
<tns:account xmlns="https://202.82.66.148:8443/ptms4541/ws/CksServices">BST-API01</tns:account>
<tns:timestamp xmlns="https://202.82.66.148:8443/ptms4541/ws/CksServices">201606211538</tns:timestamp>
<tns:pwd xmlns="https://202.82.66.148:8443/ptms4541/ws/CksServices">***********</tns:pwd>
<tns:worksite xmlns="https://202.82.66.148:8443/ptms4541/ws/CksServices">BST-API</tns:worksite>
<tns:discount_id xmlns="https://202.82.66.148:8443/ptms4541/ws/CksServices"/></tns:RequestSOAPHeader>
</soap:Header>
<soap:Body>
<ns2:getShippingLine xmlns:ns2="http://ws.service.gen.cks.com/"/> </soap:Body>
</soap:Envelope>
Certificates to installed attached in Email
getShippingLine()
隨着這個我有一個文件.crt
擴展
我試圖CURL
(從這裏開始:PHP & XML - How to generate a soap request in PHP from this XML?),也SoapClient
(不知道如何以所需的格式創建請求:Sending XML input to WSDL using SoapClient)來實現這一點,但沒有運氣。
其實我無法理解如何發送請求以及需要以何種方式發送該請求。
請幫我理解這一點。
感謝
也可以通過以下鏈接解決此問題:http://zrashwani.com/wcf-ssl-service-with-php/#.V8Ato6KN2tY –