This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Web Services and the fly likes Stub generated using Axis2 Webservice creates new connection for redirect URL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Stub generated using Axis2 Webservice creates new connection for redirect URL" Watch "Stub generated using Axis2 Webservice creates new connection for redirect URL" New topic
Author

Stub generated using Axis2 Webservice creates new connection for redirect URL

Mohsin Jafri
Greenhorn

Joined: Oct 01, 2012
Posts: 1
Hello Friends,

I am badly stuck with a SOAP based integration using Axis2 framework for generation of client stubs from the Server WSDL. The scenario is as follows:-

1. There is always a login API call first, which gives a Success response in SOAP body and Temporary Redirect in HTTP header. Also provides a URL which contains the session ID in the Location field of HTTP Header.
2. The next API call is required to be made at this redirect location. IN THE SAME TCP CONNECTION, for getting a proper response.
3. Now, the problem is, as a part of Webservice implementation using Axis2 generated stubs, I need to reload this redirect URL and re-instantiate it as --- "stub=new Stub(newurl)"
As soon as this is done, it creates a new TCP connection and so, the next request gives the response as "session ID invalid" because it goes out-of-sync with login API.

I have tried everything mentioned as a solution in web and nothing is working out. For e.g --

MultiThreadedHttpConnectionManager httpConnectionManager = new MultiThreadedHttpConnectionManager(); HttpClient httpClient = new HttpClient(httpConnectionManager);

ServiceClient serviceClient = stub._getServiceClient();
Options opts = stub._getServiceClient().getOptions();

opts.setTo(new EndpointReference(prop.getProperty("target_end_point_url")));
opts.setProperty(HTTPConstants.REUSE_HTTP_CLIENT, Constants.VALUE_TRUE);
opts.setProperty(HTTPConstants.CACHED_HTTP_CLIENT, httpClient);

serviceClient.setOptions(opts);

stub._setServiceClient(serviceClient);

Similarly, I have tried many other options too. But its not helpful at all.

Please help me find a solution. I need it very urgently.

Thanks
 
Don't get me started about those stupid light bulbs.
 
subject: Stub generated using Axis2 Webservice creates new connection for redirect URL
 
Similar Threads
How to configure Axis2 client with generated stubs?
Axis2 1.5.4 generated Stubs are Thread-safe?
how to consume a webservice using axis2
Axis2 Http Header
Problem with Axis2 via proxy with NTLM authentication (currently defaulting to BASIC)