Re: [SOAP] Problems with sending arrays via Soap
[email protected] (Jonathan Pitcher)
| Newsgroups | php.soap |
|---|---|
| Message-ID | <C4990B0B.24B5C%[email protected]> |
I don't know if this will help, but we deal a lot with vendors on java
platforms and when we run into issues with their systems not taking an array
we setup the client as follows ...
$this->client = new SoapClient($this->wsdl, Array('trace' => true,
'features' => SOAP_USE_XSI_ARRAY_TYPE));
Notice the 'features' part ... That solved our problem, I hope it helps
solve yours.
Jonathan Pitcher
On 7/8/08 12:05 PM, "Lorenz Barth" <[email protected]> wrote:
> Hello,
>
> I'm trying to send a string array to one of our services. Here the part of the
> wsdl:
>
> <wsdl:message name="sendTextLetterRequest">
> <wsdl:part name="t" type="tns1:Ticket"/>
> <wsdl:part name="recipient" type="soapenc:string"/>
> <wsdl:part name="subject" type="soapenc:string"/>
> <wsdl:part name="country" type="soapenc:string"/>
> <wsdl:part name="content" type="soapenc:string"/>
> <wsdl:part name="options" type="impl:ArrayOf_soapenc_string"/>
> </wsdl:message>
>
>
> <schema
> targetNamespace="http://127.0.0.1/pbx-server/customer/services/LetterService">
> <import namespace="http://shared.webservices.server.platform.pbxnetwork.de"/>
> <import namespace="pbx"/>
> <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
> <complexType name="ArrayOf_soapenc_string">
> <complexContent>
> <restriction base="soapenc:Array">
> <attribute ref="soapenc:arrayType" wsdl:arrayType="soapenc:string[]"/>
> </restriction>
> </complexContent>
> </complexType>
> </schema>
>
>
> The server is based on java Axis. Simple Things like normal stings and even
> Objects like the Ticket are working fine. But I'm unable to send the options
> array to the Server. Here is a part of the php client app:
>
> $pbx_client = new SoapClient($wsdl);
> try {
>
> // $result = $pbx_client->__soapCall("sendTextLetter", array(new
> pbx_Ticket($ticket),"recipient"=>$recipient,"subject"=>$subject,"country"=>$co
> untry,"content"=>$content,"options"=>$options));
> $result = $pbx_client->sendTextLetter(new
> pbx_Ticket($ticket),$recipient,$subject,$country,$content,$options);
> if (true === $result) {
> DebugMessage("PBX: Letter Versendet.");
> return true;
> } else {
> DebugMessage("PBX: Fehler beim Letter
> Versand",$result);
> return false;
> }
> }catch(SoapFault $exception) {
> print_r($exception);
> DebugMessage("Fehler beim Briefversand", $exception);
>
>
> }
>
>
> Hopefully one of you guys can help me with this. I search google all day but
> without success.
>
> Thanks a lot in advance
>
> Lorenz
>
>
>
>
> --
> PHP Soap Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>