title: Flex: HTTPService error #2032 every time
body: <p>I had read this:
  <a href="https://stackoverflow.com/questions/1491902/flex-http-request-error-2032">Flex: HTTP request error #2032</a></p>
  
  <p>And this:
  <a href="http://www.judahfrangipane.com/blog/2007/02/15/error-2032-stream-error/" rel="nofollow noreferrer">http://www.judahfrangipane.com/blog/2007/02/15/error-2032-stream-error/</a></p>
  
  <p>Trying to figure out whats going on, and im failing big time so far...</p>
  
  <p>I can not consume even the simplest servlet with HTTPService component, they all fail and i have no idea why.</p>
  
  <p>tryed Post and Get as well.</p>
  
  <p>HTTP request error</p>
  
  <pre><code>Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Error de secuencia. URL: http://localhost:8080/root/test"]. URL: http://localhost:8080/root/test
  </code></pre>
  
  <p>Flex:</p>
  
  <pre><code>&lt;s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
                 xmlns:s="library://ns.adobe.com/flex/spark" 
                 xmlns:mx="library://ns.adobe.com/flex/mx"
                 minWidth="955" minHeight="600"&gt;
          &lt;fx:Declarations&gt;
              &lt;s:HTTPService
                  id="httpSerciseTest"
                  url="/root/test"
                  method="GET"
                  resultFormat="e4x"
                  useProxy="false"
                  result="resultHandler(event)"
                  fault="Alert.show(event.fault.faultString+
                  '\n' + event.fault.faultDetail,
                  'Error: '+event.fault.faultCode)"/&gt;
          &lt;/fx:Declarations&gt;
          &lt;fx:Script&gt;
              &lt;![CDATA[
                  import mx.controls.Alert;
                  import mx.rpc.events.FaultEvent;
                  import mx.rpc.events.ResultEvent;
  
                  [Bindable]private var xmlResult:XML;
                  private function creationCompleteHandler():void
                  {
                      httpSerciseTest.send();
                  }
                  private function resultHandler(event:ResultEvent):void
                  {
                      xmlResult=event.result as XML;
                  }
              ]]&gt;
          &lt;/fx:Script&gt;
  &lt;/s:Application&gt;
  </code></pre>
  
  <p>Java servlet:</p>
  
  <pre><code>public class Test extends HttpServlet {
      private static final long serialVersionUID = 4484874511692568559L;
      private static final String CONTENT_TYPE = "text/xml; charset=utf-8";
      protected void doGet(HttpServletRequest request, HttpServletResponse response)throws IOException
      {
          response.setContentType(CONTENT_TYPE);
          try{
              PrintWriter writer=response.getWriter();
              writer.println("&lt;?xml version=\"1.0\"?&gt;\n");
              writer.println("&lt;root&gt;");
              writer.println("&lt;folder label=\"Repository\"/&gt;");
              writer.println("&lt;folder label=\"Documentation\"/&gt;");
              writer.println("&lt;/root&gt;");
          }catch (IOException IOE){
              throw IOE;
          }
      }
  }
  </code></pre>
  
  <p>web.xml</p>
  
  <pre><code>&lt;servlet&gt;
          &lt;servlet-name&gt;test&lt;/servlet-name&gt;
          &lt;display-name&gt;test&lt;/display-name&gt;
          &lt;servlet-class&gt;java_servlets.Test&lt;/servlet-class&gt;
      &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;test&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/test&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>also, im using filereference uploading and downloading files with servlets and they're working fine, but if i call the very same servlets with HTTPService, they fail too...</p>
  
  <p>Edit: localhost:8080/root/test shows a HTTP Status 404 page.</p>
  
  <p>2nd Edit: I copy pasted the doGet from this test example to my file upload servlet and its working, HTTPService can consume it from there, but not from the new ones i created, including this test...</p>