Page 1 of 1

problem getting results from web services

Posted: Tue Jul 11, 2006 9:57 am
by ndowdall
I am trying to use the following web service to get a weather report for my site.
http://www.webservicex.net/globalweather.asmx
However the page returns no results. Anyone got any ideas as to what is wrong with my code. I have tested the web service using asp.net and it is working so it must be my code

Code: Select all

<html>
<head><title>web services</title></head>
<body>
<?php
require_once('../Connections/soap/nusoap.php');
$client = new soapclient("http://www.webservicex.net/globalweather.asmx");

$result="";
$result = $client ->call('GetWeather','Dublin,Ireland');
echo $result;
?>
</body>
</html>
Any ideas?

Posted: Tue Jul 11, 2006 11:55 pm
by Benjamin

Posted: Wed Jul 12, 2006 1:23 pm
by ndowdall
Thanks astions will give it a try.

Posted: Wed Jul 12, 2006 1:58 pm
by ndowdall
That works but now would I insert the output into my own page.
What I am trying to do is to have some of the returned data displayed on the top of the page.

Regards
ndowdall

Posted: Sat Jul 15, 2006 4:37 pm
by ndowdall
I am still having trouble. I have the following code

Code: Select all

<?php
	require_once('../nusoap.php');
	$country_name='Ireland';
	$parameters=array('CountryName' => $country_name);
	$sclient= new soapclient('http://www.webserviceX.NET/Globalweather.asmx');
	$result = $sclient->call('GetCitiesByCountry' , $parameters);
	foreach ($result as $name_val)
	{
		echo $name_val;
	}
	?>
which i think should just output a list of citys in the country supplied in this case Ireland.
Put instead i am getting this error message at lest i think it's an error message.

Code: Select all

soap:ClientSystem.Web.Services.Protocols.SoapException: Server did not recognize the value of HTTP Header SOAPAction: . at System.Web.Services.Protocols.Soap11ServerProtocolHelper.RouteRequest() at System.Web.Services.Protocols.SoapServerProtocol.Initialize() at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)
Any one got an idea of whats wrong as i can see nothing. the service address is
http://www.webservicex.net/globalweather.asmx