hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asha...@sears.com
Subject Status code of 100 on client.executeMethod();
Date Thu, 05 Jun 2003 20:12:04 GMT

Can anyone please let me know what does status code of 100 mean as a return
from client.executeMethod(post).
The result returns 100 and the subsequent code is not executed. I am not
able to retrieve the response as Stream.

Would appreciate if anyone can look at the code below to see if I have
missed anything that ought to be in the code.
This code is running under tomcat and is the alpha release before Release 2
beta 1.

          StringBuffer responseBody = new StringBuffer("");

          PostMethod method = null;
            String translatedString = "";

                  // Create the new HttpClient object
                  client = new HttpClient();

              //establish a connection within x seconds
              client.setConnectionTimeout(connectionTimeout);

              // Time it takes to receive the data after the connection is
established.
              client.setTimeout(timeout);

              //create a method object
              method = new PostMethod(sTheURL);

                  // Set the request body with the xml request
                  method.setRequestBody(sXML);

                  // Set the request headers
              method.setRequestHeader("Content-Type", " text/xml");
                  method.setRequestHeader("Content-Length",
translatedString.length() + "");

              int result = client.executeMethod(method);

              InputStream is = method.getResponseBodyAsStream();

              BufferedReader br = new BufferedReader(new
InputStreamReader(is));

              String line = null;
                while ((line = br.readLine()) != null)
                {
                   responseBody.append(line);
                }

              br.close();

              //clean up the connection resources
              method.releaseConnection();




Mime
View raw message