4 Replies Latest reply on Jun 19, 2008 4:15 AM by Tommy Bergkvist

    Streaming webservices

    Tommy Bergkvist Newbie

      Hi,

      I am using jbossas 4.2.2, jbossws 3.0.1.
      I am having some trouble with my webservice implementation. My endpoint needs to be able to both send and receive large XMLs. In my case there are large elements (100 Mb) which are Base64 encoded.

      All attempts on sending such XML ends up as a DOMSource on my endpoint. Is there any way to configure Webservices to not parse the incoming message and use StreamSource instead. I have no interest what so ever to marshall/unmarshall, validate, use Interceptors nor Handlers. I would be very pleased if incoming message could be streamed straight down to disk.

      If StreamSource is not possible, then a StaxSource using the Woodstox implementation would be nice as well (it handles large Elements).

      I am also having a similar problem with my stand-alone client. It runs with java 1.6. As soon as an Element is larger than 100kb I get an Exception that end element is missing, It seams that the XMLStreamReader (which is used by com.sun.xml.internal.ws.client.dispatch) can not handle large Elements.

      Do I need to use Spring to be able to stream over Webservices?

      Anyone has any ideas?

        • 1. Re: Streaming webservices
          Pramod Nair Novice

          I think one option to solve your problem could be to use soap as an attachemnt feature. There are samples in the jboss source download.

          • 2. Re: Streaming webservices
            Tommy Bergkvist Newbie

            Unfortunately I am note the one who is responsible for the technical specifiaction. The transport should comply with a specified XSD and also various clients and servers (not only the ones I am implementing) should be able to communicate.

            Also, the XML elements that are that large actually contains binary documents that the server is not required to understand. They should just be stored in an archive as base64 encoded strings.

            I have tried to figure out how to solve this, but there does not seem to exist any implementation to handle streaming webservices with large XML elements. The one parser I have used which can handle this is Woodstox, but jboss does not support this, right? Maybe in the future?

            • 3. Re: Streaming webservices
              Alessio Soldano Master

              Is the javax.xml.ws.Provider a solution for you? You might want to check the org.jboss.test.ws.jaxws.samples.provider test cases.

              • 4. Re: Streaming webservices
                Tommy Bergkvist Newbie

                I am using the Provider and the server receives a Source. However, it is a DOMSource, which means the entire message is in memory. I would like to receive a StreamSource with an InputStream. Then I can parse it myself with the appropriate tools.

                I have tried to disable all my Logical- and SOAPMessageHandlers to avoid parsing by jboss, but it does not seem to help. Is there somthing I can implement or configure to avoid parsing into DOM tree?