Menu

#26 SQL - Result sending as xml response with complex types

New
nobody
None
Medium
Defect
2014-10-17
2013-07-14
Anonymous
No

Originally created by: tom.liew...@gmail.com

What steps will reproduce the problem?
1. How can I send a associative array (result of a sql-query) as response  
   back to the client.

What I made is:
Create a class.complexTypeproject.php
create a class.project.php
create a server.php --> generate the soap server

All works fine but I when I try send an sql request with more result rows back to the client I'm not able to get a fine xml response.

The SQL-Statement is ok. If I have only one Result the xml response is ok and I can manage it with ksoap2 for android.

<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:ComplexTypeArrayProjectResponse><return SOAP-ENC:arrayType="xsd:string[6]" xsi:type="ns1:stringArray"><item xsi:type="xsd:string">0</item><item xsi:type="xsd:string">Erstes Projekt</item><item xsi:type="xsd:string">300</item><item xsi:type="xsd:string">1</item><item xsi:type="xsd:string">Zweites Projekt</item><item xsi:type="xsd:string">2000</item></return></ns1:ComplexTypeArrayProjectResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>

What is the expected output? What do you see instead?

<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:ComplexTypeArrayProjectResponse><return SOAP-ENC:arrayType="xsd:string[2]" xsi:type="ns1:stringArray"><item xsi:type="xsd:string">stdClass Object
(
    [idget] => 0
    [projectname] => Testprojekt 1
    [budget] => 3300

)
</item><item xsi:type="xsd:string">stdClass Object
(
    [idget] => 1
    [projectname] => Testprojekt 2
    [budget] => 5300
)
</item></return></ns1:ComplexTypeArrayProjektResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>

What version of the product are you using? On what operating system?
php-wsdl 2.3

Please provide any additional information below.

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.