From: Bastien H. <bho...@wa...> - 2004-12-22 08:07:11
|
Hi everyone, I'm working at WaterProof SARL on PHPEdit and like to create a soap service to provide a list of available PHP website mirrors. I'm using to code below to generate a soap server and it's not working (it can only make it work with simple types like strings). If someone has ideas it would be a great help. Thank you very much for your time, Bastien Hofmann -- WaterProof Software | Tel: +33 (0) 563 218 274 20, Place Prax Paris | Fax: +33 (0) 563 915 629 82000 Montauban, France | Web: http://www.waterproof.fr/ <?php require_once('../config.inc.php'); require_once('nusoap.php'); function GetAll() { $mirror1 = array("Name" => 'Main', "Url" => "www.php.net", "Country" => "us"); $mirror2 = array("Name" => 'Second', "Url" => "www2.php.net", "Country" => "us"); $list = array($mirror1, $mirror2); return $list; } $SoapServer = new soap_server(); $Url = 'http://.../PhpMirrorList'; $SoapServer->configureWSDL('PhpMirrorList', FALSE, $Url); $SoapServer->wsdl->schemaTargetNamespace = 'http://soapinterop.org/xsd/'; $SoapServer->wsdl->addComplexType( 'PhpMirror', 'complexType', 'struct', 'all', '', array( 'Name' => array('name'=>'Name','type'=>'string'), 'Url' => array('name'=>'Url','type'=>'string'), 'Country' => array('name'=>'Country','type'=>'string') ) ); $SoapServer->wsdl->addComplexType( 'ArrayOfPhpMirror', 'complexType', 'array', '', 'SOAP-ENC:Array', array(), array(array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'PhpMirror[]')), 'PhpMirror' ); $SoapServer->register('GetAll', array(), array('Result' => 'xsd:ArrayOfPhpMirror'), false, $Url, false, false, 'Get a list of available php website mirrors.'); $SoapServer->service(isset($HTTP_RAW_POST_DATA)?$HTTP_RAW_POST_DATA:''); ?> |