Results 1 to 1 of 1
- 10-28-2010, 07:18 PM #1
Member
- Join Date
- Oct 2010
- Posts
- 1
- Rep Power
- 0
Maintaining session problem... Save and send cookie?
Hello,
I have recently switched to programming in Java after programming for a while in C++, so bare with me if I ask dumb questions... In the company I work I have a situation which requires me to connect to a webservice.
I have used WSDL2Java successfully to generate the stub from the WSDL. I can connect and login to the webservice (Axis2),but for some reason I cannot keep the session active. I send the login request, I receive the correct response, together with the cookie. The thing is I don't know how to extract it and send it along...
Here is my code:
X1OrderServiceStub stub = new X1OrderServiceStub();
X1OrderServiceStub.Login request= new X1OrderServiceStub.Login();
request.setEmail("something@somewhere.com");
request.setPassword("thanks");
System.out.println("Request : " + request.toString());
X1OrderServiceStub.LoginResponse response= stub.Login(request);
System.out.println("Response : " + response.toString()); // Login is succesful!
X1OrderServiceStub.AccountsList request2= new X1OrderServiceStub.AccountsList();
System.out.println("Request : " + request2.toString());
X1OrderServiceStub.AccountsListResponse response2= stub.AccountsList(request2);
System.out.println("Response : " + response2.toString()); // Result is session expired or not logged
I have tried to myStub._getServiceClient().getOptions().setManageS ession(true) but that doesn't seem to work. Is there any way to extract the cookie string from the response I get to the login request and then pass it to the following data request?
Or am I not invoking the webservice well?
Any advice is highly appreciated! Thank you very much!
Similar Threads
-
Maintaining logs of a chat session
By vrk in forum AWT / SwingReplies: 1Last Post: 10-27-2009, 03:18 PM -
save dialog problem
By masa in forum AWT / SwingReplies: 2Last Post: 03-06-2009, 12:41 AM -
Need your thoughts on the best way to store/save/send a VERY large string
By 2potatocakes in forum Advanced JavaReplies: 6Last Post: 01-19-2009, 08:28 PM -
Session Problem
By irfan.ahmad in forum Java ServletReplies: 4Last Post: 10-08-2008, 10:50 AM -
Email send problem
By serjant in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 09-19-2008, 02:15 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks