Ciao a tutti,
Utilizzando la classe nusoap sto tentando di generare un return multiarray ma ho dei problemi.
Vi porto il codice:
Codice PHP:
?php
//includiamo la libreria NuSOAPrequire_once("lib/nusoap-0.9.5/lib/nusoap.php");
$namespace = "http://1.1.1.1:10080/test/";
function getAutocompleteContacts() {
$result = array();
$result[1] = array( 'contact' => 'Chaos Captain', 'email' => 'choas@sdfusidfousdf.com');
$result[2] = array( 'contact' => 'Joe Joe', 'email' => 'choas@sdf768sdf798s7df987.com');
return $result;
}
$server = new soap_server;$server->configureWSDL('addressbook', $namespace);
$server->wsdl->addComplexType(
'Contact',
'complexType',
'struct',
'all',
'',
array('contact' => array('name' => 'contact', 'type' => 'xsd:string'),'email' => array('name' => 'email', 'type' => 'xsd:string'),));
$server->wsdl->addComplexType(
'ContactArray',
'complexType',
'array',
'',
'SOAP-ENC:Array',
array(),
array(
array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:Contact[]')
),
'tns:Contact');
$server->register('getAutocompleteContacts', array(),
array('return' => 'tns:ContactArray'), $namespace);
$HTTP_RAW_POST_DATA = isset($GLOBALS['HTTP_RAW_POST_DATA']) ? $GLOBALS['HTTP_RAW_POST_DATA'] : '';$server->service($HTTP_RAW_POST_DATA);
exit();
?>
In pratica sul client ricevo questo errore : looks like we got no XML document
Non riesco a capire proprio dove sbaglio tutti gli esempi riportati in giro utilizzano proprio questa struttura...