Witam
Mam problem z biblioteką NuSOAP.
Napisałem bardzo prosty WebService w .Net, uruchomiony jest na Windows XP SP2, IIS 5.1.
Próbuję go "skonsumować" z drugiego komputera ze strony php i tu pojawia się problem, bo do WebService'u nie jest przekazywany wymagany parametr. Natomiast to co zwraca WebService wykrywane jest poprawnie.
Kod php wygląda tak:

  1. <?php
  2. $wsdl=&#092;"http://192.168.1.101/ws/Service.asmx\";
  3.  
  4. require_once('lib\nusoap.php');
  5.  
  6. $client = new soapclient($wsdl);
  7.  
  8. $param='test';
  9.  
  10. $params = array ('name' => $param);
  11.  
  12. $return = $client->call('HelloWorld',$params,'http://tempuri.org/','http://tempuri.org/HelloWorld',null,false,'rpc','literal');
  13.  
  14. if(!$err = $client->getError()) {
  15.  
  16. echo 'Result: ';
  17.  
  18. print_r($return);
  19.  
  20. } else {
  21.  
  22. echo 'Error: ';
  23.  
  24. print_r($err);
  25.  
  26. }
  27.  
  28. echo ''.$client->request.'';
  29.  
  30. echo ''.$client->response.'';
  31.  
  32. ?>


Dwie ostatnie linie, czyli request i response są zwracane następująco:

request:

Kod
POST /ws/Service.asmx HTTP/1.0
Host: 192.168.1.101
User-Agent: NuSOAP/0.7.3 (1.114)
Content-Type: text/xml; charset=UTF-8
SOAPAction: "http://tempuri.org/HelloWorld"
Content-Length: 418
<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns5541:HelloWorld
xmlns:ns5541="http://tempuri.org/"><name>test</name></ns5541:HelloWorld></SOAP-ENV:Body></SOAP-ENV:Envelope>
HTTP/1.1


response:

Kod
200 OK
Server: Microsoft-IIS/5.1
Date: Mon, 17 Mar 2008 15:30:56 GMT
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Cache-Control: private, max-age=0
Content-Type: text/xml; charset=utf-8
Content-Length: 354
<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><HelloWorldResponse
xmlns="http://tempuri.org/"><HelloWorldResult>_echo_web_service</HelloWorldResult></HelloWorldResponse></soap:Body></soap:Envelope>



Wartość "_echo_web_service" to standardowa wartość dodawana do stringa zwracanego z webservice'u, niestety parametr name w funkcji HelloWorld na serwerze jest pusty, prawidłowy wynik powinien być: "test_echo_web_service".
Gdzie jest błąd?

Pozdrawiam.