Re: Session Managment using .net client..

2009-06-23 Thread robert lazarski
On Mon, Jun 22, 2009 at 9:29 PM, Deepal Jayasinghe dee...@opensource.lkwrote:

 The only way you can get session working with .Net is using transport
 session, that is by using cookies.In addition to that .Net does not send
 the cookies as JSESSION_ID you need to do a an additional step in the
 service client.
 Try setting following property and see;

 http://wso2.org/library/3464

 Thanks,
 Deepal


Several years ago I implemented a custom design for .net session handling,
which exchanged a UUID since both java and .net support them. On the Java
side I used ehcache to maintain the state. Its pretty simple really. You can
see the code here (article is in portuguese - just search on UUID for the
code. The var names and code comments are in english) :

http://braziloutsource.com/wss2.html

HTH,
Robert


RE: Session Managment using .net client..

2009-06-22 Thread Raghu Upadhyayula
HI Amardeep,

 

Here is how you do it in C#.net

 

string url =
http://hostname/webservices/services/MyWSService;;

stub.CookieContainer = new CookieContainer();

stub.Timeout = 1000 * 60 * 60;

stub.Url = url;

 

Thanks

Raghu

 

From: amardeep singh khera [mailto:amardeepsinghkh...@gmail.com] 
Sent: Monday, June 22, 2009 4:00 AM
To: axis-user@ws.apache.org
Subject: Session Managment using .net client..

 

Hi All,

 

I am facing an issue with managing session between  an axis2 java
service and C#.net console client. I am able to manage session between
the same axis2 java service and java client(axis client) by using
following code in my java  client:

 

Service Client client = stub._getServiceClient();

  Options opt = client.getOptions();

  opt.setTimeOutInMilliSeconds(60);

  opt.setManageSession(true);

  client.setOptions(opt);

 

And in my service implementation class I store user details into axis
session using following code

 

MessageContext msgContext = MessageContext.getCurrentMessageContext();

ServiceContext serviceContext =
msgContext.getServiceContext();

serviceContext.setProperty(ROLE_ID, roleId.toString());

serviceContext.setProperty(AUTHENTICATION_STATUS,

authenticationStatus);

serviceContext.setProperty(USER_ID, userId);

msgContext.setServiceContext(serviceContext);

 

This is all working fine for me as long as I am using java client. 

 

Now my other requirement is to develop a C# .net console client for the
same service. So I have generated the proxy class using Microsoft visual
studio from wsdl and written C#.net console client which is working
fine. But now I want to implement session management in a similar way as
I am able to do so in java client. Can anyone please suggest me a way to
do so.

 

Thanks

Amardeep Singh



RE: Session Managment using .net client..

2009-06-22 Thread Martin Gainty

how is stub created?
   
string url = http://hostname/webservices/services/MyWSService;;

   
stub.CookieContainer = new CookieContainer();

   
stub.Timeout = 1000 * 60 * 60;

   
stub.Url = url;thanks,
Martin 
__ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.




Subject: RE: Session Managment using .net client..
Date: Mon, 22 Jun 2009 06:49:21 -0700
From: rupadhyay...@responsys.com
To: axis-user@ws.apache.org
















HI Amardeep,

 

Here
is how you do it in C#.net

 

   
string url = http://hostname/webservices/services/MyWSService;;

   
stub.CookieContainer = new CookieContainer();

   
stub.Timeout = 1000 * 60 * 60;

   
stub.Url = url;

 

Thanks

Raghu

 



From: amardeep singh
khera [mailto:amardeepsinghkh...@gmail.com] 

Sent: Monday, June 22, 2009 4:00 AM

To: axis-user@ws.apache.org

Subject: Session Managment using .net client..



 

Hi All,

 

I am facing
an issue with managing session between  an axis2 java service and C#.net
console client. I am able to manage session between the same axis2 java service
and java client(axis client) by using following code in my java  client:

 

Service Client client = stub._getServiceClient();

  Options
opt = client.getOptions();

  opt.setTimeOutInMilliSeconds(60);

  opt.setManageSession(true);

  client.setOptions(opt);

 

And in my service implementation class I store user details into
axis session using following code

 

MessageContext msgContext = MessageContext.getCurrentMessageContext();

ServiceContext
serviceContext = msgContext.getServiceContext();

serviceContext.setProperty(ROLE_ID,
roleId.toString());

serviceContext.setProperty(AUTHENTICATION_STATUS,

authenticationStatus);

serviceContext.setProperty(USER_ID, userId);

msgContext.setServiceContext(serviceContext);

 

This is all working fine for me as long as I am using java client.


 



Now my other
requirement is to develop a C# .net console client for the same service. So I
have generated the proxy class using Microsoft visual studio from wsdl and
written C#.net console client which is working fine. But now I want to
implement session management in a similar way as I am able to do so in java
client. Can anyone please suggest me a way to do so.





 





Thanks





Amardeep
Singh




_
Insert movie times and more without leaving Hotmail®.
http://windowslive.com/Tutorial/Hotmail/QuickAdd?ocid=TXT_TAGLM_WL_HM_Tutorial_QuickAdd_062009

Re: Session Managment using .net client..

2009-06-22 Thread amardeep singh khera
Thanks Guys I got it working...

And stub is reference to my proxy class ...

Thanks
Amardeep Singh

On Mon, Jun 22, 2009 at 7:45 PM, Martin Gainty mgai...@hotmail.com wrote:

  how is stub created?

 string url = 
 http://hostname/webservices/services/MyWSService;;

 stub.CookieContainer = new CookieContainer();

 stub.Timeout = 1000 * 60 * 60;

 stub.Url = url;
 thanks,
 Martin
 __
 Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

 Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
 Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
 Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
 dient lediglich dem Austausch von Informationen und entfaltet keine
 rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
 E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.

 Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
 destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
 l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci 
 est interdite. Ce message sert à l'information seulement et n'aura pas 
 n'importe quel effet légalement obligatoire. Étant donné que les email 
 peuvent facilement être sujets à la manipulation, nous ne pouvons accepter 
 aucune responsabilité pour le contenu fourni.






 --
 Subject: RE: Session Managment using .net client..
 Date: Mon, 22 Jun 2009 06:49:21 -0700
 From: rupadhyay...@responsys.com

 To: axis-user@ws.apache.org

  HI Amardeep,



 Here is how you do it in C#.net



 string url = 
 http://hostname/webservices/services/MyWSService;;

 stub.CookieContainer = new CookieContainer();

 stub.Timeout = 1000 * 60 * 60;

 stub.Url = url;



 Thanks

 Raghu



 *From:* amardeep singh khera [mailto:amardeepsinghkh...@gmail.com]
 *Sent:* Monday, June 22, 2009 4:00 AM
 *To:* axis-user@ws.apache.org
 *Subject:* Session Managment using .net client..



 Hi All,



 I am facing an issue with managing session between  an axis2 java service
 and C#.net console client. I am able to manage session between the same
 axis2 java service and java client(axis client) by using following code in
 my java  client:



 Service Client client = stub._getServiceClient();

   Options opt = client.getOptions();

   opt.setTimeOutInMilliSeconds(60);

   opt.setManageSession(true);

   client.setOptions(opt);



 And in my service implementation class I store user details into axis
 session using following code



 MessageContext msgContext = MessageContext.*getCurrentMessageContext*();

 ServiceContext serviceContext = msgContext.getServiceContext();

 serviceContext.setProperty(ROLE_ID, roleId.toString());

 serviceContext.setProperty(AUTHENTICATION_STATUS,

 authenticationStatus);

 serviceContext.setProperty(USER_ID, userId);

 msgContext.setServiceContext(serviceContext);



 This is all working fine for me as long as I am using java client.



 Now my other requirement is to develop a C# .net console client for the
 same service. So I have generated the proxy class using Microsoft visual
 studio from wsdl and written C#.net console client which is working fine.
 But now I want to implement session management in a similar way as I am able
 to do so in java client. Can anyone please suggest me a way to do so.



 Thanks

 Amardeep Singh

 --
 Insert movie times and more without leaving Hotmail®. See 
 how.http://windowslive.com/Tutorial/Hotmail/QuickAdd?ocid=TXT_TAGLM_WL_HM_Tutorial_QuickAdd_062009



RE: Session Managment using .net client..

2009-06-22 Thread Raghu Upadhyayula
MyWSService stub = new MyWSWSService();

 

From: Martin Gainty [mailto:mgai...@hotmail.com] 
Sent: Monday, June 22, 2009 9:15 AM
To: axis-user@ws.apache.org
Subject: RE: Session Managment using .net client..

 

how is stub created?

string url = http://hostname/webservices/services/MyWSService;;

stub.CookieContainer = new CookieContainer();

stub.Timeout = 1000 * 60 * 60;

stub.Url = url;

thanks,
Martin 
__ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.

Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.









Subject: RE: Session Managment using .net client..
Date: Mon, 22 Jun 2009 06:49:21 -0700
From: rupadhyay...@responsys.com
To: axis-user@ws.apache.org

HI Amardeep,

 

Here is how you do it in C#.net

 

string url = http://hostname/webservices/services/MyWSService;;

stub.CookieContainer = new CookieContainer();

stub.Timeout = 1000 * 60 * 60;

stub.Url = url;

 

Thanks

Raghu

 

From: amardeep singh khera [mailto:amardeepsinghkh...@gmail.com] 
Sent: Monday, June 22, 2009 4:00 AM
To: axis-user@ws.apache.org
Subject: Session Managment using .net client..

 

Hi All,

 

I am facing an issue with managing session between  an axis2 java service and 
C#.net console client. I am able to manage session between the same axis2 java 
service and java client(axis client) by using following code in my java  client:

 

Service Client client = stub._getServiceClient();

  Options opt = client.getOptions();

  opt.setTimeOutInMilliSeconds(60);

  opt.setManageSession(true);

  client.setOptions(opt);

 

And in my service implementation class I store user details into axis session 
using following code

 

MessageContext msgContext = MessageContext.getCurrentMessageContext();

ServiceContext serviceContext = msgContext.getServiceContext();

serviceContext.setProperty(ROLE_ID, roleId.toString());

serviceContext.setProperty(AUTHENTICATION_STATUS,

authenticationStatus);

serviceContext.setProperty(USER_ID, userId);

msgContext.setServiceContext(serviceContext);

 

This is all working fine for me as long as I am using java client. 

 

Now my other requirement is to develop a C# .net console client for the same 
service. So I have generated the proxy class using Microsoft visual studio from 
wsdl and written C#.net console client which is working fine. But now I want to 
implement session management in a similar way as I am able to do so in java 
client. Can anyone please suggest me a way to do so.

 

Thanks

Amardeep Singh

 



Insert movie times and more without leaving Hotmail®. See how. 
http://windowslive.com/Tutorial/Hotmail/QuickAdd?ocid=TXT_TAGLM_WL_HM_Tutorial_QuickAdd_062009
 



Re: Session Managment using .net client..

2009-06-22 Thread Deepal Jayasinghe
The only way you can get session working with .Net is using transport
session, that is by using cookies.In addition to that .Net does not send
the cookies as JSESSION_ID you need to do a an additional step in the
service client.
Try setting following property and see;

http://wso2.org/library/3464

Thanks,
Deepal

 Hi All,

  

 I am facing an issue with managing session between  an axis2 java
 service and C#.net console client. I am able to manage session between
 the same axis2 java service and java client(axis client) by using
 following code in my java  client:

  

 Service Client client = stub._getServiceClient();

   Options opt = client.getOptions();

   opt.setTimeOutInMilliSeconds(60);

   opt.setManageSession(true);

   client.setOptions(opt);

  

 And in my service implementation class I store user details into axis
 session using following code

  

 MessageContext msgContext = MessageContext./getCurrentMessageContext/();

 ServiceContext serviceContext =
 msgContext.getServiceContext();

 serviceContext.setProperty(ROLE_ID, roleId.toString());

 serviceContext.setProperty(AUTHENTICATION_STATUS,

 authenticationStatus);

 serviceContext.setProperty(USER_ID, userId);

 msgContext.setServiceContext(serviceContext);

  

 This is all working fine for me as long as I am using java client.

  

 Now my other requirement is to develop a C# .net console client for
 the same service. So I have generated the proxy class using Microsoft
 visual studio from wsdl and written C#.net console client which is
 working fine. But now I want to implement session management in a
 similar way as I am able to do so in java client. Can anyone please
 suggest me a way to do so.
  
 Thanks
 Amardeep Singh

-- 
Thank you!


http://blogs.deepal.org
http://deepal.org