stub1 = new
MultiPortTypes1Stub("http://localhost:8080/axis2/services/MultiPortTypes
1");
stub1._getServiceClient().getOptions().setProperty(org.apache.axis2.tran
sport.http.HTTPConstants.REUSE_HTTP_CLIENT,new Boolean(true));
stub1._getServiceClient().getOptions().setProperty(org.apache.axis2.tran
sport.http.HTTPConstants.SO_TIMEOUT /* CONNECTION_TIMEOUT */,new
Integer("7200000")); // 2hr for now.
stub1._getServiceClient().getOptions().setTimeOutInMilliSeconds(7200000L
);
stub1._getServiceClient().getOptions().setManageSession(true);
stub2 = new
MultiPortTypes2Stub("http://localhost:8080/axis2/services/MultiPortTypes
2");
stub2._getServiceClient().getOptions().setProperty(org.apache.axis2.tran
sport.http.HTTPConstants.REUSE_HTTP_CLIENT,new Boolean(true));
stub2._getServiceClient().getOptions().setProperty(org.apache.axis2.tran
sport.http.HTTPConstants.SO_TIMEOUT /* CONNECTION_TIMEOUT */,new
Integer("7200000")); // 2hr for now.
stub2._getServiceClient().getOptions().setTimeOutInMilliSeconds(7200000L
);
stub2._getServiceClient().getOptions().setManageSession(true);
The browser is returning some "XML Parsing error" not only for this
service but all other services as well.
Is something wrong with the axis installation?
Thanks,
Subhro.
________________________________
From: keith chapman [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 08, 2008 1:15 PM
To: [email protected]
Subject: Re: Sharing data among services in same service group.
How is your client implemented? as I said before transport sessions uses
the HTTPSession to maintain state. So unless your client is using the
same HTTPSessions this will not work. Try invoking the two services via
a browser.
Thanks,
Keith.
On Thu, May 8, 2008 at 12:21 PM, Subhro Moitra (smoitra)
<[EMAIL PROTECTED]> wrote:
Thanks Keith For replying.
I did what you said. Both the scopes are "transportsession".
But still the stub2.newOperation1() call is returning null.
Please help!!
Thanks,
Subhro.
________________________________
From: keith chapman [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 07, 2008 8:54 PM
To: [email protected]
Subject: Re: Sharing data among services in same service group.
Hi,
I think the problem here is that the two services are in two
scopes. When transport session is used its the underlying transport that
depends how the session is managed. For e.g when http is used the
HTTPSession is used to manage the session. Can you try deploying both
services on the same scope, then this should work.
Thanks,
Keith.
On Wed, May 7, 2008 at 7:18 PM, Subhro Moitra (smoitra)
<[EMAIL PROTECTED]> wrote:
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.
--
Keith Chapman
Senior Software Engineer
WSO2 Inc.
Oxygenating the Web Service Platform.
http://wso2.org/
blog: http://www.keith-chapman.org
--
Keith Chapman
Senior Software Engineer
WSO2 Inc.
Oxygenating the Web Service Platform.
http://wso2.org/
blog: http://www.keith-chapman.org