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