note 100291 deleted from soapclient.soapclient by danbrown
| From: | danbrown@php.net | Date: | Wed, 06 Oct 2010 14:43:36 +0000 |
| Subject: | note 100291 deleted from soapclient.soapclient by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-173008@lists.php.net to get a copy of this message | ||
Note Submitter: titan at phpdevshell dot org
----
It should be noted that if you receive a return error : 'Object reference not set to an
instance of an object.'. This could be due to something as simple as passing the incorrect
parameters. When you look at this XML:
Your code should look something like this:
try {
$options = array(
'soap_version'=>SOAP_1_2,
'exceptions'=>true,
'trace'=>1,
'cache_wsdl'=>WSDL_CACHE_NONE
);
$client = new SoapClient('http://yoururl/doc.asmx?WSDL', $options);
// Note where 'Get' and 'request' tags are in the XML
$results =
$client->Get(array('request'=>array('CustomerId'=>'1234')));
} catch (Exception $e) {
echo "<h2>Exception Error!</h2>";
echo $e->getMessage();
}
$results =
$client->Get(array('request'=>array('CustomerId'=>'842115')));