Hi am creating i webservice server with php nusoap + wsdl, and i have some questions.
This is my code for the webservice server
ini_set("soap.wsdl_cache_enabled", "0");
$server = new soap_server();
// Declaração do WebService
$server->debug_flag=false;
$server->configureWSDL('SIL','urn:SIL');
$server->soap_defencoding = "utf-8";
$server->wsdl->addComplexType (
'rubrica',
'complexType',
'struct',
'se','',
array (
'ndossier' => array ( 'name' => 'ndossier', 'type' => 'xsd:string'),
'mescodigo' => array ( 'name' => 'mescodigo', 'type' => 'xsd:string')
)
);
$server->wsdl->addComplexType(
'RubricasInvestimento',
'complexType',
'array',
'',
'SOAP-ENC:Array',
array( 'RubricasInvestimento' => array('name' => 'RubricasInvestimento', 'type' => 'tns:rubrica') ),
array( array( "ref" => "SOAP-ENC:arrayType",
"wsdl:arrayType" => "tns:rubrica[]")
),
"tns:rubrica"
);
Has you can see i sucecefully created i Array 'Rubricainvestimentos' that contains i array of 'rubrica'.
My first question is when i create the register function on Nusoap, i need to register the 'RubricaNnvestimentos' complex type like this
$server->register ('setCandidatura',array(
'RubricasInvestimento'=>'tns:RubricasInvestimento'),
array('result'=>'tns:siLeaderRetMsg'),
'urn⚱SIL',
'urn⚱SIL#setCandidatura',
'rpc', // style
'encoded',
'result'
);
Does i need to register also the the 'rubrica' complex type ? like this ?
$server->register ('setCandidatura',array(
'Rubrica'=>'tns:rubrica',
'RubricasInvestimento'=>'tns:RubricasInvestimento'),
array('result'=>'tns:siLeaderRetMsg'),
'urn⚱SIL',
'urn⚱SIL#setCandidatura',
'rpc', // style
'encoded',
'result'
);
My second Question, how i Create i Secure Webservice Server ?
I hope you enlight this.
Best regards