最近最做的一个项目,是接的老外的一个接口,要用 PHP,但是不知道怎么入手,,,问过他们那边的人,然后是他们也不知道,没有案例代码。 把接口贴出来了, 并且同一个接口给了两个,分别是 SOAP 1.1 和 SOAP 1.2。有做的的大神指点下,万分感谢!
The following is a sample SOAP 1.1 request and response. The placeholders shown need to be replaced with actual values.
-------------------------- SOAP 1.1 开始------------------------------------------
POST /NaqelAPIServices/NaqelAPIDemo/5.0/XMLShippingService.asmx HTTP/1.1 Host: infotrack.naqelexpress.com Content-Type: text/xml; charset=utf-8 Content-Length: length SOAPAction: "http://tempuri.org/CreateWaybill"
<soap:Envelope xmlns:xsi="<a href=" http:="" www.w3.org="" 2001="" XMLSchema-instance"="" rel="nofollow">http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<CreateWaybill xmlns="http://tempuri.org/">
<_ManifestShipmentDetails>
<ClientInfo>
<ClientAddress>
<PhoneNumber>string</PhoneNumber>
<POBox>string</POBox>
<ZipCode>string</ZipCode>
<Fax>string</Fax>
<FirstAddress>string</FirstAddress>
<Location>string</Location>
<CountryCode>string</CountryCode>
<CityCode>string</CityCode>
</ClientAddress>
<ClientContact>
<Name>string</Name>
<Email>string</Email>
<PhoneNumber>string</PhoneNumber>
<MobileNo>string</MobileNo>
</ClientContact>
<ClientID>int</ClientID>
<Password>string</Password>
<Version>string</Version>
</ClientInfo>
<ConsigneeInfo>
<ConsigneeName>string</ConsigneeName>
<Email>string</Email>
<Mobile>string</Mobile>
<PhoneNumber>string</PhoneNumber>
<Fax>string</Fax>
<Address>string</Address>
<Near>string</Near>
<CountryCode>string</CountryCode>
<CityCode>string</CityCode>
</ConsigneeInfo>
<BillingType>int</BillingType>
<PicesCount>int</PicesCount>
<Weight>double</Weight>
<DeliveryInstruction>string</DeliveryInstruction>
<CODCharge>double</CODCharge>
<CreateBooking>boolean</CreateBooking>
<isRTO>boolean</isRTO>
<GeneratePiecesBarCodes>boolean</GeneratePiecesBarCodes>
<LoadTypeID>int</LoadTypeID>
<DeclareValue>double</DeclareValue>
<GoodDesc>string</GoodDesc>
<Latitude>string</Latitude>
<Longitude>string</Longitude>
<RefNo>string</RefNo>
<HSCode>string</HSCode>
<CustomDutyAmount>double</CustomDutyAmount>
<GoodsVATAmount>double</GoodsVATAmount>
<IsCustomDutyPayByConsignee>boolean</IsCustomDutyPayByConsignee>
</_ManifestShipmentDetails>
</CreateWaybill>
</soap:Body>
</soap:Envelope>
-------------------------------------SOAP 1.1 结束----------------------------------
HTTP/1.1 200 OK Content-Type: text/xml; charset=utf-8 Content-Length: length
<soap:Envelope xmlns:xsi="<a href=" http:="" www.w3.org="" 2001="" XMLSchema-instance"="" rel="nofollow">http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<CreateWaybillResponse xmlns="http://tempuri.org/">
<CreateWaybillResult>
<HasError>boolean</HasError>
<WaybillNo>int</WaybillNo>
<BookingRefNo>string</BookingRefNo>
<Key>int</Key>
<Message>string</Message>
</CreateWaybillResult>
</CreateWaybillResponse>
</soap:Body>
</soap:Envelope>
---------------------------返回结束---------------------------------------
SOAP 1.2 -------------------------- SOAP 1.2 开始------------------------------------------ The following is a sample SOAP 1.2 request and response. The placeholders shown need to be replaced with actual values.
POST /NaqelAPIServices/NaqelAPIDemo/5.0/XMLShippingService.asmx HTTP/1.1
Host: infotrack.naqelexpress.com
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length
<soap12:Envelope xmlns:xsi="<a href=" http:="" www.w3.org="" 2001="" XMLSchema-instance"="" rel="nofollow">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">
<CreateWaybill xmlns="http://tempuri.org/">
<_ManifestShipmentDetails>
<ClientInfo>
<ClientAddress>
<PhoneNumber>string</PhoneNumber>
<POBox>string</POBox>
<ZipCode>string</ZipCode>
<Fax>string</Fax>
<FirstAddress>string</FirstAddress>
<Location>string</Location>
<CountryCode>string</CountryCode>
<CityCode>string</CityCode>
</ClientAddress>
<ClientContact>
<Name>string</Name>
<Email>string</Email>
<PhoneNumber>string</PhoneNumber>
<MobileNo>string</MobileNo>
</ClientContact>
<ClientID>int</ClientID>
<Password>string</Password>
<Version>string</Version>
</ClientInfo>
<ConsigneeInfo>
<ConsigneeName>string</ConsigneeName>
<Email>string</Email>
<Mobile>string</Mobile>
<PhoneNumber>string</PhoneNumber>
<Fax>string</Fax>
<Address>string</Address>
<Near>string</Near>
<CountryCode>string</CountryCode>
<CityCode>string</CityCode>
</ConsigneeInfo>
<BillingType>int</BillingType>
<PicesCount>int</PicesCount>
<Weight>double</Weight>
<DeliveryInstruction>string</DeliveryInstruction>
<CODCharge>double</CODCharge>
<CreateBooking>boolean</CreateBooking>
<isRTO>boolean</isRTO>
<GeneratePiecesBarCodes>boolean</GeneratePiecesBarCodes>
<LoadTypeID>int</LoadTypeID>
<DeclareValue>double</DeclareValue>
<GoodDesc>string</GoodDesc>
<Latitude>string</Latitude>
<Longitude>string</Longitude>
<RefNo>string</RefNo>
<HSCode>string</HSCode>
<CustomDutyAmount>double</CustomDutyAmount>
<GoodsVATAmount>double</GoodsVATAmount>
<IsCustomDutyPayByConsignee>boolean</IsCustomDutyPayByConsignee>
</_ManifestShipmentDetails>
</CreateWaybill>
</soap12:Body>
</soap12:Envelope>
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length
<soap12:Envelope xmlns:xsi="<a href=" http:="" www.w3.org="" 2001="" XMLSchema-instance"="" rel="nofollow">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">
<CreateWaybillResponse xmlns="http://tempuri.org/">
<CreateWaybillResult>
<HasError>boolean</HasError>
<WaybillNo>int</WaybillNo>
<BookingRefNo>string</BookingRefNo>
<Key>int</Key>
<Message>string</Message>
</CreateWaybillResult>
</CreateWaybillResponse>
</soap12:Body>
</soap12:Envelope>
-------------------------- SOAP 1.2 结束------------------------------------------
1
ACTom 2018-07-04 08:39:30 +08:00
|