This is sort of a re-post, but my question was asked rather poorly before, so I'm trying it again. I called 'wsdl2ruby.rb http://www.nws.noaa.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl' to generate a ruby class that I should be able to send to the nsw soap server. The generated class, which controls what data fields I want to receive from the server, looks like this:
class WeatherParametersType
@@schema_type = "weatherParametersType"
@@schema_ns = "http://weather.gov/forecasts/xml/DWMLgen/schema/ndfdXML.xsd"
@@schema_attribute = {}
@@schema_element = {"maxt" => "SOAP::SOAPBoolean", "mint" => "SOAP::SOAPBoolean", "temp" => "SOAP::SOAPBoolean", "dew" => "SOAP::SOAPBoolean", "pop12" => "SOAP::SOAPBoolean", "qpf" => "SOAP::SOAPBoolean", "sky" => "SOAP::SOAPBoolean", "snow" => "SOAP::SOAPBoolean", "wspd" => "SOAP::SOAPBoolean", "wdir" => "SOAP::SOAPBoolean", "wx" => "SOAP::SOAPBoolean", "waveh" => "SOAP::SOAPBoolean", "icons" => "SOAP::SOAPBoolean"}
attr_accessor :maxt
attr_accessor :mint
attr_accessor :temp
attr_accessor :dew
attr_accessor :pop12
attr_accessor :qpf
attr_accessor :sky
attr_accessor :snow
attr_accessor :wspd
attr_accessor :wdir
attr_accessor :wx
attr_accessor :waveh
attr_accessor :icons
def initialize(maxt = nil, mint = nil, temp = nil, dew = nil, pop12 = nil, qpf = nil, sky = nil, snow = nil, wspd = nil, wdir = nil, wx = nil, waveh = nil, icons = nil)
@maxt = maxt
@mint = mint
@temp = temp
@dew = dew
@pop12 = pop12
@qpf = qpf
@sky = sky
@snow = snow
@wspd = wspd
@wdir = wdir
@wx = wx
@waveh = waveh
@icons = icons
end
end
Given the definition of the WeatherParamtersType (found at http://weather.gov/xml/), this looks reasonable. However, what happens when I use it is no matter what element I have set to true, the server sends me all possible data fields. If I change the initialize line to false, rather than nil, it does the same thing. I'm thinking that somehow soap4r is formatting the class in the wrong way, but I don't know what the soap server expects the xml to look like, so it's hard to see what's going wrong. If there's anyone who knows much about soap in general, or about soap4r, I'd love some advise on how to figure out what's going wrong. Thanks!
--jay