1 Reply Latest reply on Nov 14, 2012 9:56 AM by sb_2012

    HTTPService POST gives #2032 error android app

    sb_2012

      I am using flash builder to develop android apps. This is my action script code in to call my webservice which will insert data to my database on clicking the check boxes.

       

      var ResponseValue:int = 1;
         
      var QuestionID:int = data.QuestionID;
       
      ResultsQuestion = new ArrayCollection();
                                 
      ResultsQuestion.addItem({"ResultSEQ":10000});
                                 
      ResultsQuestion.addItem({"QuestionID":QuestionID});
                                 
      ResultsQuestion.addItem({"ResponsePromptID":chk1.name});
                                 
      ResultsQuestion.addItem({"ResponseValue":ResponseValue});
                                                         
      var service:HTTPService = new HTTPService();
      service
      .url = "http://IPaddress:443/InsertData/Service1.asmx/HelloWorld";

      //service.url = "http://localhost/InsertData/InsertData/Service1.asmx/HelloWorld";

      service.addEventListener(FaultEvent.FAULT,FaultHandler);
      service
      .method="POST";
      var parameters:Object = new Object();
      parameters
      ["ResponsePromptID"]= ResultsQuestion.getItemAt(2).ResponsePromptID;
      parameters
      ["QuestionID"]= ResultsQuestion.getItemAt(1).QuestionID;
      parameters
      ["ResponseValue"]= ResultsQuestion.getItemAt(3).ResponseValue;

      service
      .send(parameters);

       

       

      This works fine on my local host , but when I try to connect to the service on the server, my fault event shows me #2032 error and Fault string is HTTP Request Error. I am not sure how and where to look. Is there some thing in the server settings. Or do I have send headers? I am using the same server to pull data for me to populate my android app, and I have no issues.

       

      Please help

      Thank you

       

       


        • 1. Re: HTTPService POST gives #2032 error android app
          sb_2012 Level 1

          Well I used Webserivce in flex instead of the HTTP Service, since I was working with a .net Webservice. And that worked like a charm.

           

          fx:Declarations>

                              <s:WebService id="ws" wsdl="http://uraddress:443/TestWebserives/Service1.asmx?WSDL">

                                        <s:operation

                                                  name="HelloWorld"/>

                              </s:WebService>

                                                                         </fx:Declarations>

           

           

          And all I had to do in the event where I wanted to send the data to my webservice was to  just have  something like this

           

          ws.HelloWorld(ResultsQuestion.getItemAt(0).ResultSEQ,ResultsQuestion.getItemAt(1).Question ID,ResultsQuestion.getItemAt(2).ResponsePromptID,ResultsQuestion.getItemAt(3).ResponseValu e);

           

          Where ResultsQuestion is a Array Collection.

           

          But, I am not sure what is the disadvantage/advantage of using Webservice over HTTPSerive?

          Thank you