CheckLogin




<'.$WebMethodName. ' xmlns="http://3-si.com/namespaces/webservice/OMWPublic">‘;

return $CallHeader;
}

function createCallFooter(){
global $WebMethodName;
$CallFooter = ‘

‘;
return $CallFooter;
}

function createCallParamList(){
global $ClientKey;
$CallParamsList = ”;
$CallParamsList .= ““.$ClientKey.”“;
$CallParamsList .= “” .$_REQUEST[‘txtusername’]. ““;
$CallParamsList .= “” .$_REQUEST[‘txtpassword’]. ““;
return $CallParamsList;
}

function buildSOAPcall(){
// combine the call header, detail and footer
global $CallHeader, $CallParamsList, $CallFooter;

$SOAPString = ”;
$SOAPString .= $CallHeader;
$SOAPString .= $CallParamsList;
$SOAPString .= $CallFooter;
print $soapstring;
return $SOAPString;
}

function callWebService($SOAPString){
// Get global headers variable
global $SOAPHeader, $WebToolsURL;

$SOAPHeader[]=’Content-Length:’ .strlen($SOAPString);
// Send the request array to the calculator web service
$opt = curl_init();
curl_setopt($opt, CURLOPT_URL, $WebToolsURL);
curl_setopt($opt, CURLOPT_POST, 1);
curl_setopt($opt, CURLOPT_USERAGENT, “ltt ws call version 0.1”);
curl_setopt($opt, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($opt, CURLOPT_POSTFIELDS, $SOAPString);
curl_setopt($opt, CURLOPT_HTTPHEADER, $SOAPHeader);

$responseString = curl_exec ($opt);

if (curl_errno($opt) != 0){
$responseString = “An error has occurred”;
}

curl_close ($opt);

$responseString = str_replace(“<“, “<", $responseString); $responseString = str_replace(">", ">“, $responseString);

return ($responseString);

}

$SOAPHeader = createSOAPHeader();
$CallHeader = createCallHeader();
$CallParamsList = createCallParamList();
$CallFooter = createCallFooter();

$SOAPString = buildSOAPcall();

//echo $SOAPString;
$response = callWebService($SOAPString);

echo $response;

?>