note 100291 added to soapclient.soapclient
| From: | titan at phpdevshell dot org | Date: | Wed, 06 Oct 2010 13:10:10 +0000 |
| Subject: | note 100291 added to soapclient.soapclient | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-173000@lists.php.net to get a copy of this message | ||
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')));
----
Server IP: 69.147.83.197
Probable Submitter: 196.25.255.214
----
Manual Page -- http://www.php.net/manual/en/soapclient.soapclient.php
Edit -- https://master.php.net/note/edit/100291
Del: integrated -- https://master.php.net/note/delete/100291/integrated
Del: useless -- https://master.php.net/note/delete/100291/useless
Del: bad code -- https://master.php.net/note/delete/100291/bad+code
Del: spam -- https://master.php.net/note/delete/100291/spam
Del: non-english -- https://master.php.net/note/delete/100291/non-english
Del: in docs -- https://master.php.net/note/delete/100291/in+docs
Del: other reasons-- https://master.php.net/note/delete/100291
Reject -- https://master.php.net/note/reject/100291
Search -- https://master.php.net/manage/user-notes.php