NuSOAP Help
Posted: Tue Jun 10, 2008 2:07 pm
If anyone is familiar with Clearview TSS, that'd be great. Even if you aren't, maybe you can help me!
I received the following example snippets of code with no real instruction as to how to modify them to use them correctly. If anyone can shed some light on this, please do.
Login Form
Contact Form
5. PHP4 with NuSOAP Example
Thanks for any help you can give! This one is really confusing me!
I received the following example snippets of code with no real instruction as to how to modify them to use them correctly. If anyone can shed some light on this, please do.
Code: Select all
[b]Method[/b]
Remote_candidate
[b]Parameters[/b]
SiteName
AccessCode
[b]Sample XML[/b]
<?xml version="1.0" encoding="UTF-8"?>
<Customer cid="00">
<Discipline id="DisciplineMaster-1">
<CertName>RN</CertName>
</Discipline>
<Discipline id="DisciplineMaster-2">
<CertName>LVN/LPN</CertName>
</Discipline>
<Discipline id="DisciplineMaster-3">
<CertName>CNA</CertName>
</Discipline>
<Discipline id="DisciplineMaster-4">
<CertName>RT</CertName>
</Discipline>
<Discipline id="DisciplineMaster-5">
<CertName>ST</CertName>
</Discipline>
</Customer>Code: Select all
<form action="[FormActionURL]" method="post" name="login">
<input type="hidden" name="ReturnURL" value="[ReturnURL]">
<input type="hidden" name="CustID" value="[CID From XML]">
<input type="text" name="LoginUsername">
<input type="password" name="LoginPassword">
<input type="submit" name="submit" value="Login">
</form>Code: Select all
<form action="[FormActionURL]" method="post" name="contact">
<input type="hidden" name="ReturnURL" value="[ReturnURL]">
<input type="hidden" name="CustomerID" value="[CID From XML]">
<input type="text" name="CFirstName" size="">
<input type="text" name="CLastName" size="">
<input type="text" name="CZip" size="">
<select name="CState">
<option value="0">-- Select --</option>
</select>
<select name="DisciplineID">
<option value="">-- Select --</option>
<option value="[DisciplineID From XML]">[CertName From XML]</option>
</select>
<input type="text" name="CEmail" size="">
<input type="text" name="CPhone" size="">
<input type="submit" value="submit" name="Submit">
</form>Code: Select all
<?php
//-------------------------------
// Setup some required variables.
//-------------------------------
global $ReturnURL;
global $FormActionURL;
$siteName = "clearview";
$accessCode = "0000000000";
$ReturnURL = "http://www.clearviewtss.com/";
$FormActionURL = "http://rss1.securetss.com/$siteName/remote_login_control.cfm";
$wsdl="http://rss1.securetss.com/com/clearviewtss/rss/remote_candidate.cfc?wsdl";
$param=array(
'SiteName'=>$siteName,
'AccessCode'=>$accessCode
);
require_once('lib/nusoap.php');
$rss = new soapclient($wsdl, 'true');
$xml = $rss->call('Remote_candidate', $param);
?>
<form action="<?php echo $FormActionURL; ?>" method="post" name="contact">
<input type="hidden" name="ReturnURL" value="<?php echo $ReturnURL; ?>">
<?php
if (! ($xmlparser = xml_parser_create()) )
{
die ("Cannot create parser");
}
$Current = "";
function start_tag($parser, $name, $attribs) {
global $current;
global $RCustomerID;
$current = $name;
if($name == 'DISCIPLINE'){echo "<option value=\"";}
if (is_array($attribs)) {
while(list($key,$val) = each($attribs)) {
//--------------------
// Set the customerID
//--------------------
if($key == 'CID'){
$RCustomerID = $val;
echo "<br>Discipline: <select name=\"DisciplineID\"><option value=\"\">--Select--</option>";
}
if($key == 'ID'){echo "$val\">";}
}
}
}
function tag_contents($parser, $data) {
global $current;
if($current == 'CERTNAME') {echo $data;}
}
function end_tag($parser, $name) {
if($name == 'DISCIPLINE'){echo "</option>";}
if($name == 'CUSTOMER'){echo "</select>";}
}
xml_set_element_handler($xmlparser, "start_tag", "end_tag");
xml_set_character_data_handler($xmlparser, "tag_contents");
xml_parse($xmlparser, $xml);
?>
<input type="hidden" name="CustomerID" value="<?php echo $RCustomerID; ?>">
<input type="submit" value="submit" name="Submit">
</form>Thanks for any help you can give! This one is really confusing me!