0
我的客戶希望通過快遞服務跟蹤他的數據包。 Courier Service公司給我一個XML代碼來使用他們的API。我是XML新手。如何通過表單向此XML發送跟蹤編號並獲取跟蹤詳細信息?我想在我的WordPress網站上使用它。提前致謝。由於代碼是在這裏下面如何通過HTML以XML格式發送和接收數據從
POST /codeapi/service_api.asmx HTTP/1.1
Host: webapp.example.com
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<GetCNDetailsByReferenceNumber xmlns="IP_ADDRESS/">
<userName>string</userName>
<password>string</password>
<customerReferenceNo>string</customerReferenceNo>
</GetCNDetailsByReferenceNumber>
</soap12:Body>
</soap12:Envelope>
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<GetCNDetailsByReferenceNumberResponse xmlns="IP_ADDRESS">
<GetCNDetailsByReferenceNumberResult>xmlxml</GetCNDetailsByReferenceNumberResult>
</GetCNDetailsByReferenceNumberResponse>
</soap12:Body>
</soap12:Envelope>
這不僅僅是XML,而是SOAP。我建議使用一個SOAP庫。 – ThW