有没有用 PHP 调过这种接口的,求指点

2018-07-04 00:27:03 +08:00
 Mose

最近最做的一个项目,是接的老外的一个接口,要用 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="&lt;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/">

soap:Body

<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="&lt;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/">

soap:Body

<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="&lt;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">

soap12:Body

<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="&lt;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">

soap12:Body

<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 结束------------------------------------------

2813 次点击
所在节点    编程
1 条回复
ACTom
2018-07-04 08:39:30 +08:00

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/467943

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX