Ask a questionAsk a question
 

AnswerWCF3.5

  • Wednesday, November 04, 2009 8:47 AMRajesh C Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    In case of remoting i can configure singleton, singlecall in config file

    In case of WCf we are using attribute
     [ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Single, InstanceContextMode = InstanceContextMode.PerCall)]
    So if there needs a change i have to open the code and change it, is there a way to do it in config.

    I am new to WCF

Answers

  • Wednesday, November 04, 2009 12:16 PMMahesh Sabnis Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Hi,

       You can manage no of sessions, instances and calls using App.Config file, but cannot change service behaviors values. There may be reason that these service behaviors drives the communication between client application ans WCF service that's why not given in app.config.

    But I will try to check it.

    Mahesh Sabnis 

All Replies

  • Wednesday, November 04, 2009 9:14 AMWaldemar Huber Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    There is no way to change it in code. I would wonder if there is one.

    Btw, ConcurrencyMode.Single and InstanceContextMode.PerCall makes not much sense because you get a new service object with each client call and then this object dies, so there are no other clients who would make some threading problems.
  • Wednesday, November 04, 2009 9:40 AMRajesh C Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi Huber

       Thanks for your reply..

      But my question is suppose
     I have configured as Singleton in WCF([ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Single, InstanceContextMode =  
              InstanceContextMode.Single)]) and deployed in clinet. Due some reason i want to change the behavior to SingleCall.

    In case of Remoting i will do in app.config so no need to rebuild the code. I want to do the same in WCF (Move the attribute to Configuration file)

    Please through some light on it.....
  • Wednesday, November 04, 2009 12:16 PMMahesh Sabnis Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Hi,

       You can manage no of sessions, instances and calls using App.Config file, but cannot change service behaviors values. There may be reason that these service behaviors drives the communication between client application ans WCF service that's why not given in app.config.

    But I will try to check it.

    Mahesh Sabnis