V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Mose
V2EX  ›  编程

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

  •  
  •   Mose · 2018-07-04 00:27:03 +08:00 · 2999 次点击
    这是一个创建于 2336 天前的主题,其中的信息可能已经有所发展或是发生改变。

    最近最做的一个项目,是接的老外的一个接口,要用 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 结束------------------------------------------

    ACTom
        1
    ACTom  
       2018-07-04 08:39:30 +08:00
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3086 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 14:09 · PVG 22:09 · LAX 06:09 · JFK 09:09
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.