"Scott Rubin" <srubin / fsisys.com> wrote in message
news:40f3e83a / buckaroo.cs.rit.edu...
> Ernie wrote:
> > I'm trying to write a client that fetches a  weather forecast using
soap4R.
> >
> > require 'soap/wsdlDriver'
> > weather = SOAP::WSDLDriverFactory.new(
> >    "http://www.nws.noaa.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl"
> > ).create_driver
> >
> > This works ok and weather is created.
> >
> > My problem is how do I enter the parameters for the function call
> > the parameters are:
> > <part name="latitude" type="xsd:decimal" />
> >   <part name="longitude" type="xsd:decimal" />
> >   <part name="product" type="typens:productType" />
> >   <part name="startTime" type="xsd:dateTime" />
> >   <part name="endTime" type="xsd:dateTime" />
> >    <part name="weatherParameters" type="typens:weatherParametersType" />
> >
> >    The weatherParameters variable is an array of booleans eg. maxt,
mint,
> > others
> >
> >
> > sReceived=NDFDgen("What goes here"........)
> >
> > Any help would be appreciated.
> >
> > Ernie
> >
> >
>
> I started making a client for that service in Python.  The only tricky
> part is the array of booleans.  If my thinking is correct, a hashmap
> will work there.  So do something like this.
>
>
> ...
> lattitude = 15.0
> longitude = 15.0
> product = "glance"
> startTime = "The time format they use, I forget"
> endTime = "The same"
> weatherParameters = { 'maxt' => true, 'mint' => false, .... }
>
> Response = NDFDgen( lattitude, longitude, product, startTime, endTime,
> weatherParameters )
>
> If my thinking is correct this will work. If it doesn't, then the
> hashmap might not be correct. You may have to manually create a SOAP
> structure for the weather parameters.  Let me know how it goes. The real
>   trouble you will have is writing a parser for the response, it is in a
> very ugly format.

Thanks for the help.  I've tried this method and others but I keep getting
this message
Unknown element {http://www.w3.org/2001/XMLSchema}simpleType.
Don't know where that error is generated.  Tried grepping for 'Unknown' and
'Unknown element'  but can't find any files where the phrase 'Unknown
element appears.

After this message I get this
c:/ruby/lib/ruby/site_ruby/1.8/soap/mapping/wsdlRegistry.rb:73:in
`obj2soap': Cannot map String to SOAP/OM. (SOAP::Mapping::MappingError)
I'm sure this error is directly related to the Unknown element message
because this error is occuring when it obj2soap is processing 'product'
which is defined by NOAA's wsdl as xsd:simpleType.
I have no clue what is wrong here.  the w2.rog/2001/XMLSchema defines
simpleType.  Does soap4r have a problem or does the NOAA wsdl have a
problem?

Ernie