user1782638
user1782638

Reputation: 130

PHP Webservice not being consumed

I'm using nusoap and I'm having dificulties in consuming webservices ... What I'm trying to return to who consumes one of the webservices is one array ... In the first case I'm trying to return this type of array:

Array ( [0] => EX123EX [1] => Test [2] => 2013/04/27 [3] => 12:06 [4] => This is a test [5] => [+]Info [-]Info ) 

And for this I have:

$server->wsdl->addComplexType(
'details',
'complexType',
'struct',
'all',
'',
array(
        'id' => array('name' => 'id', 'type' => 'xsd:string'),
        'product' => array('name' => 'product', 'type' => 'xsd:string'),
        'date' => array('name' => 'date', 'type' => 'xsd:string'),
        'hour' => array('name' => 'hour', 'type' => 'xsd:string'),
        'status' => array('name' => 'status', 'type' => 'xsd:string'),
    'info' => array('name' => 'info', 'type' => 'xsd:string'),
));

$server->register(
'getdetails',
array('url' => 'xsd:string'),
array('return' => 'tns:details'),
            $namespace,
            false,
            'rpc',
            'literal',
            'details');

and the function:

function getdetalhes($url)
{
$details = getHeader($url);
return $details;
}

The problem is that the webservice is not consumed... When I make the request I have no answer ... With this error I'm also unable to keep on for the next webservice that would return an array with this structure:

Array ( [0] => Array ( ) [1] => Array ( [0] => 2012/12/13 [1] => 12:06 [2] => Test [3] => - [4] => Test Test  [5] => Test ) [2] => Array ( [0] => 2012/12/13 [1] => 09:23 [2] => Test Test  [3] => - [4] => Test  [5] => - ) [3] => Array ( [0] => 2012/12/12 [1] => 17:43 [2] => Test  [3] => - [4] => Test  [5] => - ) [4] => Array ( [0] => 2012/12/12 [1] => 11:25 [2] => Test  [3] => Test  [4] =>Test [5] => - )

I'm confident that the error is on the complexType declaration but I can't figure out what is the problem, can someone help me please?

Upvotes: 1

Views: 87

Answers (1)

Telmo
Telmo

Reputation: 361

Please, make sure that you're accessing the associative keywords of the array instead of indexes :)

Upvotes: 1

Related Questions