axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <ste...@apache.org>
Subject Re: HTTP Redir with axis 1.3
Date Tue, 28 Feb 2006 10:56:28 GMT
Giuseppe Picone wrote:
> I should implement an HTTP redirection (307 code) with Axis 1.3, both
> from client side and from server side.
> 
> I must do the redir with Axis because it depends from  the SOAP content.
> 
> 
> I need Howto and some tip.
> 
> I'll appreciate also some example code
> 
> Thanks
> Giuseppe
> 

I'm glad you are looking at 307 not 307, as ws-i forbids acting on 302. 
For the 307 message they say

   R1131   A CONSUMER MAY automatically redirect a request when it 
encounters a "307 Temporary Redirect" HTTP status code in a response.

RFC2616 notes that user-agents should not automatically redirect 
requests; however, this requirement was aimed at browsers, not automated 
processes (which many Web services will be). Therefore, the Profile 
allows, but does not require, consumers to automatically follow 
redirections.

For the server, you'd need a new axis servlet that caught a custom 
redirect exception, extracted the new path from the exception and 
generated the appropriate message. I dont think anyone has done this yet.

For the client, I would target axis with the http-client library, as 
this invariably has better handling of http things than Sun's own 
library. you'd need to trace into the code to see what happens, and then 
either
  -silently put in a redirect
  -recognise a 307 response, and create a new redirect exception, 
containing the URL to use
  -have the client code catch and act on the response
  -add some loop detection code. After a finite number of redirects, you 
should give up trying.

No sample code I'm afraid.

-steve

Mime
View raw message