1 Reply Latest reply on Nov 7, 2004 9:08 AM by Thomas Diesler

    Reading soap body as a string in a Document style ws.

    gsarno Newbie

      Hi,
      I don't know this might be an AXIS specific question,
      but you might have come across this.

      I would like to deploy a Document style web service and on the Server side I would like to read the Soap Body (payload: in my case a XML document) as a string and not as a DOM document/element.
      Of Course I could convert the DOM document in a String, but I would like to avoid the DOM parsing as my back end system provides parsing capability and I don't want to parse twice the same XML message.

      Is there a way I can do this or RPC is the only chance ?

      cheers.
      Giuseppe.

        • 1. Re: Reading soap body as a string in a Document style ws.
          Thomas Diesler Master

          Giuseppe, unfortunately not. By the time the message reaches your endpoint Axis has already parsed the message and recorded the SAX events.
          Also, the SAAJ view of the message is W3C DOM based, so the incomming message is already an in memory DOM tree.

          Your best bet might be, to forget about Axis and route you WS requests to a plain web application (I assume you use HTTP transport). This is especially true is you are not using JAXRPC handlers and such.

          Lazy loading of the request message is a requirement of our new JBossWS implementation.