1 Reply Latest reply on Feb 12, 2010 3:46 AM by Francisc

    webservice result and dataGrid fields

    fabio_beoni

      Hello,

       

      I try to bind data from webService to dataGrid.

       

      The trace of webService response is [Object],[Object]

       

      For each Object I have:

       

           Object.id = 0

           Object.name = "fullname"

       

           Object.id = 1

           Object.name = "fullname1"

       

           Object.id = 2

           Object.name = "fullname2"

       

            Ect....

       

      the binding in datagrid is

       

       

      <mx:Script>

       

           import webapps.pharmaspot.App;

       

       

       

           [Bindable] public var resultObject:Object = null;

       

      </mx:Script>

       

      <mx:WebService

           id="groupWS"

           wsdl="{ App.getEntryPoint() + 'groupManagerService?wsdl' }"

           showBusyCursor="true">

       

       

       

      <mx:operation

           name="listAll"

           resultFormat="object"

           fault="App.faultHandler(event)"

           result="App.resultHandler(event, resultObject)"

      />

       

       

        

       

      </mx:WebService>

       

       

       

      <mx:DataGrid id="groupGrid" width="100%" dataProvider="{groupDataProvider.resultObject}">

           <mx:columns>

                <mx:DataGridColumn headerText="Id" dataField="id"/>

                <mx:DataGridColumn headerText="Name" dataField="name"/>

          </mx:columns>

      </mx:DataGrid>

       

       

      This is the soap response

       

      <?xml version="1.0" encoding="UTF-8"?>
      <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
          <S:Body>
              <ns2:listAllResponse xmlns:ns2="http://webservice/">
                  <return>
                      <id>1</id>
                      <name>Gruppo Uno</name>
                  </return>
                  <return>
                      <id>2</id>
                      <name>Gruppo Due</name>
                  </return>
              </ns2:listAllResponse>
          </S:Body>
      </S:Envelope>

       

       

       

      I can NOT see data in datagrid....

      Please, help ...... thank you.