Return-Path: Delivered-To: apmail-axis-java-user-archive@www.apache.org Received: (qmail 37284 invoked from network); 26 Feb 2010 12:17:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 26 Feb 2010 12:17:03 -0000 Received: (qmail 36460 invoked by uid 500); 26 Feb 2010 12:17:01 -0000 Delivered-To: apmail-axis-java-user-archive@axis.apache.org Received: (qmail 36415 invoked by uid 500); 26 Feb 2010 12:17:01 -0000 Mailing-List: contact java-user-help@axis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@axis.apache.org Delivered-To: mailing list java-user@axis.apache.org Received: (qmail 36407 invoked by uid 99); 26 Feb 2010 12:17:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Feb 2010 12:17:01 +0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jamieb@fastmail.fm designates 66.111.4.25 as permitted sender) Received: from [66.111.4.25] (HELO out1.smtp.messagingengine.com) (66.111.4.25) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Feb 2010 12:16:52 +0000 Received: from compute1.internal (compute1.internal [10.202.2.41]) by gateway1.messagingengine.com (Postfix) with ESMTP id 81F9AE1C0E; Fri, 26 Feb 2010 07:16:31 -0500 (EST) Received: from web6.messagingengine.com ([10.202.2.215]) by compute1.internal (MEProxy); Fri, 26 Feb 2010 07:16:31 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=message-id:from:to:cc:mime-version:content-transfer-encoding:content-type:in-reply-to:references:subject:date; s=smtpout; bh=ktcq9HhvtW9Vo6ddCb/7Cq8CXWE=; b=SlX1HdXuBqLL3hYUBcwqqJrjhDD+jDwGwUV3nfVaCKymOk+LpFO4i3G57ysnds7yeniKN3Ym2U4nNKjLPv34vvHTtUbP5vKcie7EDPELegVLfgCqq1YAov32/eopYDHrPOdn0NY4nwwnjD6cVTP7lbe959bUg5y+kXgsWm5qVqA= Received: by web6.messagingengine.com (Postfix, from userid 99) id 623FAA5641; Fri, 26 Feb 2010 07:16:31 -0500 (EST) Message-Id: <1267186591.21213.1362040987@webmail.messagingengine.com> X-Sasl-Enc: gJSuF8SXqalFtOsZwinBFXKuOqdbt4euhPRh3223kLt6 1267186591 From: "jamie" To: "Vincent FINET" Cc: java-user@axis.apache.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: multipart/alternative; boundary="_----------=_1267186591212131" X-Mailer: MessagingEngine.com Webmail Interface In-Reply-To: References: <1267117248.15782.1361891103@webmail.messagingengine.com> Subject: Re: Multiple classes Date: Fri, 26 Feb 2010 14:16:31 +0200 X-Virus-Checked: Checked by ClamAV on apache.org --_----------=_1267186591212131 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii" Date: Fri, 26 Feb 2010 07:16:31 -0500 X-Mailer: MessagingEngine.com Webmail Interface 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": MailArchiva search API com.test.Test2 Test API com.test.Test1 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 --_----------=_1267186591212131 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/html; charset="us-ascii" Date: Fri, 26 Feb 2010 07:16:31 -0500 X-Mailer: MessagingEngine.com Webmail Interface
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
 
--_----------=_1267186591212131--