web services - PHP SOAP webservice with NuSOAP gives no result if WSDL is configured -


i have php soap webservice i've created using nusoap. use file 'test.php' test in browser '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 'no result'  $server ->wsdl->schematargetnamespace = 'urn:server'; //this line causes '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 remove these lines

$server ->configurewsdl('server', 'urn:server');  $server ->wsdl->schematargetnamespace = 'urn:server'; 

it shows me result fine. otherwise blank screen, nothing. need configure wsdl.

how can edit webservice.php wsdl configured , can result array on test.php ?

try changing this:

$server ->wsdl->schematargetnamespace = 'urn:server'; 

into this:

 $server ->wsdl->schematargetnamespace = $namespace; 

and define $namespace on top of it. did trick me.

this code of nusoap webservice:

require_once("lib/nusoap.php"); $namespace = "http://localhost:8080/testservice/service.php?wsdl"; $server = new soap_server(); $server->configurewsdl("testservice"); $server->wsdl->schematargetnamespace = $namespace; 

Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -