[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Ftpapi] Is there anyone willing to share code for DHL Connection using ShipmentRequest - SOAP?



Eval      wkResultNum = http_url_post(
                 %trim ( SURL16 )
                : %addr ( wkSOAPdata : *data )
                : %len ( wkSOAPdata )
                : wkRcvFileName
                : HTTP_TIMEOUT
                : HTTP_USERAGENT
                : 'text/xml'
                : %trim ( SOPA16 ) )

Looks like SOPA16 is blank for me; the magic happens in the content. The DHL test server URL is https://xmlpitest-ea.dhl.com/XMLShippingServlet and there's a browser interface here:

https://xmlpi-validation.dhl.com/serviceval/jsps/main/Main_menu.jsp

Click on "Shipment Validation" then "XML Services" then one of the Sample XMLs on the right hand side of the screen. That will give you a sample document which should validate after you modify the Date about 2/3 of the way down. The top two lines of the same document look like this:

<?xml version="1.0" encoding="UTF-8"?>
<req:ShipmentRequest xmlns:req="http://www.dhl.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dhl.com ship-val-global-req.xsd" schemaVersion="5.0">

So I guess the SOAP action bit comes from the second line. You can experiment to discover which data you want to send by chopping around the sample XML; I didn't find it easy to figure out from the DHL documentation what was mandatory.I defined wkSOAPdata as:

D wkSOAPdata      S               A   len(4000000)
D                                     varying(4)

I also write wkSOAPdata out to a file for debug purposes, but the above should get you started. Hope this helps.




On 13 February 2018 at 17:57, Geoffrey Watkins <Geoffrey.Watkins@xxxxxxxxxxx> wrote:
Hi,

I am attempting to connect to DHL using the HTTPAPI code from Scott.

Already using it for UPS and TNT, from an earlier version of the code.



The XML looks good, just looking for the Post instruction - which I know is changed.

nRC = https_url_post_xml(............    
       

It also looks like I need to set the SOAP Action

http_setOption('SoapAction': '"ShipmentRequest"');


Any hints or information would be welcome.

Thanks,
Geoffrey

Geoffrey A. Watkins
Senior Application Developer/Analyst
Cascade Corporation
2201 NE 201st Ave
Fairview, OR 97024-9718
USA

Office: 503 669 6366
geoffrey.watkins@xxxxxxxxxxx  

Logo


The information contained in this email and any attachments is confidential and may be subject to copyright or other intellectual property protection. If you are not the intended recipient, you are not authorized to use or disclose this information.


--
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi


-- 
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi