note 52533 added to function.soap-soapclient-soapcall
| From: | DesmondJ at osu1 dot php dot net | Date: | Wed, 04 May 2005 22:36:28 +0000 |
| Subject: | note 52533 added to function.soap-soapclient-soapcall | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-88941@lists.php.net to get a copy of this message | ||
Following OrionI's example:
<?php
$client = new SoapClient("http://server/sumservice.asmx?WSDL");
$params->a = 2;
$params->b = 3;
$objectresult = $client->Sum($params);
$simpleresult = $objectresult->SumResult;
print($simpleresult); //produces "-1"
?>
Please note that the lines:
"$client->Sum($params);"
and
"$simpleresult = $objectresult->SumResult;"
are based off of each other. If your web service function is called "Sum", then add
"Result" to the end of it to get the results of the call.
EG:
<?php
$client = new SoapClient("http://server/mathservice.asmx?WSDL");
$params->a = 2;
$params->b = 3;
$objectresult = $client->Minus($params); // note the name of the function is "Minus"
$simpleresult = $objectresult->MinusResult; // note the name of the result is referenced as
"MinusResult"
print($simpleresult); //produces "5"
?>
----
Manual Page -- http://www.php.net/manual/en/function.soap-soapclient-soapcall.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+52533
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+52533&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+52533&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+52533&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+52533&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+52533&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+52533&report=yes
Search -- http://master.php.net/manage/user-notes.php