note 108641 added to soapclient.soapcall
| From: | ChrisGunawardena | Date: | Mon, 14 May 2012 03:35:38 +0000 |
| Subject: | note 108641 added to soapclient.soapcall | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-187963@lists.php.net to get a copy of this message | ||
For all those poor souls getting the "Fatal error: Uncaught SoapFault exception: [soap:Server]
Server was unable to process request. ---> Object reference not set to an instance of an object.
in xyz.php" using WSDL.
Aparently all sorts of things cause this but for me the fix was to passin all parameters (not only
the requied onces). I just passed the rest as empty strings and the problem was solved.
working example below
<pre>
<?php
ini_set('display_errors', true);
ini_set("soap.wsdl_cache_enabled", "0");
error_reporting(E_ALL);
$client = new SoapClient('http://humanservicesdirectory.vic.gov.au/hsddataapi/searchhsd.asmx?WSDL',
array( 'trace' => true, 'exceptions' => true,
'connection_timeout'=>9999,
'features' => SOAP_SINGLE_ELEMENT_ARRAYS,
'soap_version' => SOAP_1_1, 'encoding' =>
'ISO-8859-1',
));
//var_dump($client->__getFunctions());
//var_dump($client->__getTypes());
$search_results_xml = $client->HSDSiteSearch ( array( 'startPos' => 1,
'maxResults' => 100,
'resultOrderVal' => 'Site',
'searchSimilarNames' => true,
'name' => '',
'includePracName' => true,
'suburbsAndPostcodes' => 'Melbourne',
'searchSurroundingSuburbs' => true,
'pcpDesc' => '',
'cityOrShireDesc' => '',
'siteGPDivDesc' => '',
'serviceCategoryDesc' => '',
'serviceTypeDesc' => '',
'keywords' => '',
'targetGroup' => '',
'freeServicesOnly' => false,
'afterHoursOnly' => false,
'startTimeDesc' => '',
'endTimeDesc' => '',
'openOnDesc' => '',
'pracFamilyName' => '',
'pracGivenName' => '',
'pracNoAppointmentRequired' => false,
'pracSpecialInterests' => '',
'pracSexDesc' => '',
'pracLanguageSpokenDesc' => '',
'pracSpecialityDesc' => '',
'pracEthnicityDesc' => ''
) );
print_r($search_results_xml);
/*print "Request: \n".
$client->__getLastRequestHeaders() ."\n";
print "Request: \n".
$client->__getLastRequest() ."\n";
print "Response: \n".
$client->__getLastResponseHeaders()."\n";
print "Response: \n".
$client->__getLastResponse()."\n"; */
?>
</pre>
----
Server IP: 69.147.83.197
Probable Submitter: 203.206.203.73
----
Manual Page -- http://www.php.net/manual/en/soapclient.soapcall.php
Edit -- https://master.php.net/note/edit/108641
Del: integrated -- https://master.php.net/note/delete/108641/integrated
Del: useless -- https://master.php.net/note/delete/108641/useless
Del: bad code -- https://master.php.net/note/delete/108641/bad+code
Del: spam -- https://master.php.net/note/delete/108641/spam
Del: non-english -- https://master.php.net/note/delete/108641/non-english
Del: in docs -- https://master.php.net/note/delete/108641/in+docs
Del: other reasons-- https://master.php.net/note/delete/108641
Reject -- https://master.php.net/note/reject/108641
Search -- https://master.php.net/manage/user-notes.php