1 Reply Latest reply on Nov 27, 2006 11:11 AM by Bill Sahlas

    Flex 2.0 WebService woes

      I am experiencing problems with the <mx:WebService> capability within my Flex 2.0 applications. Please find attached a brief sample that should help to illustrate the problems.

      If you compile and run the attached code with the default input, you should see the web-service call results in a fault during the decode sequence. However, if you run the same example with the following web-based soap client (note you must supply the URL of the corresponding WSDL), you should see that the web-service works fine.


      Interestingly enough, the web-service call within the supplied Flex application does not fail when supplying input that is not found, such as when modifying the default artist input to ”Beagles”.

      I can’t imagine a simpler web-service test within a Flex 2.0 application, nor can I see any coding mistakes based upon my understanding after thoroughly reading the supplied Flex 2.0 documentation.


      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml">
      private function doRequest():void {
      lyricsRequest.getSongResult.request.artist = artist.text;
      lyricsRequest.getSongResult.request.song = song.text;
      <mx:WebService id="lyricsRequest"
      fault="lyrics.text = event.toString() + event.message.body;"
      result="lyrics.text = event.result.lyrics;"
      wsdl=" http://www.lyricwiki.org/server.php?wsdl">
      <mx:Form defaultButton="{ok}">
      <mx:FormItem label="Artist">
      <mx:TextInput id="artist" text="Eagles" />
      <mx:FormItem label="Song">
      <mx:TextInput id="song" text="Hotel California" />
      <mx:TextArea id="lyrics" width="400" height="100" wordWrap="true" />
      <mx:Button id="ok" click="doRequest();" label="OK" />