0 Replies Latest reply on May 27, 2005 11:32 AM by Jay Gunderson

    Servlet consume XML with WebRowSet not working

    Jay Gunderson Newbie

      I am posting an xml fragment over http to a servlet. For the client I use
      CreateObject("MSXML2.XMLHTTP") to post over http.
      The servlet uses a WebRowSetImpl with request.getReader() to receive the xml. My problem is that I then try to loop thru the webRowSet and it is empty. The request has shown to have proper header names, and appropriate length, but still, the xml does not get read into the webRowSet.
      Here is my code:

      Client code (Microsoft Access 2002 - mandatory for my project):

      Set xmlhttp = CreateObject("MSXML2.XMLHTTP")
      Call xmlhttp.Open("POST", "http://localhost:8080/testing/servlet/Servlet1", False)
      Call xmlhttp.send("just testing fragment")

      Servlet code (tried jboss and oracle ias 10g, both get same empty webrowset):

      try {
      WebRowSetImpl wrs = new WebRowSetImpl();
      Reader reader = (BufferedReader)request.getReader();
      wrs.readXml((BufferedReader) request.getReader());
      wrs.readXml(reader);
      wrs.beforeFirst();
      while (wrs.next()) {
      System.out.println("LOOPING thru the rowset");
      }
      } catch(Exception e) {System.out.println("Post request Error thrown from Servlet1");};

      When tested my servlet log shows no LOOPING message, also the wrs.size shows empty.
      I have proven that the client is able to receive the servlet's html, so I assume the MSXML2.XMLHTTP is not the problem (not much else in their api to work with).
      Any ideas on how to receive the XML?
      Thanks very much,
      Jay