Re: php5 soap deserializer error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Michael Rasmussen wrote:
On Tue, 13 Sep 2005 10:00:04 +1000, dtra wrote:


<sequence>
<element name="destinationAddressSet" nillable="true" type="impl:ArrayOf_xsd_string"/>
	<element name="senderName" nillable="true" type="xsd:string"/>
	<element name="message" nillable="true" type="xsd:string"/>
	<element name="encoding" nillable="true" type="xsd:string"/>
</sequence>

the encoding element above can be 'text', '8 bit', or 'unicode' as it's values

To be able to parse lists to and from a webservice you need to define
something similar like this:

<sequence>
 <element name="destinationAddressSet" nillable="true"
 type="impl:ArrayOf_xsd_string"/>
  <element name="senderName" nillable="true" type="xsd:string"/> <element
  name="message" nillable="true" type="xsd:string"/> <element
  name="encoding" nillable="true" type="xsd:string"/>
</sequence>

<complexType name="ArrayOf_xsd_string">
  <complexContent>
    <sequence>
      <element name="ArrayOfString" type="xsd:string"
        minOccurs="0" maxOccurs="unbounded" nillable="1" />
      <restriction base="SOAP-ENC:Array">
      <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="xsd:string[]>"
      />
</restriction>
</sequence>
</complexContent>
</complexType>

Untested.


in addition to what i pasted above, the company we are working with also has this, which is pretty similar to what you pasted
except for the sequence element, it's all there

<complexType name="ArrayOf_xsd_string">
	<complexContent>
		<restriction base="soapenc:Array">
			<attribute ref="soapenc:arrayType" 	wsdl:arrayType="xsd:string[]"/>
		</restriction>
	</complexContent>
</complexType>

I'm pretty sure there is no issue with their wsdl file as they are quite a large company and have many other clients

>
> this is the part of the wsdl file that i think is being called
>
<complexType name="Sms">
	<sequence>
<element name="destinationAddressSet" nillable="true" type="impl:ArrayOf_xsd_string"/>
		<element name="senderName" nillable="true" type="xsd:string"/>
		<element name="message" nillable="true" type="xsd:string"/>
		<element name="encoding" nillable="true" type="xsd:string"/>
	</sequence>
</complexType>
<complexType name="ServiceException">
	<sequence/>
</complexType>
># -------------------------------------------------------------->

here is the php code that I am using to send the data
[php]
	$arrStrDas = array($arrID[$i]);
$sd = new SmsDelivery($arrStrDas, $strSenderName, $strEncoding, $strMessage); $strReturnValue = $sc->sendSms($strAccessID, $strPassword, $strUrl, $arrSip[$i], $sd);

class SmsDelivery {
	private $destinationAddressSet;
        private $senderName;
        private $encoding;
        private $message;
public function __construct($arrDestinationAddressSet, $strSenderName = '', $strEncoding = '', $strMessage = '') {
            	$this->destinationAddressSet = $arrDestinationAddressSet;
            	$this->senderName = $strSenderName;
            	$this->encoding = $strEncoding;
            	$this->message = $strMessage;
        }
}

[/php]

can you see any problem there?

i'm almost certain that it's the $sd object that contains the error as we can use another method that is pretty much the same but without the $sd object with no problems

we gave an example of the data we are sending through to the tech guys at the company we are working with, and they said that it should be ok but we have not been able to get this working, and i don't think they work with php so they are not the best people to assist us (I'm not even sure that the tech guys there no exactly what is going on with their system)

thanks
dave

--
PHP Soap Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Kernel Newbies]     [PHP Database]     [Yosemite]

  Powered by Linux