0 Replies Latest reply on Feb 2, 2007 1:40 AM by spyder100

    Help loading .net webservice data into flex grid - surely this is simple???!!!

    spyder100 Level 1
      just installed flex 2
      playing around with a grid box and would like to populate it with data from a call to a web service
      but it dosnt work

      my code (obviously wrong)

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute">
      <mx:WebService id="TUNE"
      wsdl=" http://localhost:4264/WebSite10/Service.asmx?WSDL"
      useProxy="false">
      <mx:operation name="SearchTuneByArtist">
      <mx:request>
      <Artist></Artist>

      </mx:request>
      </mx:operation>
      </mx:WebService>

      <mx:Panel x="10" y="10" width="475" height="400" layout="absolute"
      title="Most Popular Posts">



      <mx:DataGrid x="30" y="75" id="dgTopPosts" width="400" dataProvider="{TUNE.SearchTuneByArtist.results}">
      <mx:columns>

      <mx:DataGridColumn headerText="song" dataField="Songname" width="75"/>
      <mx:DataGridColumn headerText="artist" dataField="Artist" width="75"/>
      <mx:DataGridColumn headerText="genre" dataField="Genre" width="75"/>

      </mx:columns>

      </mx:DataGrid>

      <mx:LinkButton x="30" y="250"
      label="Select an item and click here for full post" click="TUNE.SearchTuneByArtist.send()"/>
      </mx:Panel>

      </mx:Application>


      the .net service accepts the var "artist" and then returns a class from .net - or so i beleive? anyway ive posted the xml file that is returned question is can it be made to work or is the service returning a dataset/xml scheme that flex cant work with???

      <?xml version="1.0" encoding="utf-8" ?>
      - <anyType xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd=" http://www.w3.org/2001/XMLSchema" xsi:type="Tunes" xmlns=" http://tempuri.org/">
      <Count>22</Count>
      - <Rows>
      - <xs:schema id="Results" xmlns="" xmlns:xs=" http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
      - <xs:element name="Results" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
      - <xs:complexType>
      - <xs:choice minOccurs="0" maxOccurs="unbounded">
      - <xs:element name="results">
      - <xs:complexType>
      - <xs:sequence>
      <xs:element name="TuneKey" type="xs:int" minOccurs="0" />
      <xs:element name="Songname" type="xs:string" minOccurs="0" />
      <xs:element name="Artist" type="xs:string" minOccurs="0" />
      <xs:element name="Genre" type="xs:string" minOccurs="0" />
      </xs:sequence>
      </xs:complexType>
      </xs:element>
      </xs:choice>
      </xs:complexType>
      </xs:element>
      </xs:schema>
      - <diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
      - <Results xmlns="">
      - <results diffgr:id="results1" msdata:rowOrder="0">
      <TuneKey>137</TuneKey>
      <Songname>Zim Zimer</Songname>
      <Artist />
      <Genre />
      </results>
      - <results diffgr:id="results2" msdata:rowOrder="1">
      <TuneKey>138</TuneKey>
      <Songname>Tell Me What You Got</Songname>
      <Artist />
      <Genre />
      </results>
      - <results diffgr:id="results3" msdata:rowOrder="2">
      <TuneKey>139</TuneKey>
      <Songname>Brand New Heavies</Songname>
      <Artist />
      <Genre />
      </results>
      - <results diffgr:id="results4" msdata:rowOrder="3">
      <TuneKey>140</TuneKey>
      <Songname>White Lines</Songname>
      <Artist />
      <Genre />
      </results>
      - <results diffgr:id="results5" msdata:rowOrder="4">
      <TuneKey>141</TuneKey>
      <Songname>Saving All My Love</Songname>
      <Artist>Whitney Huston</Artist>
      <Genre>R&B</Genre>
      </results>
      - <results diffgr:id="results6" msdata:rowOrder="5">
      <TuneKey>142</TuneKey>
      <Songname>All At Once</Songname>
      <Artist>Whitney Huston</Artist>
      <Genre>R&B</Genre>
      </results>
      - <results diffgr:id="results7" msdata:rowOrder="6">
      <TuneKey>143</TuneKey>
      <Songname>Pocket Full of Bud</Songname>
      <Artist>50 cent</Artist>
      <Genre>Hip Hop</Genre>
      </results>
      - <results diffgr:id="results8" msdata:rowOrder="7">
      <TuneKey>144</TuneKey>
      <Songname>Rescue Me</Songname>
      <Artist>Teedra Moses</Artist>
      <Genre>R&B</Genre>
      </results>
      - <results diffgr:id="results9" msdata:rowOrder="8">
      <TuneKey>145</TuneKey>
      <Songname>Moses</Songname>
      <Artist>Teedra</Artist>
      <Genre>Dont Mess My Man</Genre>
      </results>
      - <results diffgr:id="results10" msdata:rowOrder="9">
      <TuneKey>146</TuneKey>
      <Songname>One Step Beyond</Songname>
      <Artist>Madness</Artist>
      <Genre>Pop</Genre>
      </results>
      - <results diffgr:id="results11" msdata:rowOrder="10">
      <TuneKey>147</TuneKey>
      <Songname>Stand Up</Songname>
      <Artist>Ludicras</Artist>
      <Genre>Hip Hop</Genre>
      </results>
      - <results diffgr:id="results12" msdata:rowOrder="11">
      <TuneKey>148</TuneKey>
      <Songname>baby</Songname>
      <Artist>Ashante</Artist>
      <Genre>R&B</Genre>
      </results>
      - <results diffgr:id="results13" msdata:rowOrder="12">
      <TuneKey>149</TuneKey>
      <Songname>Dry Cry</Songname>
      <Artist>Sizla</Artist>
      <Genre>Dance Hall</Genre>
      </results>
      - <results diffgr:id="results14" msdata:rowOrder="13">
      <TuneKey>150</TuneKey>
      <Songname>Champion</Songname>
      <Artist>Buju banton</Artist>
      <Genre>DANCE HALL</Genre>
      </results>
      - <results diffgr:id="results15" msdata:rowOrder="14">
      <TuneKey>151</TuneKey>
      <Songname>PERFECT PROPOSAL</Songname>
      <Artist>WAYNE WONDER</Artist>
      <Genre>REGGAE</Genre>
      </results>
      - <results diffgr:id="results16" msdata:rowOrder="15">
      <TuneKey>152</TuneKey>
      <Songname>WHY YOU HATE THE GAME</Songname>
      <Artist>GAME</Artist>
      <Genre>HIP HOP</Genre>
      </results>
      - <results diffgr:id="results17" msdata:rowOrder="16">
      <TuneKey>153</TuneKey>
      <Songname>IF HIP HOP IS DEAD</Songname>
      <Artist>NAS</Artist>
      <Genre>HIP HOP</Genre>
      </results>
      - <results diffgr:id="results18" msdata:rowOrder="17">
      <TuneKey>154</TuneKey>
      <Songname>HARD KNOCK LIFE</Songname>
      <Artist>JAY Z</Artist>
      <Genre>RAP</Genre>
      </results>
      - <results diffgr:id="results19" msdata:rowOrder="18">
      <TuneKey>155</TuneKey>
      <Songname>WISHING ON A STAR</Songname>
      <Artist>JAY Z</Artist>
      <Genre>RAP</Genre>
      </results>
      - <results diffgr:id="results20" msdata:rowOrder="19">
      <TuneKey>156</TuneKey>
      <Songname>Help</Songname>
      <Artist>Beetles</Artist>
      <Genre>Pop</Genre>
      </results>
      - <results diffgr:id="results21" msdata:rowOrder="20">
      <TuneKey>159</TuneKey>
      <Songname>Dutty wind</Songname>
      <Artist>beenieman</Artist>
      <Genre>dancehall</Genre>
      </results>
      - <results diffgr:id="results22" msdata:rowOrder="21">
      <TuneKey>160</TuneKey>
      <Songname>Fish go deep</Songname>
      <Artist>Cure and the Chance</Artist>
      <Genre>House</Genre>
      </results>
      </Results>
      </diffgr:diffgram>
      </Rows>
      <Err>0</Err>
      </anyType>