Hi session-managers,
I'm running my client and server with modules addressing-1.1, logging,
soapmonitor-1.1 engaged and have set scope=soapsession
MyService.java got the additional methods
public void init(ServiceContext sCtx) {
this.sc = sCtx;
this.log.info(sc.toString()+" init() called ");
}
public void destroy(ServiceContext sCtx) {
if(!this.sc.toString().equals(sCtx.toString())){
this.log.error("ServiceContext on init() and destroy() not equal in
");
}
this.log.info(sc.toString()+" destroy() called ");
}
public void setOperationContext(OperationContext oCtx) {
this.oc = oCtx;
this.log.info(oc.toString()+" setOperationContext() called ");
}
I start client #1 which has the effect that MyService.init() is called; so far
so right!
Client #1 then loops and sends continously messages to MyService.echo()
I start client #2 which has the effect that MyService.destroy() is called
followed by MyService.init()
This has the effect that client #1 fails with an "invalid group context id
exception"
Is this a bug?
I have studied the architecture of axis2 and have drilled down in code and I
came down to where alle the service objects are finally called at
"invokeBusinessLogic" (inCtx, outCtx) with it's call to "method.invoke" ( . .
. )
All reading in code and documentation did not answer my questions *** How does
Axis2 manage / support long-lasting-sessions to server-objects bound to this
session ? ***
Do I have to implement this myself on top of Axis2?
1. I want to have a client-object exchanging OMElements with it's
service-class-object.
2. when the client starts the session, up on receiving the first message, a
unique instance of the service-class-object shall be created at the server.
2a) 20 client objects shall mean we have instantiated 20
dedicated-server-objects
3. as long as this 20 service-class-object exists, in fact 20 wrapper-object to
20 external server process, and as long as this 20 external process exist it
shall not be allowed that one single service-class-object dies. for that
reasioon the server-objects must exist until it's dedicated client terminates
the session esplicitly by calling logout() on the server-object.
4. every message sent by a client has to reach exact the same instance of the
service-class-object as the previous message did, anything else would be
considerd a security risk, a fault, an error.
I have read in a dcoument about axis session managment @
http://www.developer.com/java/web/print.php/3620661 "that axis2 is meant to be
an enterprise web service engine, so it has to support session management."
I have read all related e-mails and implemented soap-sessions which work nicely
with one client and one server. But they die when the second client starts as
descibed above. the second client creates a new service-group-id when and the
old one gets lost. THis happens in my mind because destry is called implicit.
So client-1 then fails as it's known service-group-id does no longer exist.
I have not found in all the e-mail of the past 3 months a clear idea or an
answer to this often asked questions about "how to implement sessions to such
server side obejcts".
I must admit, I do not understand how ws-addressing supports my demand.
Can I managment my sessions with axis2 in an elegant way or do I have to
fall-back to servlets and tomcat?
I would really appreciate any answers and thank you very much to answer my
burning question not only for my own satisfaction. Thank you.
Josef