1 Reply Latest reply on Apr 18, 2007 1:11 PM by kad7715

    WebService complex result in datagrid

    Mongolian Beef Level 1
      Hi,

      Being new to flex2, I am confused on how to put a result coming from a webservice onto a datagrid. For example, a webservice call will give me a result (called item) that looks something like this:

      item containing a collection of packs, with each pack containing a collection of stores, and with each store containing a collection of shelves. In my datagrid, I would like to have displayed columns representing the stores, with records representing shelves. Each store will have the exact number of shelves, just different values. My wsdl looks like this:

      -------------------------------------
      <wsdl:definitions targetNamespace=" http://soap.booklobby.com">

      <wsdl:types>

      <xsd:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace=" http://book.booklobby.com">

      <xsd:complexType name="Book">

      <xsd:sequence>
      <xsd:element minOccurs="0" name="bookName" nillable="true" type="xsd:string"/>
      <xsd:element minOccurs="0" name="createTimestamp" type="xsd:dateTime"/>
      </xsd:sequence>
      </xsd:complexType>

      <xsd:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace=" http://soap.booklobby.com">

      <xsd:element name="createBook">

      <xsd:complexType>

      <xsd:sequence>
      <xsd:element maxOccurs="1" minOccurs="1" name="in0" nillable="true" type="ns1:Book"/>
      </xsd:sequence>
      </xsd:complexType>
      </xsd:element>

      <xsd:element name="createBookResponse">

      <xsd:complexType>

      <xsd:sequence>
      <xsd:element maxOccurs="1" minOccurs="1" name="createBookResult" nillable="true" type="ns5:Item"/>
      </xsd:sequence>
      </xsd:complexType>
      </xsd:element>
      </xsd:schema>

      <xsd:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace=" http://item.booklobby.com">

      <xsd:complexType name="Item">

      <xsd:sequence>
      <xsd:element minOccurs="0" name="id" nillable="true" type="xsd:long"/>
      <xsd:element minOccurs="0" name="sheets" nillable="true" type="ns2:ArrayOfPack"/>
      </xsd:sequence>
      </xsd:complexType>
      </xsd:schema>

      <xsd:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace=" http://pack.booklobby.com">

      <xsd:complexType name="ArrayOfPack">

      <xsd:sequence>
      <xsd:element maxOccurs="unbounded" minOccurs="0" name="Pack" nillable="true" type="ns2:Pack"/>
      </xsd:sequence>
      </xsd:complexType>

      <xsd:complexType name="Pack">

      <xsd:sequence>
      <xsd:element minOccurs="0" name="id" nillable="true" type="xsd:long"/>
      <xsd:element minOccurs="0" name="packSize" type="xsd:int"/>
      <xsd:element minOccurs="0" name="stores" nillable="true" type="ns3:ArrayOfStore"/>
      </xsd:sequence>
      </xsd:complexType>
      </xsd:schema>

      <xsd:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace=" http://store.booklobby.com">

      <xsd:complexType name="ArrayOfStore">

      <xsd:sequence>
      <xsd:element maxOccurs="unbounded" minOccurs="0" name="SheetItemWS" nillable="true" type="ns3:Store"/>
      </xsd:sequence>
      </xsd:complexType>

      <xsd:complexType name="Store">

      <xsd:sequence>
      <xsd:element minOccurs="0" name="department" nillable="true" type="xsd:string"/>
      <xsd:element minOccurs="0" name="id" nillable="true" type="xsd:long"/>
      <xsd:element minOccurs="0" name="shelves" nillable="true" type="ns4:ArrayOfShelf"/>
      </xsd:sequence>
      </xsd:complexType>
      </xsd:schema>

      <xsd:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace=" http://shelf.booklobby.com">

      <xsd:complexType name="ArrayOfShelf">

      <xsd:sequence>
      <xsd:element maxOccurs="unbounded" minOccurs="0" name="LineItemWS" nillable="true" type="ns4:Shelf"/>
      </xsd:sequence>
      </xsd:complexType>

      <xsd:complexType name="Shelf">

      <xsd:sequence>
      <xsd:element minOccurs="0" name="description" nillable="true" type="xsd:string"/>
      <xsd:element minOccurs="0" name="id" nillable="true" type="xsd:long"/>
      </xsd:sequence>
      </xsd:complexType>
      </xsd:schema>
      </wsdl:types>

      <wsdl:message name="createBookResponse">
      <wsdl:part name="parameters" element="tns:createBookResponse">
      </wsdl:part>
      </wsdl:message>

      <wsdl:message name="createBookRequest">
      <wsdl:part name="parameters" element="tns:createBook">
      </wsdl:part>
      </wsdl:message>

      <wsdl:portType name="BookService">

      <wsdl:operation name="createBook">
      <wsdl:input name="createBookRequest" message="tns:createBookRequest">
      </wsdl:input>
      <wsdl:output name="createBookResponse" message="tns:createBookResponse">
      </wsdl:output>
      </wsdl:operation>
      </wsdl:portType>

      <wsdl:binding name="BookWSServiceHttpBinding" type="tns:BookService">
      <wsdlsoap:binding style="document" transport=" http://schemas.xmlsoap.org/soap/http"/>

      <wsdl:operation name="createBook">
      <wsdlsoap:operation soapAction=""/>

      <wsdl:input name="createBookRequest">
      <wsdlsoap:body use="literal"/>
      </wsdl:input>

      <wsdl:output name="createBookResponse">
      <wsdlsoap:body use="literal"/>
      </wsdl:output>
      </wsdl:operation>
      </wsdl:binding>

      <wsdl:service name="BookWSService">

      <wsdl:port name="BookWSServiceHttpPort" binding="tns:BookWSServiceHttpBinding">
      <wsdlsoap:address location=" http://localhost:8080/book/service/BookWSService"/>
      </wsdl:port>
      </wsdl:service>
      </wsdl:definitions>
      -------------------------------------------------------------------

      Any ideas on how am I suppose to display the grid with the requirements above? Thanks in advance!

      -los