I was wondering if anyone had any experience parsing out this service? I've been trying for some time now and I keep getting a Bad Gateway message. Below is a sample of the code, I've tried multiple soapclient's, but they all return the same. Any help would be very greatly appreciated.
/* Include NuSoap - see http://sourceforge.net/projects/nusoap for additional info */
include('soap/nusoap.php');
/* Create Client from WSDL */
//$soapclient = new soapclient('http://www.weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl','wsdl');
//$soapclient = new soapclient('http://www.noveltycalls.com/beta/test/ndfdXMLserver.wsdl','wsdl');
$soapclient = new soapclient('http://www.nws.noaa.gov/forecasts/xml/SOAP_server/ndfdXMLserver.php');
$err = $soapclient->getError();
if ($err)
{
echo('<strong>Unable to make SOAP call</strong>');
}
/* Create Proxy - to Access Services */
//$proxy = $soapclient->getProxy();
/* Switch encoding to UTF-8, since NuSoap default is ISO-8859-1 */
//$proxy->soap_defencoding = "UTF-8";
/* Construct Request */
/*$request = array ("latitude" => "Books",
"longitude" => $page,
"startDate" => $keywords,
"numDays" => $keywords,
"format" => "ItemAttributes,ItemIds,Images,Request");*/
/* Construct All Parameters */
$params = array ("latitude" => "27.7115",
"longitude" => "82.4202",
"startDate" => "03/19/2007",
"numDays" => "10",
"format" => "12 hourly");
/* Submit the Request */
//$result = $proxy->NDFDgenByDay("27.7115","82.4202","03/19/2007","10","12 hourly"
//$result = $soapclient->call('NDFDgenByDay',$params);
$result = $soapclient->call('NDFDgenByDay',$params,'uri:DWMLgenByDay','uri:DWMLgenByDay/NDFDgenByDay');
/* Print Request and Response (Debugging) */
//print $proxy->request;
//print $proxy->response;
// Processes any SOAP fault information we get back from the server
if ($soapclient->fault)
{
echo '<h2>Fault</h2><pre>';
print_r($result);
print $soapclient->response;
echo '</pre>';
}
else
{
// Capture any client errors
$err = $soapclient->getError();
if ($err)
{
// Display the error
echo '<p><b>Error: ' . $err . '</b></p>';
echo '<h2>Debug</h2>';
echo '<pre>' . htmlspecialchars($client->debug_str, ENT_QUOTES) . '</pre>';
print $soapclient->response;
}
else // we successfully created the DWML document
{
echo $result;
}
}