Click here to Skip to main content
15,885,869 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I need to read information from susoap web service,

Server Side;
$server->register('login',
        array('myVar' => 'xsd:string'),
        array('return' => 'tns:ct_adminUser'),
        $namespace,
        $namespace . '#login',
        'rpc',
        'encoded',
        'Login validation!'
    );

...
$server->wsdl->addComplexType('MyStruct','complexType','struct','all','',
        array(  'val1' => array('name' => 'val1','type' => 'xsd:int'),
                'val2' => array('name' => 'val2','type' => 'xsd:string')
             ));

function testFn() 
{ 
 
  return Array ('usrId' => 1,'usrName' => 'MY NAME');
}


I'm using vb.net and I can read the data but I'm trying to implement the client in PHP and I can't read the response.

In the PHP client I have the following code;

$result = $client->call('testFn',array('myVar' => 'XXXXX')));
echo $result;


The response is;
Array

If I change the client to the following don't receive anything;

$result = $client->call('testFn',array('myVar' => 'XXXXX')));
echo $result->val1;
Posted

1 solution

To read I need to change the last sentence;

echo $result['val1'];
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900