Re: [SOAP] SOAP and MongoId

[email protected] ("Nikolay Sukhikh") Wed, 26 Jun 2013 15:42:49 +0300
Newsgroups php.soap
Message-ID <[email protected]>
OK, but target function accepts complex object of any class and MongoId =
 =

may be at any nesting level in the parameter object.
So should I recursively loop through parameter properties and convert al=
l  =

MongoIds to strings?
Then how I can convert that strings to MongoId on server side so target =
 =

function to receive the object with MongoIds (or stdClass with $id  =

property)?
Can the 'typemap' option of SoapClient/SoapServer help?

WSDL is auto-generated by Yii and currently knows nothing about MongoId,=
  =

but I can control it.

<wsdl:message name=3D"funcRequest">
	<wsdl:part name=3D"param" type=3D"xsd:struct"/>
</wsdl:message>

On Wed, 26 Jun 2013 15:22:02 +0300, Justin Dearing <[email protected]>=
  =

wrote:

> Assuming you are writing the client and server, and both are in php, t=
he
> service should probably take a string
>
> Use __tostring() to covert a mongoid to the hex string, which you can =
 =

> cover
> back with the mongoid constructor.
>
> If that's not the case, I can suggest workarounds based on what you ca=
n
> control. If you don't control the service, you should post the past of=
  =

> the
> wsdl defining what it's expecting for the mongoid.
> On Jun 26, 2013 8:01 AM, "Nikolay Sukhikh" <[email protected]> wrote:
>
>> I'm trying to pass function parameter of type MongoId through  =

>> SoapClient.
>> The problem is that MongoId objects have public property '$id' and
>> SoapClient generates invalid XML for them:
>>
>> <param xsi:type=3D"SOAP-ENC:Struct"><$**id
>> xsi:type=3D"xsd:string">**51ca25b506e4e9872800000a</$id>**</param>
>>
>> Is there any way to workaround this?
>>
>> --
>> PHP Soap Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
-- =

=D0=97=D0=B0 =D0=B2=D0=B8=D0=BA=D0=BE=D1=80=D0=B8=D1=81=D1=82=D0=B0=D0=BD=
=D0=BD=D1=8F =D0=BA=D0=BB=D1=96=D1=94=D0=BD=D1=82=D0=B0 =D0=B5=D0=BB=D0=B5=
=D0=BA=D1=82=D1=80=D0=BE=D0=BD=D0=BD=D0=BE=D1=97 =D0=BF=D0=BE=D1=88=D1=82=
=D0=B8 Opera: http://www.opera.com/mail/