a1024 |
05-06-2014 12:59 PM |
PHP SOAP server returns 2D array using NuSOAP Library
Hi....
I am tired of trying to convert the following code to the 2D array, but I could not ...
Could you help me ... please ...
( PHP SOAP server returns array using NuSOAP Library)
PHP Code:
$server->wsdl->addComplexType("ArrayOfString", "complexType", "array", "", "SOAP-ENC:Array", array(), array(array("ref"=>"SOAP-ENC:arrayType","wsdl:arrayType"=>"xsd:string[]")), "xsd:string"); $server->wsdl->addComplexType("ArrayOf2D", "complexType", "array", "", "SOAP-ENC:Array", array(), array(array("ref"=>"SOAP-ENC:arrayType","wsdl:arrayType"=>"tns:ArrayOfString[]")), "tns:ArrayOfString"); $server->register('myfunc', // method name array(), //input array('return'=>'tns:ArrayOf2D'), //output 'urn:hellowsdl' , // namespace 'urn:hellowsdl#hello', // soapaction 'rpc', // style 'encoded', // use 'Say hello to the caller' // documentation ); function myfunc() { $arr = array(); array_push( $arr, array("a","s","d") ); array_push( $arr, array("t","y","u") ); return $arr; }
|