[
https://issues.apache.org/jira/browse/AXIS2-2803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12504368
]
anil chukkapalli commented on AXIS2-2803:
-----------------------------------------
I think both forms of access should be provided. If we have one method that
takes care of session management it will be great for beginners and for
advanced users they can already use Operation Client. Ideally once the
generated stubs setManageSession property is set to true it should
automatically maintain session, the issue is that in .NET session between web
services in versions .NET 1.0, 2.0, 3.0 and 3.5(soon to be released) this is
done only by using Cookies. The below code worked for me
" serviceClient = new ServiceClient();
opClient =
serviceClient.createClient(ServiceClient.ANON_OUT_IN_OP);
outMsgCtx = new MessageContext();
opts = outMsgCtx.getOptions();
opts.setTo(new
EndpointReference("http://localhost/vccws2/cvccws.asmx"));
opts.setAction("http://tempuri.org/OpenDB");
opts.setTransportInProtocol(Constants.TRANSPORT_HTTP);
opts.setTimeOutInMilliSeconds(300000);
opts.setProperty(HTTPConstants.REUSE_HTTP_CLIENT, new
Boolean(true));
opts.setProperty(Constants.Configuration.ENABLE_MTOM,
Constants.VALUE_TRUE);
opts.setManageSession(true);
outMsgCtx.setEnvelope(createOpenDBEnvelope());
opClient.addMessageContext(outMsgCtx);
opClient.execute(true);
"
This code snippet below did not work for me
"
// Enabling sessions in the stub using Axis2
ServiceClient client = new ServiceClient();
client.getOptions().setManageSession(true);
serviceClient = cvccwsStub._getServiceClient();
serviceClient.getOptions().setManageSession(true);
// Enable MTOM in the client side
cvccwsStub._getServiceClient().getOptions().setProperty(
Constants.Configuration.ENABLE_MTOM,
Constants.VALUE_TRUE);
// Increase the time out when sending large attachments
cvccwsStub._getServiceClient().getOptions()
.setTimeOutInMilliSeconds(10000);
"
I think internally the generated stub should do something similar to mechanism
that i used with operation client. I did not go through the code for creating
the generated stub as yet, for me to pinpoint the problem.
> Generated stub unable to Maintain session between .NET server and Axis2 Client
> ------------------------------------------------------------------------------
>
> Key: AXIS2-2803
> URL: https://issues.apache.org/jira/browse/AXIS2-2803
> Project: Axis 2.0 (Axis2)
> Issue Type: Bug
> Environment: Intel Pentium4 3.16ghz with HT, WinXP progessional
> Reporter: anil chukkapalli
>
> Stub generated using Axis2 is unable to Maintain session between .NET service
> and Axis2 Client. The get around to this problem was using operation client
> instead of using setManageSession(true). Axis2 users mailing list has the
> entire discussion in the thread "Axis2 Manage Session Cookie Manually".
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]