You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by fyrachek <fy...@gmail.com> on 2012/08/30 18:40:21 UTC
Axis2 limit incoming response.
I'm calling external web service with axis2.
And I want to discard response message if its size(content of the incoming
InputStream) large than N bytes.
First idea was to add custom handler to the <phaseOrder type="InFlow">.
But after debugging it looks for me like response's InputStream was already
read and converted to SoapEnvelope.
Is there any other way to do that ? To read incoming InputStream before any
Axis2's manipulation with it and if its content length larger than N bytes-
discard response.
Thnx for any reply.
--
View this message in context: http://old.nabble.com/Axis2-limit-incoming-response.-tp34354334p34354334.html
Sent from the Axis - Dev mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org
Re: Axis2 limit incoming response.
Posted by santosh das <sa...@gmail.com>.
Probably oyu could try the option of chunked encoding ..and your service
side should support it.
On Thu, Aug 30, 2012 at 10:10 PM, fyrachek <fy...@gmail.com> wrote:
>
> I'm calling external web service with axis2.
> And I want to discard response message if its size(content of the incoming
> InputStream) large than N bytes.
>
> First idea was to add custom handler to the <phaseOrder type="InFlow">.
> But after debugging it looks for me like response's InputStream was already
> read and converted to SoapEnvelope.
>
> Is there any other way to do that ? To read incoming InputStream before any
> Axis2's manipulation with it and if its content length larger than N
> bytes-
> discard response.
>
> Thnx for any reply.
> --
> View this message in context:
> http://old.nabble.com/Axis2-limit-incoming-response.-tp34354334p34354334.html
> Sent from the Axis - Dev mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-dev-help@axis.apache.org
>
>
Re: Axis2 limit incoming response.
Posted by Hiranya Jayathilaka <hi...@gmail.com>.
If your response message is guaranteed to have a Content-Length header,
then you can access its value through MessageContext. It would be something
like:
Map headers = (Map)
messageContext.getProperty(MessageContext.TRANSPORT_HEADERS);
String contentLength = headers.get("Content-Length");
Hope this helps.
Thanks,
Hiranya
On Fri, Aug 31, 2012 at 7:20 PM, fyrachek <fy...@gmail.com> wrote:
>
> Hi, it looks like I found workaround for this :
>
> define custom Message Builder, and check input stream in it.
> But as for me it's only workaround
>
>
> fyrachek wrote:
> >
> > I'm calling external web service with axis2.
> > And I want to discard response message if its size(content of the
> incoming
> > InputStream) large than N bytes.
> >
> > First idea was to add custom handler to the <phaseOrder type="InFlow">.
> > But after debugging it looks for me like response's InputStream was
> > already read and converted to SoapEnvelope.
> >
> > Is there any other way to do that ? To read incoming InputStream before
> > any Axis2's manipulation with it and if its content length larger than N
> > bytes- discard response.
> >
> > Thnx for any reply.
> >
>
> --
> View this message in context:
> http://old.nabble.com/Axis2-limit-incoming-response.-tp34354334p34373746.html
> Sent from the Axis - Dev mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-dev-help@axis.apache.org
>
>
--
Hiranya Jayathilaka
Associate Technical Lead;
WSO2 Inc.; http://wso2.org
E-mail: hiranya@wso2.com; Mobile: +94 77 633 3491
Blog: http://techfeast-hiranya.blogspot.com
Re: Axis2 limit incoming response.
Posted by fyrachek <fy...@gmail.com>.
Hi, it looks like I found workaround for this :
define custom Message Builder, and check input stream in it.
But as for me it's only workaround
fyrachek wrote:
>
> I'm calling external web service with axis2.
> And I want to discard response message if its size(content of the incoming
> InputStream) large than N bytes.
>
> First idea was to add custom handler to the <phaseOrder type="InFlow">.
> But after debugging it looks for me like response's InputStream was
> already read and converted to SoapEnvelope.
>
> Is there any other way to do that ? To read incoming InputStream before
> any Axis2's manipulation with it and if its content length larger than N
> bytes- discard response.
>
> Thnx for any reply.
>
--
View this message in context: http://old.nabble.com/Axis2-limit-incoming-response.-tp34354334p34373746.html
Sent from the Axis - Dev mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org