Re: SOAP PHP 5.2.5 and Outside WSDL's
| From: | Larry Garfield | Date: | Sat, 08 Mar 2008 17:27:52 +0000 |
| Subject: | Re: SOAP PHP 5.2.5 and Outside WSDL's | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-271160@lists.php.net to get a copy of this message | ||
From your samples below, if what they actually want is that snippet at the
bottom, then you don't want to send SOAP. You want to send a REST response,
vis, "some arbitrary, use-case-specific XML". In that case, don't use SOAP
at all but use SimpleXML instead, then dump that to an XML string and send
it.
If you mean something else, please clarify. :-)
On Wednesday 05 March 2008, Jonathan Pitcher wrote:
> I am connecting to a Third Party WSDL that needs me to turn return an Array
> of results to them. I do and PHP returns this ...
>
>
> <SOAP-ENV:Body>
> <ns1:addParties>
> <in0 xsi:type="ns2:AuthenticationInfo">
> <locale xsi:type="xsd:string">en</locale>
> <token
> xsi:type="xsd:string">50d3c78a0213b3e083ce7b6c7fa760a299798246fb6bbf1dc2dc8
>1
> 12a841454d5bcb9cb752b18e299cd9be84214175b6c971065d8df08b52283408b925dd85412
>8 5a031ca29c39b945989b951e2523594f5c9c0aa7bbfc328c87441830b47cd0</token>
> <userType xsi:type="xsd:int">1</userType>
> </in0>
> <in1 SOAP-ENC:arrayType="ns2:EditConferenceParty[2]"
> xsi:type="ns3:ArrayOf_tns1_EditConferenceParty">
> <item xsi:type="ns2:EditConferenceParty">
> <conferenceId xsi:type="xsd:int">163</conferenceId>
> <phoneNumber xsi:type="xsd:string">9999999999</phoneNumber>
> </item>
> <item xsi:type="ns2:EditConferenceParty">
> <conferenceId xsi:type="xsd:int">163</conferenceId>
> <phoneNumber xsi:type="xsd:string">9999999999</phoneNumber>
> </item>
> </in1>
> </ns1:addParties>
> </SOAP-ENV:Body>
>
>
> Problem is they need something like:
>
> <EditConference>
> <conferenceId>163</conferenceId>
> <phoneNumber>9999999999</ phoneNumber>
> </EditConference>
> <EditConference>
> <conferenceId>163</conferenceId>
> <phoneNumber>9999999999</ phoneNumber>
> </EditConference>
>
> I found a good read here that says it deals with the way PHP handles
> outputting arrays.
>
> http://archive.netbsd.se/?ml=soap&a=2006-01&m=1677392
>
> Is this truly considered a bug ? If so has it been resolved in the current
> releases of PHP ?
>
> If not does anyone have a simple solution ? I can figure out a way to code
> the XML myself and send it but honestly was hoping for a simplier solution
> that didn't envolve writing XML by hand.
>
> Jonathan Pitcher
--
Larry Garfield AIM: LOLG42
larry@garfieldtech.com ICQ: 6817012
"If nature has made any one thing less susceptible than all others of
exclusive property, it is the action of the thinking power called an idea,
which an individual may exclusively possess as long as he keeps it to
himself; but the moment it is divulged, it forces itself into the possession
of every one, and the receiver cannot dispossess himself of it." -- Thomas
Jefferson