Link to home
Create AccountLog in
IBM System i

IBM System i

--

Questions

--

Followers

Top Experts

Avatar of Theo Kouwenhoven
Theo Kouwenhoven🇳🇱

using the IBM "wsdl2rpg.sh" tool
Hi Experts,

I did create a webservice client form an existing wsdl, using the IBM "wsdl2rpg.sh" tool.
"/QIBM/ProdData/OS/WebServices/V1/client/bin/wsdl2rpg.sh"
But the result was to complex to understand what I had to do to use it.
So I create an own service wit only 2 values in and 1 value out.
But still I have no clue where to start.

The result of the wsdl2rpg is:
14 C-sources,
1 Cl-source,
2 Rpgle-sources,
3 Rpgleinc-sources

I understand that de CL is compiling the C-sources and create the service program.
But I need some info about how to use the result of the wsdl2rpg generation.


I used the attached WSDL for this test.
(expected output value is Input1 + input2)
MyWs.wsdl

Zero AI Policy

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of Gary Patterson, CISSPGary Patterson, CISSP🇺🇸

wsdl2rpg.sh takes a WSDL, and generates C programs, and RPG stubs to call the C programs, so that you can call the web service from RPG.

There is a whole manual on this tool.  IT should answer just about any question you might have:

ftp://public.dhe.ibm.com/systems/support/i/iws/systems_i_software_iws_pdf_WebServicesClient_new.pdf

Also, here is a tutorial that walks you though the process of using wsdl2rpg using a simple example:

https://www.mcpressonline.com/programming/rpg/cool-things-ile-rpg-as-a-web-services-client

Avatar of Theo KouwenhovenTheo Kouwenhoven🇳🇱

ASKER

Hi Gary,

Found a WSDL on "http://currencyconverter.kowabunga.net/converter.asmx?WSDL",
it's not 100% the same but I was able to create a test program.

It's not working yet, but I understand the idea :-)

Avatar of Theo KouwenhovenTheo Kouwenhoven🇳🇱

ASKER

Hi,

The only response I get from the WS-Call is an error:
"HTTPTransportException: HTTP transport error.■Server sent HTTP error: 'Forbidden'■"

Because I am able to get a response from WS with SoapUI it isn't a protected server.
It was possible to grab the wsdl from this server with wsdl2rpg.sh, so I assume it is also not a authorization issue on the AS/400.

Is there any log available where I can find the details about this error?

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


You connected to a remote HTTP server.  It understood the request, but it responded "Forbidden", indicating that you attempted to access an asset or service that you weren't authorized to.  Usually this means that there are server-side authentication requirements that you have not met, or your URL is not quite right.

https://httpstatuses.com/403

The relevant log would be on the server.  If you want client-side logging, you'd have to write that.  Suggest you debug and view the url and request you are constructing.

Please post your code, and the working SoapUI request.

Avatar of Theo KouwenhovenTheo Kouwenhoven🇳🇱

ASKER

Hi Gary,

The stubs are generated from url : http://currencyconverter.kowabunga.net/converter.asmx?WSDL

The result of the attached RPG  is:
WS_DS.HANDLE = SPP:0000800047154DD0
WS_DS.EXCOCCURRED = '1'
WS_DS.EXCCODE = 51    
WS_DS.EXCSTRING =  HTTPTransportException: HTTP transport error.■Server sent HTTP error: 'Forbidden'■                                          

RPg-Line 19  "stub_create_ConverterSoap(ws_ds);", retuns a True,
I get an WS_DS.HANDLE value, so that seems to be correct (and available).

The attachment with SoapUI data contains the expected result.
Test_Rpg.txt
Test_SoapUI_xml.txt

Avatar of Theo KouwenhovenTheo Kouwenhoven🇳🇱

ASKER

The 'Forbidden' problem is not solved yet, but I was able to call a few services from our own iServer.
But I really need to caal external services, so I tried an other one.

The result is now:
HTTPTransportException: Cannot initialize a channel to the emote end.■GSKit Error is 202 - Key database file was not found.

I understood that it is a certificate issue (far beyond my kowledge-area)
So I copied an example and it seems to do something.
axiscStubSetSecure(ws_ds.handle:'/QIBM/USERDATA/ICSS/CERT/SERVER/DEFAULT.KDB':'':'':'NONE':'NONE':'':'':'':'true');

the new error is:
HTTPTransportException: HTTP transport error.■Server sent HTTP error: 'Bad Request'■                                    

Because I dont know what I am doing, nor what the SetSecure is doing for me, I have really can't no idea what is wrong.
Could be data, could a certificate or something else.

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


HTTPTransportException: Cannot initialize a channel to the emote end.■GSKit Error is 202 - Key database file was not found.

Looks like you're trying to connect to a service that requires SSL, but you didn't configure for SSL.

Then you called SetSecure to provide the local certificate database

axiscStubSetSecure(ws_ds.handle:'/QIBM/USERDATA/ICSS/CERT/SERVER/DEFAULT.KDB':'':'':'NONE':'NONE':'':'':'':'true');

Now you are successfully connecting, but you are sending an invalid request to the web service host.  

If you can provide a trace log (mask out anything private), we might be able to provide more help.

Avatar of Theo KouwenhovenTheo Kouwenhoven🇳🇱

ASKER

Hi Gary,

How can I make (or where can I find) a trace log?

ASKER CERTIFIED SOLUTION
Avatar of Gary Patterson, CISSPGary Patterson, CISSP🇺🇸

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account

Avatar of Theo KouwenhovenTheo Kouwenhoven🇳🇱

ASKER

Hi Gary,

The function axiscAxisWriteTrace() is not available in RPG, but axiscAxisStartTrace() is logging the whole process, and pointed me to the right direction.

I couldn't find this in the manual, but  defining a Data-structure with LikeDs(), from a imported template,  is requiring an inz option.
Without that, the result is unpredictable.

SO the first WS is running 10 other to go :-)

THANKS!!!!!!!!

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Avatar of Theo KouwenhovenTheo Kouwenhoven🇳🇱

ASKER

Thanks for this fast solution/response.

Happy to help.
IBM System i

IBM System i

--

Questions

--

Followers

Top Experts

IBM i, formerly known as AS/400, is a proprietary, midrange, object-based operating and application system. It includes a relational database, a menu-driven interface, support for multiple users, block-oriented terminal support and printers, and supports security, communications, and web-based application servers including Websphere, Apache and Tomcat.