Re: [SOAP] WSDL with attributes?
| From: | Rob | Date: | Thu, 03 May 2007 13:29:54 +0000 |
| Subject: | Re: [SOAP] WSDL with attributes? | ||
| References: | 1 | Groups: | php.soap |
| Request: | Send a blank email to php-soap+get-2534@lists.php.net to get a copy of this message | ||
Andrew Ettinger wrote:
> Thanks for the response! I'm not sure if that's what I need as that
> seems mostly for callback and I think I have a data structure problem in
> the PHP SOAP extension itself (although it's most likely my error =).
>
> To elaborate a little further, I need to make a call to the sever like
> the following:
>
> <soap-env:body>
> <myDatatype attr="myAttrValue">
> <otherContent>
> <value>myValue</value>
> </otherContent>
> </myDataType>
> </soap-env:body>
>
> I've redone wsdl2php to provide me with the classes directly from the
> WSDL such that it will parse a WSDL so that I can call:
>
> <?
> $service = new SOAPSomeServiceDefinedInAWsdl();
> $myDataType = new SOAPMyDataType();
> $myDataType->otherContent = new SOAPOtherContent();
> $myDataType->otherContent->myValue = "myValue";
> $service->callSomeMethodOnTheirSoapServer($myDataType);
> ?>
There should be an attr property in the SOAPMyDataType class that you
can set.
$myDataType->attr="myAttrValue";
As long as it really is defined in the WSDL, ext/soap *should* properly
add the attribute when building the message.
.....
Rob