Webservice Server with Nusoap+wsd+complextype ARRAY QUESTION

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
pmsfo
Forum Newbie
Posts: 2
Joined: Tue Sep 08, 2009 3:45 am

Webservice Server with Nusoap+wsd+complextype ARRAY QUESTION

Post by pmsfo »

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:urn:SIL',
'urn: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:urn:SIL',
'urn:urn:SIL#setCandidatura',
'rpc', // style
'encoded',
'result'
);

My second Question, how i Create i Secure Webservice Server ?

I hope you enlight this.

Best regards
Post Reply