the server part should look like this
<?php
require_once('nusoap.php');
$server = new soap_server;
$server->configureWSDL('Test','http://soapinterop.org/');
$server->wsdl->schemaTargetNamespace = 'http://soapinterop.org/xsd/';
$server->register(
'hello',
array('name'=>'xsd:string'),
array('return'=>'xsd:string'),
'http://soapinterop.org/');
function hello($name){
return "hello" . $name;
}
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);
?> |
client part can be built using NuSoap wizard that comes with phped or you can just type the code below:
<?php
// Nusoap library 'nusoap.php' should be available through include_path directive
require_once('nusoap.php');
// set the URL or path to the WSDL document
$wsdl = "http://yourserver/test.php?wsdl";
// instantiate the SOAP client object
$soap = new soapclient($wsdl,"wsdl");
// get the SOAP proxy object, which allows you to call the methods directly
$proxy = $soap->getProxy();
// set parameter name (string)
$name = "testtt";
// get the result, a native PHP type, such as an array or string
$result = $proxy->hello($name);
?> |
I never experienced any problems with that.
Let me know if you still get any problems.
I also can send you URL to the service that you can test by your own.