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
LVL 17
Theo KouwenhovenApplication ConsultantAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Gary PattersonVP Technology / Senior Consultant Commented:
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
Theo KouwenhovenApplication ConsultantAuthor Commented:
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 :-)
Theo KouwenhovenApplication ConsultantAuthor Commented:
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?
Introduction to Web Design

Develop a strong foundation and understanding of web design by learning HTML, CSS, and additional tools to help you develop your own website.

Gary PattersonVP Technology / Senior Consultant Commented:
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.
Theo KouwenhovenApplication ConsultantAuthor Commented:
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
Theo KouwenhovenApplication ConsultantAuthor Commented:
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.
Gary PattersonVP Technology / Senior Consultant Commented:
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.
Theo KouwenhovenApplication ConsultantAuthor Commented:
Hi Gary,

How can I make (or where can I find) a trace log?
Gary PattersonVP Technology / Senior Consultant Commented:
Hi Theo,

Tracing is covered in pretty good detail detail in the Web Service Client manual I provided up above.  Note that the best examples are in C, but the calls are very similar - you probably won't have trouble translating.

See chapter 21 for a brief RPG example.  

But look at the parameters for the C language stubs for details about the parameters:  See axiscAxisStartTrace() on page 146 for details on how tracing works.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Theo KouwenhovenApplication ConsultantAuthor Commented:
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!!!!!!!!
Theo KouwenhovenApplication ConsultantAuthor Commented:
Thanks for this fast solution/response.
Gary PattersonVP Technology / Senior Consultant Commented:
Happy to help.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
RPGLE

From novice to tech pro — start learning today.