Loading ...
Sorry, an error occurred while loading the content.

Creating a complexType in SOAP::Lite

Expand Messages
  • john.schattel
    I am trying to create the following complexType weatherParametersType and my code (see below) isn t capturing the array of booleans correctly (see SOAP
    Message 1 of 1 , Aug 6 2:26 PM
    • 0 Attachment
      I am trying to create the following complexType weatherParametersType
      and my code (see below) isn't capturing the array of booleans correctly
      (see SOAP message below). Can anyone suggest a way to create the
      weatherParametersType in Perl/SOAP::Lite?:

      <xsd:complexType name="weatherParametersType">
      <xsd:all>
      <xsd:element name="maxt" type="xsd:boolean"/>
      <xsd:element name="mint" type="xsd:boolean"/>
      <xsd:element name="temp" type="xsd:boolean"/>
      <xsd:element name="dew" type="xsd:boolean"/>
      <xsd:element name="pop12" type="xsd:boolean"/>
      <xsd:element name="qpf" type="xsd:boolean"/>
      <xsd:element name="sky" type="xsd:boolean"/>
      <xsd:element name="snow" type="xsd:boolean"/>
      <xsd:element name="wspd" type="xsd:boolean"/>
      <xsd:element name="wdir" type="xsd:boolean"/>
      <xsd:element name="wx" type="xsd:boolean"/>
      <xsd:element name="waveh" type="xsd:boolean"/>
      <xsd:element name="icons" type="xsd:boolean"/>
      </xsd:all>
      </xsd:complexType>

      </xsd:schema>
      </types>

      <message name="NDFDgenRequest">
      <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" />

      </message>

      using the following Perl

      $latitude = 38.99;
      $longitude = -77.99;
      $product = "time-series";
      $startTime = "2004-01-01T00:00:00";
      $endTime = "2009-12-25T00:00:00";
      $weatherParameters{"maxt"} = "true";
      $weatherParameters{"mint"} = "false";
      $weatherParameters{"temp"} = "false";
      $weatherParameters{"dew"} = "false";
      $weatherParameters{"pop12"} = "false";
      $weatherParameters{"qpf"} = "false";
      $weatherParameters{"sky"} = "false";
      $weatherParameters{"snow"} = "false";
      $weatherParameters{"wspd"} = "false";
      $weatherParameters{"wdir"} = "false";
      $weatherParameters{"wx"} = "false";
      $weatherParameters{"waveh"} = "false";
      $weatherParameters{"icons"} = "false";

      $NDFD_XML = SOAP::Lite

      ->service('http://weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl')
      ->NDFDgen($latitude, $longitude, $product, $startTime,
      $endTime, %weatherParameters);

      Here is the SOAP message and it is not using booleans in the
      <weatherParameters> element nor does it seem to be creating an array.

      SOAP::Transport::HTTP::Client::send_receive: POST
      http://www.nws.noaa.gov/forecasts/xml/SOAP_server/ndfdXMLserver.php
      Accept: text/xml
      Accept: multipart/*
      Content-Length: 2162
      Content-Type: text/xml; charset=utf-8
      SOAPAction:
      "http://www.nws.noaa.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl#NDFDgen"

      <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope
      xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
      SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
      xmlns:xsd="http://www.w3.org/1999/XMLSchema"><SOAP-ENV:Body><namesp1:NDFDgen
      xmlns:namesp1="http://www.nws.noaa.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl"><latitude
      xsi:type="xsd:decimal">38.99</latitude><longitude
      xsi:type="xsd:decimal">-77.99</longitude><product
      xsi:type="typens:productType">time-series</product><startTime
      xsi:type="xsd:dateTime">2004-01-01T00:00:00</startTime><endTime
      xsi:type="xsd:dateTime">2009-12-25T00:00:00</endTime><weatherParameters
      xsi:type="typens:weatherParametersType">sky</weatherParameters><c-gensym9
      xsi:type="xsd:string">false</c-gensym9><c-gensym11
      xsi:type="xsd:string">qpf</c-gensym11><c-gensym13
      xsi:type="xsd:string">false</c-gensym13><c-gensym15
      xsi:type="xsd:string">icons</c-gensym15><c-gensym17
      xsi:type="xsd:string">false</c-gensym17><c-gensym19
      xsi:type="xsd:string">wspd</c-gensym19><c-gensym21
      xsi:type="xsd:string">false</c-gensym21><c-gensym23
      xsi:type="xsd:string">temp</c-gensym23><c-gensym25
      xsi:type="xsd:string">false</c-gensym25><c-gensym27
      xsi:type="xsd:string">dew</c-gensym27><c-gensym29
      xsi:type="xsd:string">false</c-gensym29><c-gensym31
      xsi:type="xsd:string">maxt</c-gensym31><c-gensym33
      xsi:type="xsd:string">true</c-gensym33><c-gensym35
      xsi:type="xsd:string">wdir</c-gensym35><c-gensym37
      xsi:type="xsd:string">false</c-gensym37><c-gensym39
      xsi:type="xsd:string">snow</c-gensym39><c-gensym41
      xsi:type="xsd:string">false</c-gensym41><c-gensym43
      xsi:type="xsd:string">waveh</c-gensym43><c-gensym45
      xsi:type="xsd:string">false</c-gensym45><c-gensym47
      xsi:type="xsd:string">mint</c-gensym47><c-gensym49
      xsi:type="xsd:string">false</c-gensym49><c-gensym51
      xsi:type="xsd:string">wx</c-gensym51><c-gensym53
      xsi:type="xsd:string">false</c-gensym53><c-gensym55
      xsi:type="xsd:string">pop12</c-gensym55><c-gensym57
      xsi:type="xsd:string">false</c-gensym57></namesp1:NDFDgen></SOAP-ENV:Body></SOAP-ENV:Envelope>
    Your message has been successfully submitted and would be delivered to recipients shortly.