NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Server did not recognize the value of HTTP Header SOAPAction


Joined: 09 Sep 2008
Posts: 3
Location: Oslo
Reply with quote
I have spent a few days trying to get my web services to work, allegedly it should be so easy. I have the following code, that aims to retrieve information from a web service built with a WSDL.

Code:
<?php
   // include the SOAP classes
   require_once('../lib/nusoap.php');
   
   // define parameter array (ISBN number)
   $param = array('CityName'=>'Oslo', 'CountryName'=>'Norway');
      
   // define path to server application
   $serverpath ='http://www.webservicex.net/globalweather.asmx';
   
   // create client object
   $client = new soapclient($serverpath);
   
   // $p = $serverpath->getProxy();
   
   // make the call
   $result = $client->call('GetWeather', $param);   
         
   // if a fault occurred, output error info
   if(!$err = $client->getError())
   {
       echo 'Result: '. $result;
      }
         
   // Display the request and response
   echo '<h2>Request</h2>';
   echo '<pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
   echo '<h2>Response</h2>';
   echo '<pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';
   
   echo '<hr>';
   echo '<h2>Error: </h2>';
   
      echo '<xmp>' . $err . '</xmp>';
   
   // kill object
   unset($client);
?>


So this returns an error message saying "Server did not recognize the value of HTTP Header SOAPAction", and an HTML error code 500; "Internal Server Error".

Information on this particular service was found here: http://www.webservicex.net/WS/WSDetails.aspx?CATID=12&WSID=56

Any help deeply appreciated.
View user's profileFind all posts by maralbjoSend private message
This is a working example of a web service client


Joined: 09 Sep 2008
Posts: 3
Location: Oslo
Reply with quote
Code:
// include the SOAP classes
require_once('../lib/nusoap.php');
   
// define parameter array (ISBN number)
$param = array('CountryName'=>'Norway');
   
$endpoint_path = 'http://www.webservicex.com/globalweather.asmx?WSDL';
   
// define path to server application (the true parameter is absolutely crucial)      
$client = new soapclient($endpoint_path, true);
         
// make the call
$result = $client->call('GetCitiesByCountry', $param);
View user's profileFind all posts by maralbjoSend private message
Server did not recognize the value of HTTP Header SOAPAction
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic