Pear SOAP: How to pass simple type
| From: | James Frankman | Date: | Tue, 24 May 2005 15:35:16 +0000 |
| Subject: | Pear SOAP: How to pass simple type | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-19357@lists.php.net to get a copy of this message | ||
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="IRObjectRights">
<s:restriction base="s:string">
<s:enumeration value="arRead" />
<s:enumeration value="arWrite" />
<s:enumeration value="arCreate" />
</s:restriction>
</s:simpleType>
This data type is an input parameter for the following service:
<wsdl:message name="GetDrawersSoapIn">
<wsdl:part name="fUsername" type="s:string" />
<wsdl:part name="fPassword" type="s:string" />
<wsdl:part name="fMinRights" type="tns:IRObjectRights" />
</wsdl:message>
I beleive the XML (for this type) contained in the SOAP request looks like this:
<fMinRights xsi:type=""tns:IRObjectRights"">arRead</fMinRights>
Here is my code:
include("XML/Serializer.php");
require_once 'SOAP/Client.php';
include("XML/Unserializer.php");
$wsdl = new SOAP_WSDL('irwebservice.wsdl');
$irProxy = $wsdl->getProxy();
$queryResponse = $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?
I really need help on this. Any input would be appreciated.