You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Larry Gilliam <lg...@innovim.com> on 2010/10/18 20:40:57 UTC

responding with data

Hello,

How can I respond to a web service call with a stream of data?
Can I use SwA (SOAP with Attachements)?
Can I use SwA when the request is SOAP, but just return an
octet-stream when the request is REST?

Thanks for any info.

-Larry

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: responding with data

Posted by Jorge Medina <ce...@gmail.com>.
I use MTOM attachments. (I don't use Axis2 in the server, but I assume
the mechanism would be identical as with JAX-WS)

Using MTOM allows me to stream large files (hundreds of MB or GB)
outside of the XML SOAP envelope.
The element definition does not change

    <xsd:element name="theAttachment" type="xsd:base64binary"
xmime:expectedContentTypes= "*/*"/>

where xmime refers to the namespace
   xmlns:xmime="http://www.w3.org/2005/05/xmlmime"

I define my own implementation of DataSource that uses piped streams
(a pir of PipedOutputStream/PipedInputStream) to be able to free my
service thread -and return the SOAP call- and let  the streaming occur
in its own thread.

I have no idea how Axis2 would send the attachment if the original
request is REST.


-Jorge

On Mon, Oct 18, 2010 at 2:40 PM, Larry Gilliam <lg...@innovim.com> wrote:
> Hello,
>
> How can I respond to a web service call with a stream of data?
> Can I use SwA (SOAP with Attachements)?
> Can I use SwA when the request is SOAP, but just return an
> octet-stream when the request is REST?
>
> Thanks for any info.
>
> -Larry
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org