axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Subhro Moitra (smoitra)" <smoi...@cisco.com>
Subject Sharing data among services in same service group.
Date Wed, 07 May 2008 13:48:12 GMT
 
Hi All,
 
I have the following services.xml
 
<serviceGroup>
    <service name="MultiPortTypes2" scope="application"
class="com.xxxxxxxxxx.yyyy.zzzzz.service.xmlbeans.MultiPortTypes2Skeleto
n">
        <messageReceivers>
            <messageReceiver mep="http://www.w3.org/ns/wsdl/in-out"
class="com.xxxxxxxxxx.yyyy.zzzzz.service.xmlbeans.MultiPortTypes2Message
ReceiverInOut"/>
        </messageReceivers>
        <parameter
name="ServiceClass">com.xxxxxxxxxx.yyyy.zzzzz.service.xmlbeans.MultiPort
Types2Skeleton</parameter>
        <parameter name="ServiceTCCL" locked="false">service</parameter>
    </service>
    <service name="MultiPortTypes1" scope="transportsession"
class="com.xxxxxxxxxx.yyyy.zzzzz.service.xmlbeans.MultiPortTypes1Skeleto
n">
        <messageReceivers>
            <messageReceiver mep="http://www.w3.org/ns/wsdl/in-out"
class="com.xxxxxxxxxx.yyyy.zzzzz.service.xmlbeans.MultiPortTypes1Message
ReceiverInOut"/>
        </messageReceivers>
        <parameter
name="ServiceClass">com.xxxxxxxxxx.yyyy.zzzzz.service.xmlbeans.MultiPort
Types1Skeleton</parameter>
        <parameter name="ServiceTCCL" locked="false">service</parameter>
    </service>
</serviceGroup>
 

How can i share data between "MultiPortTypes1" and "MultiPortTypes2"?
 

In MultiPortTypes1 we have an operation with the below code.
MessageContext mc=MessageContext.getCurrentMessageContext();
     if(mc!=null){
      ServiceGroupContext sgc=mc.getServiceGroupContext();
      if(sgc!=null)sgc.setProperty("sessionId", "100000");
      else System.out.println("\t\t SGC is null cannot set sesionId");
      
      SessionContext sc=mc.getSessionContext();
      if(sc!=null) sc.setProperty("sessionId", "sessiontransport");
      else System.out.println("\t\t session context is null cannot set
sessionId");
      
     }
 
In MultiPortTypes2 we have an operation with the below code:
 
MessageContext mc=MessageContext.getCurrentMessageContext();
     if(mc!=null){
      System.out.println("\t\t MCCtx: "+mc.getProperty("sessionId"));
      ServiceGroupContext sgc=mc.getServiceGroupContext();
      if(sgc!=null) System.out.println(" \t\t ServiceGroupContext:
"+sgc.getProperty("sessionId"));
      else System.out.println("\t\t SGC is null");
      
      SessionContext sc=mc.getSessionContext();
      if(sc!=null) System.out.println("\t\t sessionContext:
"+sc.getProperty("sessionId"));
      else System.out.println("\t\t session context is null cannot set
sessionId");
      
     }
 
The output for "MultiPortTypes2 " is null. Please help.
 
Thanks,
Subhro.

Mime
View raw message