I have a php soap webservice which I've created with using NuSOAP. I use the file 'test.php' to test it in the browser as 'http://www.mydowmain.com:8080/webservice/5/test.php'.
My code:
webservice.php
<?php
require_once('../lib/nusoap.php');
$server = new nusoap_server();
$server ->configureWSDL('server', 'urn:server'); //this line causes to 'no result'
$server ->wsdl->schemaTargetNamespace = 'urn:server'; //this line causes to 'no result'
$server -> register('getData');
function getData ()
{
$items = array(array("item1"),array("item2"));
return $items;
}
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$server ->service($HTTP_RAW_POST_DATA);
?>
test.php
<?php
require_once('../lib/nusoap.php');
$client = new nusoap_client("http://www.mydowmain.com:8080/webservice/5/webservice.php?wsdl");
$result = $client ->call('getData');
print_r($result);
?>
Problem:
If I remove these lines
$server ->configureWSDL('server', 'urn:server');
$server ->wsdl->schemaTargetNamespace = 'urn:server';
it shows me the result fine. Otherwise I get a blank screen, get nothing. But I really need to configure the WSDL.
How can I edit the webservice.php so that the WSDL will be configured and I can get the result array on the test.php ?