× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi, I need to initiate a REST service on a PC server, after a RPG job completes.

There are a set of JSON requests available on the PC server.

I had a look on IBM developerworks that gives very good examples how to initiate a REST service.

1)The first one is a Authentication call.

I managed to make the authentication call with the supplied login credentials (I get a "SUCCESS" XML back)

Uri = <url with the user and password supplied>
Uri2= <url with the actual call ti initate the job on the PC>

tHandle_A = axiscTransportCreate(uri:AXISC_PROTOCOL_HTTP11);
if (tHandle_A = *NULL);
PRINT ('TransportCreate() failed');
return;
endif;


propBuf = 'GET' + X'00';
axiscTransportSetProperty(tHandle_A: AXISC_PROPERTY_HTTP_METHOD: %addr(propBuf));
flushAndReceiveData();




2)I'm struggling to find a way to pass this Authentication handle/token (tHandle_A) back to the next call that initiates the actual service.

In the next call, that will initiate the job on the PC server, I create new Handle , with a new URL (Uri2) to pass the necessary info to be able to make the call .

I tried to rather set the authentication properties on the second call by utilizing:

rc =axiscTransportSetProperty(tHandle:AXISC_PROPERTY_HTTP_BASICAUTH:%addr(propBuf1):%addr(propBuf2));

That doesn't work.

What I need is something like this: rc =axiscTransportSetProperty(tHandle_B:AXISC_PROPERTY_HTTP_BASICAUTH:thandle_A);

Where I pass the original handle (tHandle_A) that I got when I authenticated with the first call.

Or any other method to supply the authentication token with the next call.

Any advice would be appreciated.


Deon Fourie


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.