0 Replies Latest reply on May 2, 2009 6:46 AM by dsryan

    HttpService 'GET' request successful but response w/ empty body??




      I'm converting a working flex 3 app to an AIR application but a call to a remote service returns with an empty body and I can't figure out why exactly, i thought it had to do with crossdomain policy file issues but the call does go to the server and the server responds correctly but the TraceTarget from my AIR app has an empty body. Like i said, it works fine running in my browser as a flex app. My sandbox type is 'application' which i think is full access. Below is the TraceTarget log from running my app using adl:


      Error: [strict] Ignoring policy file at http://localhost:4567/crossdomain.xml due to incorrect syntax.  See http://www.adobe.com/go/strict_policy_files to fix this problem.
      warning: unconverted Bindable metadata in class 'com.adobe.flex.extras.controls.springgraph::Item'
      useHttpService> url: /haml/sc method: GET handler: function Function() {}
      Security.sandboxType>  application
      '84490259-A5A7-BD3E-9BD3-FE1A63291A68' producer set destination to 'DefaultHTTP'.
      'direct_http_channel' channel endpoint set to http:
      '84490259-A5A7-BD3E-9BD3-FE1A63291A68' producer sending message 'E74F7D5F-2A4C-23C5-7AC5-FE1A633C28A9'
      'direct_http_channel' channel sending message:
        body = (Object)#1
        clientId = (null)
        contentType = "application/x-www-form-urlencoded"
        destination = "DefaultHTTP"
        headers = (Object)#2
        httpHeaders = (Object)#3
        messageId = "E74F7D5F-2A4C-23C5-7AC5-FE1A633C28A9"
        method = "GET"
        recordHeaders = false
        timestamp = 0
        timeToLive = 0
        url = "http://localhost:4567/haml/sc"
      '84490259-A5A7-BD3E-9BD3-FE1A63291A68' producer connected.
      '84490259-A5A7-BD3E-9BD3-FE1A63291A68' producer acknowledge of 'E74F7D5F-2A4C-23C5-7AC5-FE1A633C28A9'.
      Decoding HTTPService response
      Processing HTTPService response message:
        body = ""

        clientId = "DirectHTTPChannel0"
        correlationId = "E74F7D5F-2A4C-23C5-7AC5-FE1A633C28A9"
        destination = ""
        headers = (Object)#1
          DSStatusCode = 200
        messageId = "90A3A51A-2F1D-79A7-F269-FE1A63E19BCC"
        timestamp = 0
        timeToLive = 0


      This is the code i'm using to make the call, pretty basic:

      public function useHttpService(parameters:Object, url:String, method:String, format:String, handler:Function, contentTypeAsXML:Boolean=false):void {
              trace("useHttpService> url: "+url+" method: "+method+" handler: "+handler);
              trace("Security.sandboxType> "+
              var service:HTTPService = new HTTPService();
              service.url = PROTOCOL+HOST+url;
              service.method = method;
              if (contentTypeAsXML)
                  service.contentType = "application/xml";
              service.addEventListener(ResultEvent.RESULT, handler);
              service.addEventListener(FaultEvent.FAULT, fault_handler);
              if (format == null)
                  service.resultFormat = "object";
                  service.resultFormat = format;

      public function searchFor(searchString:String, handler:Function):void {
        useHttpService(null,"/haml/"+searchString, "GET", "e4x", handler);

      Any help or pointers on debugging this would be greatly appreciated!!!