For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > May 2005 > Pear SOAP: How to pass simple type









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Pear SOAP: How to pass simple type
James Frankman

2005-05-26, 8:59 pm

I am having trouble consuming a service that has a 'SimpleType' as a =
parameter. It is defined in the WSDL as follows:

<s:simpleType name=3D"IRObjectRights">
<s:restriction base=3D"s:string">
<s:enumeration value=3D"arRead" />
<s:enumeration value=3D"arWrite" />
<s:enumeration value=3D"arCreate" />
</s:restriction>
</s:simpleType>

This data type is an input parameter for the following service:

<wsdl:message name=3D"GetDrawersSoapIn">
<wsdl:part name=3D"fUsername" type=3D"s:string" />
<wsdl:part name=3D"fPassword" type=3D"s:string" />
<wsdl:part name=3D"fMinRights" type=3D"tns:IRObjectRights" />
</wsdl:message>

I beleive the XML (for this type) contained in the SOAP request looks =
like this:

<fMinRights xsi:type=3D""tns:IRObjectRights"">arRead</fMinRights>

Here is my code:

include("XML/Serializer.php"); =20
require_once 'SOAP/Client.php';
include("XML/Unserializer.php");
=20
$wsdl =3D new SOAP_WSDL('irwebservice.wsdl');
$irProxy =3D $wsdl->getProxy();

$queryResponse =3D $irProxy->GetDrawers('BUDDY','BUDDY',$obj);

The last line is what I am having trouble with. How should the $obj =
object be represented when I pass it to the GetDrawers method? How =
should I build it? Associative Array? SOAP_Value?=20

I really need help on this. Any input would be appreciated.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com