× 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,

In the context of integrated web services support, you have multiple
options.

(1) Use integrated web services client for ILE to generate stubs and then
use the stubs within your application. To set userid/password for HTTP
basic authentication, you would simply use the APIs:

* ---------------------------------------------------------------
* Set user name to be used for basic authentication.
*
* @param pStub Axis C handle to stub.
* @param pUser User name.
* ---------------------------------------------------------------
D axiscStubSetUsername...
D PR EXTPROC('axiscStubSetUsername')
D pStub * Value
D pUser * Value OPTIONS(*STRING)


* ---------------------------------------------------------------
* Set password to be used for basic authentication.
*
* @param pStub Axis C handle to stub.
* @param pPassword Password.
* ---------------------------------------------------------------
D axiscStubSetPassword...
D PR EXTPROC('axiscStubSetPassword')
D pStub * Value
D pPassword * Value OPTIONS(*STRING)

Documentation and articles can be found at:
http://www.ibm.com/systems/power/software/i/iws/

(2) You can by-pass stub generation and control what is sent using the new
transport APIs. See the article "Send and receive user-defined SOAP and
REST messages from RPG" at
http://www.ibm.com/developerworks/ibmi/library/i-send-receive-user-defined-soap-rest-messages-trs/index.html
. You can set HTTP headers as follows:

DCL-S propBuf1 CHAR(100);
DCL-S propBuf2 CHAR(100);

// Set basic auth
propBuf1 = 'amra' + X'00';
propBuf2 = 'pwd' + X'00';
rc = axiscTransportSetProperty(tHandle:
AXISC_PROPERTY_HTTP_BASICAUTH:
%addr(propBuf1): %addr(propBuf2));

"MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx> wrote on 06/30/2016
03:43:34 PM:

From: Mike Cunningham <mike.cunningham@xxxxxxx>
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Date: 06/30/2016 03:44 PM
Subject: RPG SOAP client
Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx>

I have a need to use SOAP to contact a remote site on a daily basis
and download data using a SOAP request. The remote site requires a
username/password authentication. I can see some examples online of
using RPG to consume a web service using SOAP but none of the ones I
found used an example of a web service that requires authentication.
The company I need to do this with has example code for PHP but we
do not currently use PHP for anything and would prefer to stick with
RPG (or Java) for this one application. Would anyone have an
example of a RPG app that does this?

This is the sample PHP code


<?php

/**

* Sample Web Services Client for PHP to access Reporting API

**/

// Define constants

define('ENDPOINT','https://yourschool-Accommodate.symplicity.com/ws/
report_api.php?wsdl');

define('USERNAME','####');

define('PASSWORD','####');

// Create soap client

$client = new SoapClient(ENDPOINT, array('login' => USERNAME,

'password' => PASSWORD));



// Gets list of reports

// @returns - Array of report information

$result = $client->getReportList();



// Gets list of runs for a given report

// @parameters - report id

// @returns - Array of report run information

$result = $client->getReportRunList('your ID from previous step above');



// Gets report data in XML format

// @parameters - run id

// @returns - report data in SOAP Object/XML format

$result = $client->getReportObject('your run ID from previous step
above');



echo "<pre>";

print_r($result);

echo "</pre>";
?>



Mike Cunningham
VP of Information Technology Services/CIO
Pennsylvania College of Technology


--
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.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.