Author Topic: web services with SOAP  (Read 673 times)

0 Members and 1 Guest are viewing this topic.

Offline ksmatthewsTopic starter

  • Enthusiast
  • Posts: 97
    • View Profile
web services with SOAP
« on: January 24, 2010, 11:40:19 AM »
Hi All,


I am running a CLI script written in PHP to execute a remote web service. THe service calls a method 'GetUKLocationByCounty($param)'  which returns XML. I keep getting an error when I pass a string to this method, as required.

Here is part of the code ...

 $client = new SoapClient('http://www.webservicex.net    /uklocation.asmx?wsdl', array('trace'    => 1 ));
                         

  // call method                 
  $response = $client->GetUKLocationByCounty('Cornwall');
 
  // get last soap response
  echo $client->__getLastResponse();


The web service can be found at :
http://www.webservicex.net/WCF/ServiceDetails.aspx?SID=28

RESULT:

PHP Fatal error:  Uncaught SoapFault exception: [soap:Server] System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Data.SqlClient.SqlException: Procedure or function 'GetUKLocationByCounty' expects parameter '@County', which was not supplied.
   at WebServicex.UKLocation.GetUKLocationByCounty(String County)
   --- End of inner exception stack trace --- in /home/steven/public_html/XML-load/soap_test2.php:16

Any ideas ?

regards,

Steven Matthews