Note that there are some explanatory texts on larger screens.

plurals
  1. POWCF Design questions
    primarykey
    data
    text
    <p>I am designing a WCF service. I am using netTCP binding. The Service could be called from multi-threaded clients. The multi-threaded clients are not sharing the proxy.</p> <p><strong>1. WCF Service design question.</strong></p> <p>Client has to sent these 2 values in every call: UserID and SourceSystemID. This will help the Service to identify the user and the system he belongs. Instead of passing these 2 values in every call, I decided to have them cached with the Service for the duration of call from the client. I decided to have a parameterized constructor for the Service and store these values in the ChannelContext as explained in this article. <a href="http://www.danrigsby.com/blog/index.php/2008/09/21/using-icontextchannel-extensions-to-store-custom-data/" rel="nofollow noreferrer">http://www.danrigsby.com/blog/index.php/2008/09/21/using-icontextchannel-extensions-to-store-custom-data/</a> </p> <p>Initially I wanted to go with storing the values in the Session and have a method for initialization and termination. But there I found that I need to manually clean up the session in each case. When I am storing values in the channel context, I don’t have to clean it up every time and when the channel closes the values stored are already destroyed. Can somebody please make sure that I am correct in my assumption?</p> <p><strong>2. Should I use SessionMode?</strong> For my contract, I used : [ServiceContract(SessionMode = SessionMode.Required)] and without this service attribute.</p> <p>Irrespective of my choice, I am always finding a value for : System.ServiceModel.OperationContext.Current.SessionId How can this be explained?</p> <p>When I say SessionMode.Required, does my InstanceContextMode automatically change to PerSession?</p> <p><strong>3. InstanceContextMode to be used?</strong> My service is stateless except that I am storing some values in the Channel Context as mentioned in (1). Should I use Percall or PerSession as InstanceContextMode?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload