I am writing a simple web service methods using nusoap library in php. I already create a complextype (struct) in server side but I want to instantiate that struct in a method so I can return it. I saw an example in here but using keyword "new" doesn't work. It doesn't see ComplexType. So how can I create new ComplexLogin struct in my LoginTest function?
//ComplexLoginType
$server->wsdl->addComplexType('ComplexLogin','complexType','struct','all','',
array(
'EnterpriseId' => array('name' => 'EnterpriseId','type' => 'xsd:int'),
'FirstName' => array('name' => 'FirstName','type' => 'xsd:string'),
'Password' => array('name' => 'Password','type' => 'xsd:string'))
);
$server->register(
// method name:
'LoginTest',
// parameter list:
array('name'=>'tns:ComplexLogin'),
// return value(s):
array('return'=>'tns:ComplexLogin'),
// namespace:
$namespace,
// soapaction: (use default)
false,
// style: rpc or document
'rpc',
// use: encoded or literal
'encoded',
// description: documentation for the method
'Login Method'
);