note 52000 added to function.soap-soapclient-soapcall
| From: | OrionI at osu1 dot php dot net | Date: | Mon, 18 Apr 2005 14:27:42 +0000 |
| Subject: | note 52000 added to function.soap-soapclient-soapcall | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-88165@lists.php.net to get a copy of this message | ||
Correction on the previously submitted code snippet...the incoming parameter for .NET also has to be
in object or array form for it to be correctly converted to the XML form that .NET expects (as
already mentioned by Llu?s P?mies). The full example (when using WSDL) should be like this:
<?php
$client = new SoapClient("http://server/myservice.asmx?WSDL");
$params->param1 = $value1;
$params->param2 = $value2;
$objectresult = $client->MyMethod($params);
$simpleresult = $objectresult->MyMethodResult;
?>
So if you have a C# function like this:
//sumservice.asmx
...
[WebMethod]
public int Sum(int a, int b)
{
return a + b;
}
...
The PHP client would be this:
<?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 "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+52000
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+52000&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+52000&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+52000&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+52000&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+52000&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+52000&report=yes
Search -- http://master.php.net/manage/user-notes.php