note 97851 modified in soapserver.soapserver by danbrown
| From: | danbrown@php.net | Date: | Wed, 12 May 2010 14:03:47 +0000 |
| Subject: | note 97851 modified in soapserver.soapserver by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-169183@lists.php.net to get a copy of this message | ||
Calling a server from .NET:
If you intend to call a PHP SOAP server from a .NET Client, there are a couple of things to be aware
of. First of all, I've only got it working in WSDL mode. If anyone have made it work in
non-WSDL-mode, I'd be interested in hearing that. In WSDL-mode it works, but both input and
output-parameters are wrapped from .NET.
Basically, a function with this signature:
<?php
function SomeFunction($param1, $param2)
{
return $param1+$param2;
}
?>
Must be rewritten to this, without changing the WSDL:
<?php
function SomeFunction($data)
{
$valueArray = get_object_vars($data);
$param1 = $valueArray["param1"];
$param2 = $valueArray["param2"];
return Array("SomeFunctionResult" => $param1+$param2);
}
?>
--was--
Calling a server from .NET:
If you intend to call a PHP SOAP server from a .NET Client, there are a couple of things to be aware
of. First of all, I've only got it working in WSDL mode. If anyone have made it work in
non-WSDL-mode, I'd be interested in hearing that. In WSDL-mode it works, but both input and
output-parameters are wrapped from .NET.
Basically, a function with this signature:
<?php
function SomeFunction($param1, $param2)
{
return $param1+$param2;
}
?>
Must be rewritten to this, without changing the WSDL:
<?php
function SomeFunction($data)
{
$valueArray = get_object_vars($data);
$param1 = $valueArray["param1"];
$param2 = $valueArray["param2"];
return Array("SomeFunctionResult" => $param1+$param2);
}
?>
For a more detailed walk-through, check my blog entry at http://posts.nilzorblog.com/phpnet
http://php.net/manual/en/soapserver.soapserver.php