Object reference not set to an instance of an object
Posted: Wed Jun 24, 2009 12:24 pm
I am new to PHP and webservices.
I am getting an error that I am not sure where to start looking.
My code in PHP is:
The error that I am getting is as follows:
Where do I start looking?
Thanks for your help!!
Eddi Rae
I am getting an error that I am not sure where to start looking.
My code in PHP is:
Code: Select all
<?php
function TREC($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 = new SoapHeader('https://www.trec.state.tx.us/ValidationSoapHeader/', 'DevToken',$DevToken, false);
// do it
$response = $client->ProcessRoster(array($str), NULL, $header);
return $response;
}
catch (SoapFault $exception)
{
return $exception;
}
}
$TREC = TREC('0303','66-66-129-6503','06242009','77041','1234567','Eddi Rae Melton');
echo $TREC;
?>Code: Select all
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:33
Stack trace:
#0 [internal function]: SoapClient->__call('ProcessRoster', Array)
#1 C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\TREC.php(33): SoapClient->ProcessRoster(Array, NULL, Object(SoapHeader))
#2 C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\TREC.php(44): TREC('0303', '66-66-129-6503', '06242009', '77041', '1234567', 'Eddi Rae Melton')
#3 {main}Thanks for your help!!
Eddi Rae