7 Replies Latest reply on Nov 12, 2012 11:20 AM by anixan

    Flex uses %5F as Underscore for HTTP Service?


      I am currently developing a Mobile Application with Adobe Flex 4.6 and I am having an Issue with using the HTTP Service functionality. I am trying to use a HTTP request like shown below:






      I have imported the service using the data menu and testing it using the parameters need and when i run a test on the service it pulls back the data fine and shows it in the "Test Operation" view.



      However when I then Add the following code to my view to test the application it returns a 2032 error:



          <?xml version="1.0" encoding="utf-8"?>
          <s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
                              initialize="view1_initializeHandler(event)" title="list">
                                        import mx.events.FlexEvent;
                                        import mx.rpc.events.FaultEvent;
                                        import mx.rpc.events.ResultEvent;
                                        import spark.events.IndexChangeEvent;
                                        protected function view1_initializeHandler(event:FlexEvent):void
                                                  // TODO Auto-generated method stub
                                                  var api_key:String = "00000aaaaa111111"
                                                  var area:String = "London";
                                                  listResult.addEventListener(ResultEvent.RESULT, onResult);
                                                  listResult.addEventListener(FaultEvent.FAULT, httpFault);
                                                  listResult.token = service.list(api_key, area);
                                        public function httpFault(event:FaultEvent):void { 
                                                  var faultstring:String = event.fault.faultDetail; 
                                                  trace("The Fault is: " + faultstring); 
                                        protected function onResult (event:ResultEvent):void
                                        protected function list_changeHandler(event:IndexChangeEvent):void
                                        protected function list_creationCompleteHandler(event:FlexEvent):void
                              <s:CallResponder id="listResult" result="data=listResult.lastResult"/>
                              <myservice:MyService id="service"/>
                              <!-- Place non-visual elements (e.g., services, value objects) here -->
                    <s:List id="list" left="0" right="0" top="0" bottom="85" fontSize="20" contentBackgroundColor="#272727"
                                        creationComplete="list_creationCompleteHandler(event)" change="list_changeHandler(event)">
                              <s:AsyncListView list="{data}"/>
                                                                                import valueObjects.Item;
                                                                                private function Name(item: Object):String
                                                                                          var item:Item = Item(item);
                                                                                          return listing.name;
                                                                                private function getImageURL(item: Object):String
                                                                                          var item:Item = Item(item);
                                                                                          return listing.image_url;


      With the code above I have managed to track the issue to the fact that for some unknown stupid reason when the code is run from the view the url that is sent is wrong and the underscores are replaced by %5F as shown below:






      Can anyone help me get around this issue?