Re: php5 soap deserializer error
| From: | dtra | Date: | Wed, 14 Sep 2005 00:17:51 +0000 |
| Subject: | Re: php5 soap deserializer error | ||
| References: | 1 2 3 4 | Groups: | php.soap |
| Request: | Send a blank email to php-soap+get-1994@lists.php.net to get a copy of this message | ||
Michael Rasmussen wrote:
On Tue, 13 Sep 2005 10:00:04 +1000, dtra wrote: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<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 valuesTo 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.
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