By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,442 Members | 1,358 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,442 IT Pros & Developers. It's quick & easy.

Soap Client : No deserializer defined for array type

P: 11
Hi
i am writing a SOAP client,
when using php 5 soap , it send this code and i get error :
Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://magfa.com/soap/SOAPSmsQueue" xmlns:xsd=http://www.w3.org/2001/XMLSchema 
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
  4. <SOAP-ENV:Body>
  5. <ns1:enqueue>
  6. <domain xsi:type="xsd:string">magfa</domain>
  7. <messageBodies SOAP-ENC:arrayType="xsd:string[1]" xsi:type="ns1:ArrayOf_xsd_string"><item xsi:type="xsd:string">test magfa gateway</item></messageBodies>
  8. <recipientNumbers SOAP-ENC:arrayType="xsd:string[1]" xsi:type="ns1:ArrayOf_xsd_string"><item xsi:type="xsd:string">9123456789</item></recipientNumbers>
  9. <senderNumbers SOAP-ENC:arrayType="xsd:string[1]" xsi:type="ns1:ArrayOf_xsd_string"><item xsi:type="xsd:string">22222</item></senderNumbers>
  10. <encodings SOAP-ENC:arrayType="xsd:int[1]" xsi:type="ns1:ArrayOf_xsd_int"><item xsi:type="xsd:int">0</item></encodings>
  11. <udhs xsi:nil="true" xsi:type="ns1:ArrayOf_xsd_string"/>
  12. <messageClasses xsi:nil="true" xsi:type="ns1:ArrayOf_xsd_int"/>
  13. <priorities xsi:nil="true" xsi:type="ns1:ArrayOf_xsd_int"/>
  14. <checkingMessageIds xsi:nil="true" xsi:type="ns1:ArrayOf_xsd_long"/>
  15. </ns1:enqueue>
  16. </SOAP-ENV:Body>
  17. </SOAP-ENV:Envelope>
  18.  
Error :
Expand|Select|Wrap|Line Numbers
  1. <faultstring>org.xml.sax.SAXException: No deserializer defined for array type {http://www.w3.org/2001/XMLSchema}string</faultstring>
  2.  
But when using nusoap it work :

Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:impl="http://magfa.com/soap/SOAPSmsQueue">
  3. <SOAP-ENV:Body>
  4. <impl:enqueue xmlns:impl="http://magfa.com/soap/SOAPSmsQueue">
  5. <domain xsi:type="xsd:string">magfa
  6. </domain>
  7. <messageBodies xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:string[1]">
  8. <item xsi:type="xsd:string">test</item></messageBodies>
  9. <recipientNumbers xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:string[1]"><item xsi:type="xsd:string">9123456789</item></recipientNumbers>
  10. <senderNumbers xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:string[1]"><item xsi:type="xsd:string">22222</item>
  11. </senderNumbers>
  12. <encodings xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:int[1]"><item xsi:type="xsd:int">1</item></encodings>
  13. <udhs xsi:nil="true" xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:string[0]"/>
  14. <messageClasses xsi:nil="true" xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:int[0]"/>
  15. <priorities xsi:nil="true" xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:int[0]"/>
  16. <checkingMessageIds xsi:nil="true" xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:long[0]"/>
  17. </impl:enqueue>
  18. </SOAP-ENV:Body>
  19. </SOAP-ENV:Envelope>
wsdl is here

any help ?
TNX
Jun 4 '10 #1

✓ answered by ehsanch

i found the solution
use 'features' param and set it to SOAP_USE_XSI_ARRAY_TYPE

eg,
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. $soapclient = new SoapClient("webservice.wsdl", array('features' => SOAP_USE_XSI_ARRAY_TYPE));
  3. ?>

Share this Question
Share on Google+
1 Reply


P: 11
i found the solution
use 'features' param and set it to SOAP_USE_XSI_ARRAY_TYPE

eg,
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. $soapclient = new SoapClient("webservice.wsdl", array('features' => SOAP_USE_XSI_ARRAY_TYPE));
  3. ?>
Jun 4 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.