Published on WSO2 Oxygen Tank (http://wso2.org)

problem return array from web service

By kunathip
Created 2008-06-11 22:55

 

I try to create a samples web services with WSDL Generation, the code show below:

 

<?php

 /**

 *@return string $a

 */

function getDataFunction()    {

$a[] = "Movie";   

$a[] = "Music";

return $a;

}



$operations = array("getData"=>"getDataFunction");

$opParams = array("getDataFunction"=>"MIXED");



$svr = new WSService(array("operations"=>$operations, "bindingStyle"=>"doclit", "opParams"=>$opParams));

$svr->reply();

?>


--------------------------

 I use SoapUI to test the result, here is the soap response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">

   <soapenv:Header/>

   <soapenv:Body>

      <ns1:getDataResponse xmlns:ns1="http://www.wso2.org/php/xsd">

         <ns1:a>Movie</ns1:a>

      </ns1:getDataResponse>

   </soapenv:Body>

</soapenv:Envelope>

 ----------

the result show only "Movie" but "Music" is missing.

this PHP code is assume that "$a" are value of data from database, How do I fix this?

Thanks.

 


Source URL:
http://wso2.org/forum/thread/3697