Re: [SOAP] Re: Passing objects to soap server, complexType, classmap
| From: | aljoscha | Date: | Thu, 22 Mar 2007 10:37:36 +0000 |
| Subject: | Re: [SOAP] Re: Passing objects to soap server, complexType, classmap | ||
| References: | 1 2 3 4 | Groups: | php.soap php.soap |
| Request: | Send a blank email to php-soap+get-2487@lists.php.net to get a copy of this message | ||
Hello Michael!
Michael Rasmussen wrote:
>
> On Mon, 19 Jun 2006 11:52:08 +1200, Morgan Pyne wrote:
>
>> On the server, the 'myRemoteMethod()' is simply displaying the object
>> type
>> that it is passed. It is receiving the object as a 'StdClass', instead of
>> a 'someObj'
>>
>> Is this the corrrect approach? Do I need to do anything additionally on
>> the server side?
>>
>
> This is perfectly normal due to the fact that PHP is not a statical typed
> language. Had you tried implementing the client in C++ or C# the server
> would have serialized the SoapParam to a native C++ or C# class. In PHP
> you have to do this yourself, Eg. you must provide a private method in the
> server class which is capable of converting from a standard class to the
> required class:
> ...
>
How about the client? What requirements are there for the classes I want to
map the SOAP Objects to?
Even though I have the following class definitions:
class LoginOUT{
public $SessionID;
public $WSVersion;
}
class LoginResponse{
public $parameter;
}
and the following client options:
$options = array(
'trace' => true,
'classMap' => array(
'loginResponse' => 'LoginResponse',
'LoginOUT' => 'LoginOUT'
)
);
I get the following result:
stdClass::__set_state(array(
'parameter' =>
stdClass::__set_state(array(
'SessionID' => '1234',
'WSVersion' => '1.0',
)),
))
for this response:
<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="http://ws.smg.de/">
<SOAP-ENV:Body>
<ns1:loginResponse>
<parameter>
<SessionID>1234</SessionID>
<WSVersion>1.0</WSVersion>
</parameter>
</ns1:loginResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
That doesn't make sense to me? Anything I am missing?
Any ways to trace/debug the class mapping?
Thanks for your kind help.
Alex
--
View this message in context: http://www.nabble.com/Passing-objects-to-soap-server%2C-complexType%2C-classmap-tf1808285.html#a9611770
Sent from the Php - Soap mailing list archive at Nabble.com.