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



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



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.