note 60576 added to function.soap-soapclient-soapcall
| From: | paulsjv at gmail dot com | Date: | Wed, 11 Jan 2006 15:44:29 +0000 |
| Subject: | note 60576 added to function.soap-soapclient-soapcall | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-101559@lists.php.net to get a copy of this message | ||
I was working with SOAP for the first time and I had to create a client that sent a date range to a
WSDL (Web Services Description Language) to return some information I needed. I didn't know
how to pass the params and there really was no documentation about it. The main thing you have to
make sure to do is when you pass params to a method that is definied by the WSDL that you are
calling is that you use the same param name for the key of the array or the object variable as shown
below. Also, if you don't know what the methods/functions that a WSDL has or the params that
you need to pass it you can use the __getFunctions() and __getTypes() methods after you declare your
new SoapClient.
<?php
// From and to are the two params that the execute function needs
// when called from the WSDL so make you to have them as the
// key to an array like below
$params["From"] = "06/01/2005"; // also can use $params->From =
"date";
$params["to"] = "12/31/2005"; // also can use $params->to = "date";
$client = new SoapClient("some.wsdl");
try {
print($client->execute($params));
} catch (SoapFault $exception) {
echo $exception;
}
?>
----
Manual Page -- http://www.php.net/manual/en/function.soap-soapclient-soapcall.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+60576
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+60576&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+60576&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+60576&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+60576&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+60576&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+60576&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+60576&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+60576&report=yes
Search -- http://master.php.net/manage/user-notes.php