Hi Scott, Indeed I use SOAP version 1.2, because DHL told me to prefer this version.I have changed peContentType parameter according to your advice and it looks much better : now I get the right response message and I can go on to the next step (parse the response)
Many thanks for your great help :-) Pascal Le 11/06/2012 19:38, Scott Klement a écrit :
Hi Pascal, I'm looking at your example a bit closer, and I see that you are using the following SOAP namespace: xmlns:soap="http://www.w3.org/2003/05/soap-envelope" This namespace indicates that you are using SOAP version 1.2. In my experience, this is rare -- SOAP 1.2 never caught on, and most folks use SOAP 1.1 instead. But, HTTPAPI will work with either, if coded correctly. In SOAP version 1.1, the Soap Action was transmitted in it's own HTTP header named "SoapAction". HTTPAPI provides a parameter for this to accomodate people who wish to send that header. It would appear that you are using that header to set your SoapAction. The problem is: That's for SOAP version 1.1. According to your namespace, you are trying to use SOAP version 1.2. In version 1.2, the Soap Action is a part of the Content-Type header. So if you wish to use SOAP version 1.2, you need to code the following in the peContentType parameter to HTTPAPI: 'Content-Type: application/soap+xml;charset=UTF-8;action="urn:createShipmentDD"' You also need to ensure that the peSoapAction parameter is NOT passed for 1.2 -- it's not used in that version of SOAP. Alternately, you can re-generate your XML (with SoapUI) and use the version 1.1 message. If you do that, the namespace should be: xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" And in that case, the Content-type should be : 'text/xml;charset=UTF-8' And the SoapACtion should be: '"urn:createShipmentDD"' Hope that helps. On 6/11/2012 2:16 AM, Pascal Kirscher wrote:Hi Scott, Regarding "<de:DeveloperAuthentification>" section : I have found othing about it in DHL's documentation and the different sample requests that I have got from DHL didn't mention this section. That's why I have omitted it. I thought this will make no problem as the request worked fine using SoapUI. However I have sent an e-mail to DHL technical support about his. In the meantime I have also run the request replacing SOAPaction: http:/test-intraship.dhl.com/ws/1_0/de/ISService/createShipmentDD by urn:createShipmentDD Same result ... (the only thing that has changed in the debug file : Content-Length: 1833 instead of Content-Length: 1830. In the debug file, I have found no error : If I am right, in the following sequence, everything seems to be ok, or does the line SetError() £0: <ns4:GetVersionResponse xmlns:ns4="http://de.ws.intraship"><Version xmlns="http://dhl.de/webservice/cisbase"><majorRelease>1</majorRelease><minorRelease>0</minorRelease><build>14</build></Version></ns4:GetVersionResponse> mean that something is wrong ? Thanks, Pascal Le 08/06/2012 16:27, Scott Klement a écrit :Hi Pascal, In your HTTPAPI debug file, I see this: SOAPAction: http:/test-intraship.dhl.com/ws/1_0/de/ISService/createShipmentDD That doesn't match the SoapUI SoapAction, which is set to "urn:createShipmentDD". Please try changing your HTTPAPI SoapAction to "urn:createShipmentDD". Your said in an earlier e-mail that you had done this already -- but, the HTTPAPI log file still shows an http: URI for the SoapAction (and an invalid one at that!). Also, the SOAP message generated from the WSDL contains these eleements for "Authentification" <de:DeveloperAuthentification> <DEVID>?</DEVID> <APPID>?</APPID> <CERTID>?</CERTID> </de:DeveloperAuthentification> <cis:Authentification> <cis:user>?</cis:user> <cis:signature>?</cis:signature> <!--Optional:--> <cis:accountNumber>?</cis:accountNumber> <cis:type>0</cis:type> </cis:Authentification> However, the one in your code looks like this: <cis:Authentification> <cis:user>Sterling</cis:user> <cis:signature>Online24</cis:signature> <cis:type>0</cis:type> </cis:Authentification> You seem to be missing the entire<de:DeveloperAuthentificaton> element and all of it's contents. I didn't look over the entire transaction, I stopped after I noticed the Authentification doesn't match. I'm hoping this is enough information to point you in the right direction? On 6/8/2012 2:36 AM, Pascal Kirscher wrote:Hi Scott, Many thanks for your quick answer (and for the great tools you provide). The SoapAction that I have tried (urn:createShipmentDD) is the one that is displayed in the SoapUI request : POST [1]http://test-intraship.dhl.com/ws/1_0/de/ISService HTTP/1.1 Accept-Encoding: gzip,deflate Content-Type: text/xml;charset=UTF-8 SOAPAction: "urn:createShipmentDD" I have tried in different ways : 'urn:createShipmentDD', '[2]http://test-intraship.dhl.com/ws/1_0/de/ISService/ createShipmentDD' , 'createShipmentDD' To make things easier, I send : - DHL's wdsl - a createshipmentDD request that works with SoapUI and the response - the httpapi_debug.txt file that results when I run my program Again, thanks a lot for your help. Pascal Le 08/06/2012 00:18, Scott Klement a écrit : Hi Pascal, Surely if SoapUI is working, you can look at the SoapAction that it is using, and send the same thing via HTTPAPI? Make sure you're also updating the URI in addition to the SoapAction. I'm not familiar with DHL's web service, but most sites that I use specify both a different URI and a different SoapAction in order to access a different operation. If that doesn't work, please provide the WSDL file you're working with (I don't use DHL, so I don't have access to it, myself) and an httpapi_debug.txt file so I can compare them and look for something that doesn't match. Thanks! On 6/7/2012 4:32 AM, Pascal Kirscher wrote: Hello, I am new to webservices. I need to use DHL webservices, in order to create shipments, get labels, etc... So, first I have tried some simple webservices, like [1]stockquote, [2]currency convertor (with IBM's wdsl2rpg and with Scott's HTTPAPI), and this worked fine with both the tools. With DHL WebService, I first tried the GetVersion opération, and this also was successful. But, I am now blocked with the other operation (createShipmentDD, getLabelDD) : I have checked my requests using SoapUI, and this works fine, but not when I try to consume the webservice using HTTPAPI in a RPG program I guess that the problem comes from the parameters when I call the http_url_post_xml function, and especially the last one, the SOAPaction. Based on the values that I retrieve from SoapUI, hereafter, the beginning of the request : POST [3][3]http://test-intraship.dhl.com/ws/1_0/de/ISService HTTP/1.1 Accept-Encoding: gzip,deflate Content-Type: text/xml;charset=UTF-8 SOAPAction: "urn:createShipmentDD" I have tried to call it this way : rc = http_url_post_xml( '[4][4]http://test-intraship.dhl.com/ws/1_0/de/ISService' : %addr(SOAP) + 2 : %len(SOAP) : *NULL : %paddr(Incoming) : %addr(value) : HTTP_TIMEOUT : HTTP_USERAGENT : 'application/xml' : 'urn:createShipmentDD'); I have tried different values ('urn:createShipmentDD', '[5][5]http://test-intraship.dhl.com/ws/1_0/de/ISService/createShipmentDD' ) but each time, I get the result of the GetVersion operation (which must be the default action I suppose) I would be very grateful if someone could help me ... Pascal ----------------------------------------------------------------------- This is the FTPAPI mailing list. To unsubscribe, please go to: [6]http://www.scottklement.com/mailman/listinfo/ftpapi ----------------------------------------------------------------------- References 1. http://test-intraship.dhl.com/ws/1_0/de/ISService 2. http://test-intraship.dhl.com/ws/1_0/de/ISService/createShipmentDD 3. http://test-intraship.dhl.com/ws/1_0/de/ISService 4. http://test-intraship.dhl.com/ws/1_0/de/ISService 5. http://test-intraship.dhl.com/ws/1_0/de/ISService/createShipmentDD 6. http://www.scottklement.com/mailman/listinfo/ftpapi ----------------------------------------------------------------------- This is the FTPAPI mailing list. To unsubscribe, please go to: http://www.scottklement.com/mailman/listinfo/ftpapi ---------------------------------------------------------------------------------------------------------------------------------------------- This is the FTPAPI mailing list. To unsubscribe, please go to: http://www.scottklement.com/mailman/listinfo/ftpapi ---------------------------------------------------------------------------------------------------------------------------------------------- This is the FTPAPI mailing list. To unsubscribe, please go to: http://www.scottklement.com/mailman/listinfo/ftpapi ---------------------------------------------------------------------------------------------------------------------------------------------- This is the FTPAPI mailing list. To unsubscribe, please go to: http://www.scottklement.com/mailman/listinfo/ftpapi -----------------------------------------------------------------------
begin:vcard fn:Pascal Kirscher n:Kirscher;Pascal org:SES-Sterling SA adr;quoted-printable:;;1 bis, rue de D=C3=A9l=C3=A9mont;Saint-Louis;;68300;France email;internet:pkirscher@xxxxxxxxxxxxxxxx title:DSI tel;work:03 89 70 20 36 tel;fax:03 89 70 20 37 url:www.ses-sterling.com version:2.1 end:vcard
----------------------------------------------------------------------- This is the FTPAPI mailing list. To unsubscribe, please go to: http://www.scottklement.com/mailman/listinfo/ftpapi -----------------------------------------------------------------------