You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Stadelmann Josef <jo...@axa-winterthur.ch> on 2010/03/01 09:32:34 UTC
AW: Multiple classes
I confirm - scope="SOAPSESSION" in conjunction with Service Groups
allows to identify the same instance of an object using it's
ServicegroupdID
We uses to map a users-clients-thread to reach always the same
per-session-thread-object which is a place-holder to communicate by IPC
with a per session-thread legacy-system-process.
And we have long lasting user/client-session-threads, and each user can
have up to a maximum allowed long-lasting-user-sessions-threads which
reach each it's own Open-VMS-legacy-system-process.
Josef.Stadelmann
@axa-winterthur.ch
Von: David Hesson [mailto:dhesson@rjlg.com]
Gesendet: Freitag, 26. Februar 2010 14:18
An: java-user@axis.apache.org
Betreff: RE: Multiple classes
Maybe try "soapsession" instead of "transportsession"
Seems like transport session should work though.
Have a look here:
http://wso2.org/library/articles/axis2-session-management-part-2
<http://wso2.org/library/articles/axis2-session-management-part-2>
________________________________
From: jamie [mailto:jamieb@fastmail.fm]
Sent: Fri 2/26/2010 7:16 AM
To: Vincent FINET
Cc: java-user@axis.apache.org
Subject: Re: Multiple classes
Hi Everyone
Thanks for your suggestions regarding multiple classes. I've decided to
use multiple web services for each section of the API, however, I cannot
get services within the servicegroup to
share properties.
In the Test web service that controls the login. Once the user has
logged in successfully, I call the newSession object that sets the
Config object to a property.
private void newSession() throws AxisFault {
if(mc!=null) {
ServiceGroupContext sgc = mc.getServiceGroupContext();
if (sgc != null) {
sgc.setProperty("config", config);
}
}
}
In the services.xml, I set the scope of each of the services to
"transportsession":
<service name="Test2" scope="transportsession">
<Description>
MailArchiva search API
</Description>
<messageReceivers>
<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"
class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver" />
<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"
class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
</messageReceivers>
<parameter name="ServiceClass"
locked="false">com.test.Test2</parameter>
</service>
<service name="Test1" scope="transportsession">
<Description>
Test API
</Description>
<messageReceivers>
<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"
class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver" />
<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"
class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
</messageReceivers>
<parameter name="ServiceClass"
locked="false">com.test.Test1</parameter>
</service>
In the Test2 service implementation, I have a getConfig() object which
is called by each of the methods to set the internal application
configuration object
private Config getConfig() throws AxisFault {
MessageContext mc = MessageContext.getCurrentMessageContext();
if(mc.getServiceGroupContext()!=null) {
Config config =
(Config)mc.getServiceGroupContext().getProperty("config");
if (config!=null) {
return config;
}
}
throw new AxisFault("not logged in");
}
When the web service client calls the above, getProperty("config")
always returns null. Thus,
there is no sharing taking place.
In the web service client, I do the following:
test1Stub = new Test1Stub(url+"/MailArchiva");
test1Stub._getServiceClient().getOptions().setManageSession(true);
Am I missing something important here? Anyone know why the session is
not applied across all servicegroups?
Thanks
Jamie