I am new to PHP and UNIX. I am using Apache to do my testing on a Windows Vista machine.
I am getting this error when I am trying to connect to a web service. I did a search and did not see any posts that pertain to this.
Here is my function:
PHP Code:
<?php
function TRECSend($a, $b, $c, $d, $e, $f)
{
$str = '<?xml version=\"1.0\" encoding=\"UTF-8\" ?><Transmission><EdProviderData><DetailData><Detail>';
$str = $str . '<IN_PROV>$a</IN_PROV> <IN_CRSE>$b</IN_CRSE> <IN_CDATE>$c</IN_CDATE> <IN_ZIP>$d</IN_ZIP>';
$str = $str . '<IN_LICENSE>$e</IN_LICENSE> <IN_NAME>$f</IN_NAME> </Detail> </DetailData> </EdProviderData> </Transmission>';
$wsdl="https://www.trec.state.tx.us/ProcessEdRoster/Service1.asmx?wsdl";
$client=new soapclient($wsdl);
// this is the authentication ticket I got from an authentication webservice
try
{
// instantiate soapclient
$client = new SoapClient($wsdl);
// create header object and insert into headers
$header = array(new SoapHeader('https://www.trec.state.tx.us/ValidationSoapHeader/', 'DevToken','12345'));
// $client->__setSoapHeaders($header);
// do it
$outputheader = "";
$response = "";
$response = $client->__soapCall("ProcessRoster", array($str), NULL, $header, $outputheader);
return $response;
}
catch (SoapFault $exception)
{
return $exception;
}
}
echo $TREC = TRECSend('0303','66-66-129-6503','06242009','77041','1234567','Eddi Rae Melton');
?>
Here is the output that I am getting:
SoapFault exception:
[soap:Server] Server was unable to process request. ---> Object reference not set to an instance of an object. in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\TREC.php:27
Stack trace:
#0 C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\TREC.php(27): SoapClient->__soapCall('ProcessRoster', Array, NULL, Array, Array)
#1 C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\TREC.php(36): TRECSend('0303', '66-66-129-6503', '06242009', '77041', '1234567', 'Eddi Rae Melton')
#2 {main}
I am not sure what I need to change to get this to work.
Thanks for your help in advance
Eddi Rae