4 Replies Latest reply on Jun 24, 2006 9:12 PM by poonamsheth

    HTTPService Error:can not retrieve data

    Level 7
      succeed Running Code:
      <mx:HTTPService id="showGoalService" showBusyCursor="true" method="POST"
      url="<a target=_blank class=ftalternatingbarlinklarge
      href=" http://192.168.1.104:8080/actmap/html/objectGetInfo.action?node.id=1"/>

      fault"> http://192.168.1.104:8080/actmap/html/objectGetInfo.action?node.id=1"/>

      fault</a> code:
      <mx:HTTPService id="showGoalService" showBusyCursor="true" method="POST"
      url="<a target=_blank class=ftalternatingbarlinklarge
      href=" http://192.168.1.104:8080/actmap/html/objectGetInfo.action?node.id=1"">htt
      p://192.168.1.104:8080/actmap/html/objectGetInfo.action?node.id=1"</a>
      <b>useProxy="false"</b>/>






        • 1. Re: HTTPService Error:can not retrieve data
          poonamsheth Level 1
          what is this code for?
          didnt understand..the purpose of it?

          i also wanted to knoe the meaning POST in it..

          actually i also had a doubt that can HTTPService can be used for only retriving data or binding data or can it be used also to write to XML or Create and XML?
          am a bit confused about all this.

          so the above code is for aht? if its succeeded/
          • 2. Re: HTTPService Error:can not retrieve data
            ntsiii Level 3
            Post menat the request parameters are sent in the http header, and not on the url querystring.

            But there are syntax problems with the sample code posted, it certainly will not compile.

            Lu BaoGuo, please re-post your sample code.

            Tracy
            • 3. Re: HTTPService Error:can not retrieve data
              ntsiii Level 3
              Ahh, a double post. Ignore this.

              Tracy
              • 4. Re: HTTPService Error:can not retrieve data
                poonamsheth Level 1
                well i think if we want to play with HTTPService in a actionscript block then we can go as such:
                The following example shows an HTTP service call in an ActionScript script block. Calling the useHTTPService() method declares the service, sets the destination, sets up result and fault event listeners, and calls the service's send() method.

                <mx:Script>
                <![CDATA[
                import mx.controls.Alert;
                public function useHttpService(parameters:Object):void {
                var service:HTTPService = new HTTPService();
                service.destination = "sampleDestination";
                service.method = "POST";
                service.addEventListener("result", httpResult);
                service.addEventListener("fault", httpFault);
                service.send(parameters);
                }

                public function httpResult(event:mx.rpc.events.ResultEvent):void {
                var result:Object = event.result;
                //Do something with the result.
                }

                public function httpFault(event:mx.rpc.events.FaultEvent):void {
                var faultstring:String = event.fault.faultstring;
                Alert.show(faultstring);
                }
                ]]>
                </mx:Script>