C# client calling java axis2 web service, object “resets”?

For most toolkits, web services are stateless by default. I think axis is no different.

For most toolkits, web services are stateless by default. I think axis is no different. If you want to maintain state between calls then you will need to enable sessions.An example on how to maintain sessions in axis can be found at: kickjava.com/src/test/session/TestSimple... On the .

NET side you will need to assign a CookieContainer to your request to store the session identifier. See HOW TO: Use CookieContainer to Maintain a State in Web Services for more information. I think your code would look something like this: localhost.

Database db = new WindowsFormsApplication1.localhost.Database(); // Assign the CookieContainer to the proxy class. Db. CookieContainer = new System.Net.CookieContainer(); db.login(); localhost.

GetProjectResponse pr = new WindowsFormsApplication1.localhost. GetProjectResponse(); pr. CookieContainer = db.

CookieContainer; pr = db.getProject(); I think that should let you do what you want -- but I wouldn't recommend it. Designing service interfaces is a bit different than designing object oriented interfaces. Service interfaces typically eschew the use of state and instead require the consumer to provide all of the relevant information in the request.

From Service-Oriented Architecture: Services should be independent, self-contained requests, which do not require information or state from one request to another when implemented. I would definitely recommend reading that article and perhaps revisiting your design.

I'm not sure why @shivaspk left a comment instead of writing an answer, it is quite correct: web service calls (not just axis calls) are meant to be stateless, so although the project object gets created by db.login(); when you call db.getProject(); It is being called on a different instance of your Database class that was created by Axis to service the second call. There is no really good answer to your question, except for you to rethink what you are trying to do. If you need some kind of authentication (via login), then that authentication needs to be part of every web service call.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions