0 Replies Latest reply on Jun 14, 2012 7:47 AM by CarlCaulkett

    Trying to use NetworkMonitor with non-Flex REST client library

    CarlCaulkett

      As you may know, only the standard flex libraries will produce any output from NetworkMonitor in FlashBuilder 4.6. This is because NetworkMonitor is accessed via API stubs provided with FlashBuilder itself. I have therefore tried to use the NetworkMonitor.adjustNetConnectionURL method to divert the REST request to the NetworkMonitor proxy port 37813. This has worked up to a point in that I can see output in NetworkMonitor indicating that a request has taken place. However, something is messing up the request so that I keep getting http error 400 (badly formed request) each time. If I switch NetworkMonitor off, my unmodified request, going to port 67717 looks like this:

       

      POST /vision2/api/v1/services/login HTTP/1.0

      Date: Thu, 14 Jun 2012 9:26:36

      Accept: application/xml

      Content-Type: application/xml

      Content-Length: 76

       

      <V2Login>

        <UserName>carl</UserName>

        <Password>test</Password>

      </V2Login>

       

      This works fine.

       

      The modified request looks like this:

       

      POST /vision2/api/v1/services/login?hostport=<machinename>:61771&https=n&id=-1 HTTP/1.0

      Date: Thu, 14 Jun 2012 9:21:13

      Accept: application/xml

      Content-Type: application/xml

      Content-Length: 76

       

      <V2Login>

        <UserName>carl</UserName>

        <Password>test</Password>

      </V2Login>

       

      This results in an error 400 (badly formed request) which seems to indicate that the above request format is incorrect, but the (partially complete) request info does appear in NetworkMonitor.

       

      The REST client I am trying to use is RestHttpService, Has anyone succeeded in getting this type of thing to work?

       

      Cheers,

      Carl