Re: [SOAP] WSDL with attributes?

[email protected] (Rob)
Newsgroups php.soap
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.