LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   PHP SOAP server returns 2D array using NuSOAP Library (https://www.linuxquestions.org/questions/programming-9/php-soap-server-returns-2d-array-using-nusoap-library-4175504102/)

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;




All times are GMT -5. The time now is 03:49 AM.