<?php
/*
* NuSOAP Demo
* Created: Apr 18, 2007
* License: LGPL (open source)
* BungeeLabs, Inc.
*
* This PHP script demonstrates how to create a simple NuSOAP WSDL server.
* To be used with 'nusoap_client.php'.
*
* This is not intended to be used as part of the SoapSQL library, rather to show
* how NuSOAP is used if you desire to create your own WSDL from scratch.
*/
require_once("nusoap/nusoap.php");
$ns = "http://soaptest/";
function Hello(&$name, &$age)
{
return array('message' => "Hello, $name. You are $age years old.");
}
$server = new soap_server();
$server->configureWSDL('HelloWorld', $ns);
$server->wsdl->schemaTargetNamespace = $ns;
$server->debug_flag = true;
$inparams = array('firstname' => 'xsd:string', 'age' => 'xsd:int');
$outparams = array('message' => 'xsd:string');
$server->register('Hello', $inparams, $outparams, $ns, false);
if (!isset($HTTP_RAW_POST_DATA))
$HTTP_RAW_POST_DATA = file_get_contents("php://input");
$server->service($HTTP_RAW_POST_DATA);
file_put_contents("sqlwsdl.log", $HTTP_RAW_POST_DATA."\r\n".$server->getDebug());
?>