Topic
  • 8 replies
  • Latest Post - ‏2012-04-19T06:39:55Z by pkir
pkir
pkir
5 Posts

Pinned topic wsdl2rpg and DHL web services

‏2012-04-16T09:36:19Z |
Hello,

I am new to web services on IBM i system and need to consume DHL web service.

First I have successfully achieved some test with simple web services like Stockquote

I have also checked the DHL wbe services on SoapUI tool and was able to execute the web services.

But, when I try to create the stub using wsdl2rpg, I get following error message : "java.io.IOException: Server returned HTTP response code: 403 for URL: http://www.intraship.de/ws/1_0/ISService/DE.wsdl"
It seems that I should be able to specify somewhere a login and password (what I had to do in SoapUI in order to run the services successfully), but I don't know where I am supposed to put on these authentication informations.
I use wsdl2rpg on V6R1 , PTF SI44902 installed.

I'll be very grateful for any help on this matter

Pascal
Updated on 2012-04-19T06:39:55Z at 2012-04-19T06:39:55Z by pkir
  • pkir
    pkir
    5 Posts

    Re: wsdl2rpg and DHL web services

    ‏2012-04-16T14:16:27Z  
    In the mean time, I have seen that the 403 response was due to proxy problems...

    However, it still doesn't work fine.
    Now, when I run wsdl2rpg to create the stub for DHL web services, I get following messages :

    java.lang.NullPointerException
    at org.apache.axis.wsdl.wsdl2ws.WSDL2Ws.exposeReferenceTypes(Unknown Source)
    at org.apache.axis.wsdl.wsdl2ws.WSDL2Ws.generateWrappers(Unknown Source)
    at com.ibm.systemi.iws.client.codegen.axis.scripts.WSDL2WS.generateStubs(WSDL2WS.java:129)
    at com.ibm.systemi.iws.client.codegen.axis.scripts.WSDL2WS.startStubGeneration(WSDL2WS.java:62)
    at com.ibm.systemi.iws.client.codegen.axis.scripts.WSDL2RPG.main(WSDL2RPG.java:41)

    So, any suggestion is still welcome.

    Pascal
  • jmerinoh
    jmerinoh
    2 Posts

    Re: wsdl2rpg and DHL web services

    ‏2012-04-16T15:34:36Z  
    While I have not used the out of the box version from IBM and sometimes you need more PTFs, if you allow me, I'd suggest other alternatives to consume web services:
    http://www.scottklement.com/httpapi/
    and
    http://www.tools400.de/English/Freeware/WSDL2RPG/wsdl2rpg.html
  • pkir
    pkir
    5 Posts

    Re: wsdl2rpg and DHL web services

    ‏2012-04-16T15:40:03Z  
    • jmerinoh
    • ‏2012-04-16T15:34:36Z
    While I have not used the out of the box version from IBM and sometimes you need more PTFs, if you allow me, I'd suggest other alternatives to consume web services:
    http://www.scottklement.com/httpapi/
    and
    http://www.tools400.de/English/Freeware/WSDL2RPG/wsdl2rpg.html
    Many thanks for your answer. I'll try tomorrow

    Pascal
  • amra1
    amra1
    58 Posts

    Re: wsdl2rpg and DHL web services

    ‏2012-04-17T01:22:35Z  
    • pkir
    • ‏2012-04-16T15:40:03Z
    Many thanks for your answer. I'll try tomorrow

    Pascal
    Please load and apply ptf SI46084.

    If problem persists, and you can post the WSDL, then please do. Otherwise, I would contact the IBM support representative.
  • amra1
    amra1
    58 Posts

    Re: wsdl2rpg and DHL web services

    ‏2012-04-18T01:51:46Z  
    The problem seems to be in defined types...I tried to run wsdl2java and got lots of errors. So I guess you need to clean up the WSDL and associated XSD files.

    Here are some of the errors:

    WSWS3204E: Error: {http://dhl.de/webservice/cisbase}countryISOType already exists.
    WSWS3204E: Error: {http://dhl.de/webservice/cisbase}EKP already exists.
    WSWS3204E: Error: {http://dhl.de/webservice/cisbase}>EKP already exists.
    WSWS3204E: Error: {http://dhl.de/webservice/cisbase}partnerID already exists.
    WSWS3204E: Error: {http://dhl.de/webservice/cisbase}>partnerID already exists.
    WSWS3204E: Error: {http://dhl.de/webservice/cisbase}procedureID already exists.
    WSWS3204E: Error: {http://dhl.de/webservice/cisbase}>procedureID already exists.
    WSWS3204E: Error: {http://dhl.de/webservice/cisbase}accountNumber already exists.
    WSWS3204E: Error: {http://dhl.de/webservice/cisbase}>accountNumber already exists.
    WSWS3204E: Error: {http://dhl.de/webservice/cisbase}accountNumberExpress already exists.
    WSWS3204E: Error: {http://dhl.de/webservice/cisbase}>accountNumberExpress already exists.
    WSWS3204E: Error: {http://dhl.de/webservice/cisbase}identCode already exists.
    WSWS3204E: Error: {http://dhl.de/webservice/cisbase}>identCode already exists.

    I think you need to ensure element declarations are unique.
  • pkir
    pkir
    5 Posts

    Re: wsdl2rpg and DHL web services

    ‏2012-04-18T11:42:29Z  
    • amra1
    • ‏2012-04-18T01:51:46Z
    The problem seems to be in defined types...I tried to run wsdl2java and got lots of errors. So I guess you need to clean up the WSDL and associated XSD files.

    Here are some of the errors:

    WSWS3204E: Error: {http://dhl.de/webservice/cisbase}countryISOType already exists.
    WSWS3204E: Error: {http://dhl.de/webservice/cisbase}EKP already exists.
    WSWS3204E: Error: {http://dhl.de/webservice/cisbase}>EKP already exists.
    WSWS3204E: Error: {http://dhl.de/webservice/cisbase}partnerID already exists.
    WSWS3204E: Error: {http://dhl.de/webservice/cisbase}>partnerID already exists.
    WSWS3204E: Error: {http://dhl.de/webservice/cisbase}procedureID already exists.
    WSWS3204E: Error: {http://dhl.de/webservice/cisbase}>procedureID already exists.
    WSWS3204E: Error: {http://dhl.de/webservice/cisbase}accountNumber already exists.
    WSWS3204E: Error: {http://dhl.de/webservice/cisbase}>accountNumber already exists.
    WSWS3204E: Error: {http://dhl.de/webservice/cisbase}accountNumberExpress already exists.
    WSWS3204E: Error: {http://dhl.de/webservice/cisbase}>accountNumberExpress already exists.
    WSWS3204E: Error: {http://dhl.de/webservice/cisbase}identCode already exists.
    WSWS3204E: Error: {http://dhl.de/webservice/cisbase}>identCode already exists.

    I think you need to ensure element declarations are unique.
    Thanks for your answers.

    I am about to install the suggested PTFs, and after you last reply, will also contact DHL support so that they provide a clean wsdl file.

    Also, I have tried WSDL2RPG provided by tools400.de, as adviced by jmerinoh : it was quite easy to install, and I have been able to generate the stub successfully. :-)

    However, certainly due to my lacks regarding webservices, I find it really complex to use DHL provided webservices (I have tried some basic examples like stockquote, weather, etc..., and that worked fine), but the program the RPG to consume more complex webservices (like DHL's) seems to be very hard.
    Have I missed something ? Is it possible to find some rules, methods to apply when programming RPG consuming webservices ?

    At the moment, I have generated the stub (using WSDL2RPG from tools400.de), have got the Service Request and Response Parameter Structures (attached to this post), and really don't know how to go on
    Thanks in advance for your advices

    Pascal
  • jmerinoh
    jmerinoh
    2 Posts

    Re: wsdl2rpg and DHL web services

    ‏2012-04-18T14:26:52Z  
    • pkir
    • ‏2012-04-18T11:42:29Z
    Thanks for your answers.

    I am about to install the suggested PTFs, and after you last reply, will also contact DHL support so that they provide a clean wsdl file.

    Also, I have tried WSDL2RPG provided by tools400.de, as adviced by jmerinoh : it was quite easy to install, and I have been able to generate the stub successfully. :-)

    However, certainly due to my lacks regarding webservices, I find it really complex to use DHL provided webservices (I have tried some basic examples like stockquote, weather, etc..., and that worked fine), but the program the RPG to consume more complex webservices (like DHL's) seems to be very hard.
    Have I missed something ? Is it possible to find some rules, methods to apply when programming RPG consuming webservices ?

    At the moment, I have generated the stub (using WSDL2RPG from tools400.de), have got the Service Request and Response Parameter Structures (attached to this post), and really don't know how to go on
    Thanks in advance for your advices

    Pascal
    If you are using WSDL2RPG from Thomas Raddatz, you might be interested on subscribe to the mail list at http://www.scottklement.com/mailman/listinfo/ftpapi, you may receive help from both Scott Klement, Thomas Raddatz on both HTTPAPI and WSDL2RPG.

    Regarding testing the web services and their modes, you might want to try 'soap UI' tool from http://www.soapui.org/ , that tool allows you to 'test' the web service without actually do any kind of programming; you can discover the methods, parameters, and variables than the web service is expecting, then execute each method and pass the appropriate parameters to the specific method that you need, it is one of the best tools available to test web services, it is open source as well.

    Also, you might want to read this excellent presentation from Scott Klement about Web Services with RPG: http://www.scottklement.com/presentations/Web%20Services%20from%20RPG%20with%20HTTPAPI.pdf , he provides examples to consume a fedex web services with HTTAPI as well as examples of how to use soap UI.

    -Jorge
  • pkir
    pkir
    5 Posts

    Re: wsdl2rpg and DHL web services

    ‏2012-04-19T06:39:55Z  
    • jmerinoh
    • ‏2012-04-18T14:26:52Z
    If you are using WSDL2RPG from Thomas Raddatz, you might be interested on subscribe to the mail list at http://www.scottklement.com/mailman/listinfo/ftpapi, you may receive help from both Scott Klement, Thomas Raddatz on both HTTPAPI and WSDL2RPG.

    Regarding testing the web services and their modes, you might want to try 'soap UI' tool from http://www.soapui.org/ , that tool allows you to 'test' the web service without actually do any kind of programming; you can discover the methods, parameters, and variables than the web service is expecting, then execute each method and pass the appropriate parameters to the specific method that you need, it is one of the best tools available to test web services, it is open source as well.

    Also, you might want to read this excellent presentation from Scott Klement about Web Services with RPG: http://www.scottklement.com/presentations/Web%20Services%20from%20RPG%20with%20HTTPAPI.pdf , he provides examples to consume a fedex web services with HTTAPI as well as examples of how to use soap UI.

    -Jorge
    I have read Scott Klement's presentation, and things look much more clearer now. I will try again the DHL webservices, following these instructions.

    Thanks again for your help.

    Pascal