2 Replies Latest reply on Oct 4, 2009 11:53 PM by Ratsnackbar

    HTTPService call not working

    MangoAffan

      I am not able to call the url for some reason. When i click on submit it says in the browser status bar 'Waiting for localhost...'. The swf file is located at

      'http://localhost:8080/web/main.swf' so its on the same domain. Heres the code.

       

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
          <mx:Panel x="121" y="87" width="422" height="234" layout="absolute">
              <mx:Label text="User Name:"/>
              <mx:TextInput id="username"/>
              <mx:Label text="Password:"/>
              <mx:TextInput id="password"/>
              <mx:Button label="Submit" click="userRequest.send()"/>
          </mx:Panel>
         
          <mx:HTTPService id="userRequest" url="http://localhost:8080/app/login.do" useProxy="false" method="POST">
              <mx:request xmlns="">
                  <username>{username.text}</username>
                  <password>{password.text}</password>
              </mx:request>
          </mx:HTTPService>
      </mx:Application>

       

       

      When i hit the url (http://localhost:8080/app/login.do) directly it works. But not via swf file. Any suggestions would be helpful. Thanks.

        • 1. Re: HTTPService call not working
          UbuntuPenguin Level 4

          Is there another error message being thrown , can you debug the endpoint and see if it is being "Hit" by the swf request ?  Throwing and actionscript resulthandler in there and debugging through flex builder should show you if the request is making it round trip.

          • 2. Re: HTTPService call not working
            Ratsnackbar Level 2

            You might also want to consider using something like Charles Proxy to see what is being transmitted and received.  Another thing to consider is if you need a crossdomain.xml file in the locaiton of the service.  (likely you do).

             

            If you are using Flash Builder 4 Beta you can also use the Network Monitor which might give some insight.

             

            -Joe