Don't have anything to contribute with the issue at hand, but I want to throw in my 2 cents here.
You may want to abandon RPG for webservice interactivity and move on to a more modern language like java or .NET to do such activity.
Reason being, as you can see from the article getting RPG to do this is like building a rube Goldberg machine. Java / .NET make these types of programs trivial in comparison.
Matt
-----Original Message-----
From: jklipa [mailto:jklipa@xxxxxxxxx]
Sent: Wednesday, June 12, 2013 9:21 AM
To: midrange-l@xxxxxxxxxxxx
Subject: IWS Connection problems
Hi All,
I'm attempting to connect my first sample RPGLE client app to my first sample Web Service on the IWS...
I'm doing the TempConvert2 example from the IBM Systems Magazine series of 3 articles:
http://www.ibmsystemsmag.com/ibmi/tipstechniques/applicationdevelopment/Integrated-Web-Services-With-ILE-Programs/?page=7
I believe I've got everything setup correctly and running on the IWS, and the Server/Service are running...
I've followed their example steps to create the C Stub modules and the RPGLE with all the modules included...
The problem comes when I issue the call to the client app : "CALL CVTTEMP/CNVRTTEMP '5'"
Source from the example client app:
Program: CNVRTTEMP Library: CVTTEMP Module: CVTTEMPCL
// Get a Web service stub. The host and port for the endpoint may need // to be changed to match host and port of Web service. You can pass // *NULL to getStub() if the endpoint in the WSDL file is correct. Endpoint = '
http://S10b4613:10010/web/services/ConvertTemp2' + X'00'
WsStubP = getStub(%Addr(Endpoint));
// Initialize input values.
TempInF = %trim(TEMPIN) + X'00';
pTempInF = %addr(TempInF);
// Invoke the ConvertTemp Web service operation.
ResultP = ConvertTemp(WsStubP:%Addr(Input));
// Prepare output string depending on what was returned.
if (ResultP <> *NULL);
OutputText = %str(pTempInF) + ' Fahrenheit is '
+ %str(pTempOutC) + ' Celsius.'; else;
OutputText = 'No results returned...'; endif;
When it invokes the Web Service it goes into status "connect" and hangs there until it times out...
Program Statement Procedure QAXIS10C QSYSDIR 73 process__Q2_7axiscpp16Clien > QAXIS10C QSYSDIR 61 invoke__Q2_7axiscpp16Client > QAXIS10HT QSYSDIR 11 openConnection__13HTTPTrans > QAXIS10HC QSYSDIR 15 open__11HTTPChannelFv QAXIS10HC QSYSDIR 148 OpenChannel__11HTTPChannelF >
QSOSRV1 QSYS 83 connect
I'm able to debug it and see that the WsStubP is getting populated with an address for the Endpoint variable...
When I try sending a *Null to getstub() as suggested, It doesn't hang, instead it responds instantly: 'No results returned...'.
So, what is the secret to getting the the endpoint to point correctly to the WebServer/WebService...?
Web Server shows port of 10000, the Web Service shows a port of 10010...
I've tried:
Endpoint = '
http://S10b4613:10010/web/services/ConvertTemp2' + X'00'
Endpoint = '
http://S10b4613:10010/web/services/ConvertTemp' + X'00'
Endpoint = '
http://S10b4613:10000/web/services/ConvertTemp2' + X'00'
Endpoint = '
http://S10b4613:10000/web/services/ConvertTemp' + X'00'
(Both Services are running on the IWS, ConvertTemp and ConvertTemp2)
Could it be there is a Server on the iSeries we need to start...?
We are at V6R1M0 and we do have the prescribed PTFs installed.
Looking for any assistance you can provide...
Thanks,
Jeff Klipa
jklipa at yahoo dot com
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at
http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.