Thanks for the timely response Daniel.

Its a bummer. I have since searched for ways of terminating connections but
have run into some explanation for not doing just that.
http://markmail.org/thread/qpdza5qz4ziigkx5#query:+page:1+mid:c4qo4g2wc4sm7g53+state:results

Looks like tomcat will drain the stream before sending the fault and hence
it doesn't impact my memory footprint. however, i will loose out on the
thread that is hosed and few other reasons that bother me but short of
overriding the connector, i don't see any widely adopted way to solve this.

If anyone has solved this anyway, please advice.
Thanks,
Sam


On Wed, Mar 20, 2013 at 11:34 AM, Daniel Kulp [via CXF] <
[email protected]> wrote:

>
> There's actually not an easy way to do this, partially because few (if
> any) clients would actually support this use case.
>
> Most clients (including CXF) would be blocked trying to write the
> attachment onto the HTTP connection/socket.   Thus, if you don't read the
> attachments, they will not ever "unblock".   Without unblocking, they would
> not get the response.   Instead, they would either hang forever or more
> likely get some sort of socket timeout.
>
> From your interceptor, you could grab the HTTPServletRequest object and
> grab the input stream and "close" it, but even then, the client would get a
> socket closed exception, not any sort of response.
>
> Dan
>
>
> On Mar 19, 2013, at 1:34 AM, Forum User <[hidden 
> email]<http://user/SendEmail.jtp?type=node&node=5724896&i=0>>
> wrote:
>
> > Hi,
> > Using CXF Version 2.7.3
> > I have created a Provider service which acts as a proxy for all our web
> > service requests and some of the requests have attachments which are
> huge
> > and I want to create an interceptor which will look at the soap headers
> and
> > reject the message based on the header before the stream is processed
> and
> > the attachment is stored in a temp file (Based on my endpoint settings).
> >
> > Even when i do a chain.abort(), the attachment is streamed and the fault
> i
> > throw in my interceptor is sent back as the response.
> > My Question is:
> > How do I prevent the stream to be processed?
> >
> > Here is my Interceptor. For ease of reading, i removed all the
> unnecessary
> > code. Lets assume, in all cases, the interceptor throws a fault. So,
> when
> > my client is streaming 200 MB attachment (using MTOM), the response
> should
> > be received in milliseconds but it takes the same amount of time if i
> were
> > to process the message. Please advice. BTW, My interceptor is called,
> 'coz
> > i get the fault with the same exception code as below.
> >
> > public class ValidateHeadersInterceptor extends AbstractPhaseInterceptor
> {
> >
> >    public ValidateHeadersInterceptor(){
> >        super(Phase.RECEIVE);
> >
> >    }
> >
> >    @Override
> >    public void handleMessage(Message message) throws Fault {
> >
> >        Fault fault = new Fault(new Exception("Error processing request.
> > Invalid Header"));
> >        fault.setFaultCode(new QName("Client"));
> >        InterceptorChain chain = message.getInterceptorChain();
> >        chain.abort();
> >        throw fault;
> >    }
> > }
> > Thanks,
> > Sam
>
> --
> Daniel Kulp
> [hidden email] <http://user/SendEmail.jtp?type=node&node=5724896&i=1> -
> http://dankulp.com/blog
>
> Talend Community Coder - http://coders.talend.com
>
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://cxf.547215.n5.nabble.com/Reject-Service-Request-based-on-headers-tp5724755p5724896.html
>  To unsubscribe from Reject Service Request based on headers, click 
> here<http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5724755&code=dGVjaGFjY3QxMjNAZ21haWwuY29tfDU3MjQ3NTV8LTE4MzI4NzMyNg==>
> .
> NAML<http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: 
http://cxf.547215.n5.nabble.com/Reject-Service-Request-based-on-headers-tp5724755p5724904.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to