Hi Marco
On 30/09/13 13:31, Marco Mans wrote:
Hi Sergey!
Thanks for the quick response! I just tried with the 2.7.8-SNAPSHOT version.
Relative redirection is working now!
Thanks for confirming it
I noticed that a second call, with the same client is done to the 'old'
location.
The redirection adds a session-id to the url. So it is important to keep
this id in the URL.
Is there a setting that enables this?
I think it is a general issue with auto-redirects is that a new Location
is not set as the current client's request URI/endpoint address.
As far as I recall, a load balancing feature has the same draw-back, as
opposed to a fail-over feature.
I'm thinking of introducing an interface, say, TransportCallback. The
frontend clients will set it internally and HttpConduit or other code
which auto-updates the request address will call back on
TransportCallback if it is available - this will let the clients update
the current request URI as needed per the rules of a given frontend.
Introducing events may be another option but I wonder if it can have
some thread-safety issues...
Something like that
Sergey
Greetz,
Marco
2013/9/26 Sergey Beryozkin <[email protected]>
I replaced the manual resolution code I added originally with URI resolve
call - that should fix the issue; also add a new "max.http.redirect.count"
property - can be used to prevent the client from spinning...
Cheers, Sergey
On 26/09/13 15:38, Sergey Beryozkin wrote:
Hi
Yes, I can see it does not resolve it correctly, I have a test but a bit
more work is needed. I'll update you when I'm done
Sergey
On 26/09/13 15:01, Marco Mans wrote:
Hi Folks!
I have some problems with a webservice that uses a relative redirect.
This is what is happening:
1. I send a request to
http://mydomain.com/**webservice.asmx<http://mydomain.com/webservice.asmx>
2. The webservice answers with a HTTP 302 and sets the location to
/(12323123312)/webservice.asmx
3. CXF autmatically redirects and send a second request to
http://mydomain.com/**webservice.asmx/(12323123312)/**webservice.asmx<http://mydomain.com/webservice.asmx/(12323123312)/webservice.asmx>
Instead of replacing the root of my path it simply adds the relative
redirection at the end of the original request.
This code I use to enable autoredirection:
<snippet>
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.setServiceClass(**MyWebServiceSoap.class);
factory.setAddress("http://**mydomain.com/webservice.asmx<http://mydomain.com/webservice.asmx>
")**;
service = (GensysWebServiceSoap) factory.create();
Client client = ClientProxy.getClient(service)**;
((HTTPConduit) (client.getConduit())).**getClient().setAutoRedirect(**
true);
client.getBus().getProperties(**).put("http.redirect.relative.**uri",
true);
</snippet>
Does anyone knows how to fix this?
Thanks in advance!!!
Greetz,
Marco Mans
--
Sergey Beryozkin
Talend Community Coders
http://coders.talend.com/
Blog: http://sberyozkin.blogspot.com