Hi Suraj,
You can add a SimpleSessionHandler to the client/server chains to preserve session
context across requests. I verified that it works with the JMS transport. If you have
the src, take a peek at test.session.TestSimpleSession. That's the test I used as a
starting point. I included some sample code/wsdd below.
Native support for sessions is not provided in the JMS transport because there is no
standard mechanism for it as there is with HTTP (via cookies and HTTPSession).
It wouldn't be difficult to implement, but at the same time it's not clear how
critical this
support is for JMS. Is this something that you would like to see implemented, or will
the SimpleSessionHandler solution suffice?
Thanks,
Ray Chun
Sonic Software
Example --
1. client wsdd
<deployment ...
<handler type="java:org.apache.axis.handlers.SimpleSessionHandler "
name="SimpleSessionHandler"/>
<service name="sessionTest">
<requestFlow><handler type="SimpleSessionHandler"/></requestFlow>
<responseFlow><handler type="SimpleSessionHandler"/></responseFlow>
</service>
<transport name="JMSTransport"
pivot="java:org.apache.axis.transport.jms.JMSSender"/'>
</deployment>";
2. server wsdd
<deployment ...
<handler type="java:org.apache.axis.handlers.SimpleSessionHandler"
name="SimpleSessionHandler"/>
<service name="sessionTest" provider="java:RPC">
<requestFlow><handler type="SimpleSessionHandler"/></requestFlow>
<responseFlow><handler type="SimpleSessionHandler"/></responseFlow>
<parameter name="allowedMethods" value="counter"/>
<parameter name="className" value="test.session.TestSimpleSession"/>
<parameter name="scope" value="session"/>
</service>
</deployment>
3. code (see samples.jms.JMSTest for details)
SimpleJMSListener listener =
new SimpleJMSListener(connectorMap, cfMap, "SampleQ1",
"Administrator", "Administrator",
false);
listener.start();
Service svc = new Service(clientProvider);
Call call = (Call)svc.createCall();
svc.setMaintainSession(true);
JMSTransport transport = new JMSTransport(connectorMap, cfMap);
call.setTransport(transport);
call.setProperty(JMSConstants.DESTINATION, "SampleQ1");
call.setTimeout(new Integer(10000));
// the 'counter' service is provided by test.session.TestSimpleSession
// deploy it using the server wsdd above
Integer count = (Integer)call.invoke("sessionTest", "counter", null);
assertNotNull("count was null!", count);
assertEquals("count was wrong", 1, count.intValue());
count = (Integer)call.invoke("sessionTest", "counter", null);
assertEquals("count was wrong", 2, count.intValue());
listener.shutdown();
transport.shutdown();
> ----- Original Message -----
> From: Suraj Panicker
> To: [EMAIL PROTECTED]
> Sent: Monday, November 04, 2002 4:32 AM
> Subject: Axis over JMS session management
>
>
> Hello friends,
>
> I've implemented a webservice which works fine with Axis over Http. Now, I tried
>shifting the transport
> layer to JMS. It works fine during the first invocation. But, for all the later
>invocations, I find that the
> AxisServer interprets my request as being from a new session, and thus, the service
>works as if it were
> a new request.
>
> Doesn't session management over multiple request/response work with Axis over JMS.
>
> I used "call.setMaintainSession(true)", at the client side, and also included the
>parameter "scope =
> session", in the server-config.wsdd, that is used by the AxisServer.
>
> Thanks in advance,
>
> Suraj.