On Monday 13 October 2008 5:37:02 am ripcord wrote:
> Hi,
>
> I'm using a jax-ws webservice generated from WSDL. It's SOAP document style
> and everything works fine. The server is protected by Suns Policy agent, so
> the client passes a session token as a cookie in the http header. However,
> if the token is incorrect, the policy agent will return an empty http 302
> redirect message. This has no body and so the client throws a SOAP fault.
>
> Would anyone know what kind of interceptor I need to write for the client
> that will catch the 302 response before CXF tries to parse the SOAP body?

If you stick your "in" interceptor into the RECEIVE phase, that would be the 
earliest stuff and you could catch it there before anything else happens.   
In your interceptor, you could probably just throw an exception which would 
cause the chain to stop and send that exception back to the client.   
Otherwise, you can get the interceptor chain off the message and then call 
the pause() or abort() methods on it and just return.

Dan



> Also, how would I exit the chain without the rest of the interceptors being
> called?
>
> Thanks for any help..
> Here's the code to setup my client..
>
>         QName serviceName = new QName("http://tempuri.org/";, "MyService");
>         QName portName = new QName("http://tempuri.org/";,
> "BasicHttpBinding_IMyService");
>         String address =
> "http://sample.com/Webservices/MyService/Service.svc";;
>
>         // create port
>         Service service = Service.create(serviceName);
>         service.addPort(portName, SOAPBinding.SOAP11HTTP_BINDING, address);
>         servicePort = (IMyService)service.getPort(portName,
> IMyService.class);



-- 
Daniel Kulp
[EMAIL PROTECTED]
http://dankulp.com/blog

Reply via email to