I need to get weather forecast information from the national weather service (NWS). The information is returned via the NDFDgen() function which takes a large number of arguments. The following code creates the request:
<!--- an associative array is created for weatherParameters --->
<cfset Parameters=StructNew()>
<cfset Parameters.maxt = "maxt">
<cfset Parameters.mint = "mint">
<cfset Parameters.temp = "temp">
<cfset Parameters.dew = "dew">
<cfset Parameters.pop12 = "pop12">
<cfset Parameters.qpf = "qpf">
<cfset Parameters.snow = "snow">
<cfset Parameters.sky = "sky">
<cfset Parameters.wspd = "wspd">
<cfset Parameters.wdir = "wdir">
<cfset Parameters.wx = "wx">
<cfset Parameters.icons = "icons">
<cfset Parameters.waveh = "waveh">
<cfinvoke
webservice=" method="NDFDgen" returnvariable="aString">
<cfinvokeargument name="latitude" value="39.0000" />
<cfinvokeargument name="longitude" value="-77.0000" />
<cfinvokeargument name="product" value="time-series" />
<cfinvokeargument name="startTime" value="2004-07-14T12:00" />
<cfinvokeargument name="endTime" value="2004-07-18T12:00" />
<cfinvokeargument name="weatherParameters" value="#Parameters#">
</cfinvoke>
<cfdump var="#aString#">
</cfoutput>
However, when this is submitted, I get back an error message as follows:
Web service operation "NDFDgen" with parameters {endTime={2004-07-18T12:00},latitude={39.0000},product={time-series},longitude={-77.0000},startTime={2004-07-14T12:00},weatherParameters={{WAVEH={waveh},TEMP={temp},WDIR={wdir},SNOW={snow},WX={wx},ICONS={icons},DEW={dew},POP12={pop12},MINT={mint},SKY={sky},WSPD={wspd},MAXT={maxt},QPF={qpf},}},} could not be found.
As best I can tell, the function NDFDgen is there. Does the error message imply that the arguments weren't submitted in the correct order? The order they are listed by NWS is Lattitude, Longitude, Product, Start time, End time, and then Parameters as listed as in the structure above. But the error message shows them in a jumbled order. I would hope the key/name values would be usable in any order, but maybe not.
Asking NWS for guidance is pointless (this is the government afterall), and I have too little experience with SOAP and WSDL to understand where to look for solutions. Does anyone have any ideas or suggestions? Anyone have experience getting data from NWS?
Am I correct in suspecting that the order of the arguments is the problem? A CF structure will display them in alphabetical order if I do a <cfdump> on the structure, but the error message doesn't show them alphabetically. Even submitting them alphabetically might not work if they are supposed to be in a defined order that isn't alphabetical.
I'm stumped on this one and making no progress. Any ideas would be greatly appreciated.
<!--- an associative array is created for weatherParameters --->
<cfset Parameters=StructNew()>
<cfset Parameters.maxt = "maxt">
<cfset Parameters.mint = "mint">
<cfset Parameters.temp = "temp">
<cfset Parameters.dew = "dew">
<cfset Parameters.pop12 = "pop12">
<cfset Parameters.qpf = "qpf">
<cfset Parameters.snow = "snow">
<cfset Parameters.sky = "sky">
<cfset Parameters.wspd = "wspd">
<cfset Parameters.wdir = "wdir">
<cfset Parameters.wx = "wx">
<cfset Parameters.icons = "icons">
<cfset Parameters.waveh = "waveh">
<cfinvoke
webservice=" method="NDFDgen" returnvariable="aString">
<cfinvokeargument name="latitude" value="39.0000" />
<cfinvokeargument name="longitude" value="-77.0000" />
<cfinvokeargument name="product" value="time-series" />
<cfinvokeargument name="startTime" value="2004-07-14T12:00" />
<cfinvokeargument name="endTime" value="2004-07-18T12:00" />
<cfinvokeargument name="weatherParameters" value="#Parameters#">
</cfinvoke>
<cfdump var="#aString#">
</cfoutput>
However, when this is submitted, I get back an error message as follows:
Web service operation "NDFDgen" with parameters {endTime={2004-07-18T12:00},latitude={39.0000},product={time-series},longitude={-77.0000},startTime={2004-07-14T12:00},weatherParameters={{WAVEH={waveh},TEMP={temp},WDIR={wdir},SNOW={snow},WX={wx},ICONS={icons},DEW={dew},POP12={pop12},MINT={mint},SKY={sky},WSPD={wspd},MAXT={maxt},QPF={qpf},}},} could not be found.
As best I can tell, the function NDFDgen is there. Does the error message imply that the arguments weren't submitted in the correct order? The order they are listed by NWS is Lattitude, Longitude, Product, Start time, End time, and then Parameters as listed as in the structure above. But the error message shows them in a jumbled order. I would hope the key/name values would be usable in any order, but maybe not.
Asking NWS for guidance is pointless (this is the government afterall), and I have too little experience with SOAP and WSDL to understand where to look for solutions. Does anyone have any ideas or suggestions? Anyone have experience getting data from NWS?
Am I correct in suspecting that the order of the arguments is the problem? A CF structure will display them in alphabetical order if I do a <cfdump> on the structure, but the error message doesn't show them alphabetically. Even submitting them alphabetically might not work if they are supposed to be in a defined order that isn't alphabetical.
I'm stumped on this one and making no progress. Any ideas would be greatly appreciated.