Questions tagged [instancecontextmode]

31 questions
13
votes
3 answers

Setting WCF InstanceContextMode (Per Call, Single) in web.confg

Haven't come across this one with quite a bit of Googling. I know I can set the instance by decorating the class name thus: [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall, ConcurrencyMode =…
wcfhopeful
  • 131
  • 1
  • 1
  • 3
4
votes
1 answer

What is the lifetime of an AppDomain in WCF?

What is the lifetime of an AppDomain in WCF? Does it relate to InstanceContextMode, ConcurrencyMode and/or AspNetCompatibilityRequirements RequirementsMode? I'm looking to know how long my static variables will be around and how often they'll have…
SGarratt
  • 984
  • 1
  • 8
  • 22
4
votes
3 answers

PerCall InstanceContextMode behaviour of WCF service

I have a WCF service, exposing a ServiceContract with basicHttpBinding, so from my understanding InstanceContextMode will be set to PerCall (as basicHttpBinding doesn't support sessions) and ConcurrenyMode will be set to Single. The client of this…
CSharped
  • 1,247
  • 4
  • 20
  • 49
3
votes
1 answer

How many instances exists when a InstanceContextMode.Single WCF service exposes multiple endpoints?

Does the ServiceBehavior setting InstanceContextMode.Single sets a single instance regardless of the number of endpoints?
Jader Dias
  • 88,211
  • 155
  • 421
  • 625
3
votes
1 answer

InstanceContextMode.Single in WCF wsHttpBinding,webHttpBinding and REST

I have recently started development on a relatively simple WCF REST service which returns JSON formatted results. At first everything worked great, and the service was quickly up and running. The main function of the service is to return a large…
Chris
  • 31
  • 1
2
votes
1 answer

WCF InstanceContextMode

I have a web application uses a proxy to invoke an operation on a WCF Service that returns data from an AS400, like the different Sales Regions associated with our companies, the different stores we have out in the field, etc. These Sales regions…
Ta01
  • 31,040
  • 13
  • 70
  • 99
2
votes
2 answers

How do I configure a WCF service to run with PerCall instance context?

Here's the background info. I have a WCF service configured like so [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)] Now I need some help understanding exactly how this context mode works. Here's the problem I'm dealing with.…
Matt
  • 6,264
  • 10
  • 54
  • 82
2
votes
1 answer

is InstanceContextMode.Single available for WCF basicHttpBinding?

As I understand from this article: Single: This will help us to share the data globally. We can create only one instance and the same instance will be reused on the subsequent calls. Same like Per Session this will work with all bindings…
Alexan
  • 8,165
  • 14
  • 74
  • 101
2
votes
2 answers

How to make WCF Service take only one call at a time

We have a WCF service like Public Class MyService { [OperationContract] Public void OpperationA() { } [OperationContract] Public void OpperationB() { } [OperationContract] Public void OpperationC() { } [OperationContract] …
CSharped
  • 1,247
  • 4
  • 20
  • 49
1
vote
2 answers

How IIS control WCF lifetime service wiith InstanceContextmode set to single?

I developed WCF service with InstanceContextmode set to single and hosted by IIS. Periodically, the service is probably restarted by IIS. How can we adjust the way IIS manages the lifetime of this service in singleinstance mode?
stovpc
  • 11
  • 1
1
vote
1 answer

Managing a Linq to SQL Datacontext in a WCF service using a DataContextFactory

I've been using Rick Strahl's DataContextFactory code (Linq to SQL DataContext Lifetime Management) in a data layer consumed by an ASP.Net application. It works great because the current datacontext is stored in the HttpContext.Items collection. I…
Jason Butera
  • 2,376
  • 3
  • 29
  • 46
1
vote
0 answers

WCF callback in new instance c#

ive been working on a launcher using wcf to communicate with a server to kick users off when an update is needed. so far its all working except for when there is a chain of functions from clients to server and back to clients, it SEEMS like the…
1
vote
0 answers

What is the default InstanceContextMode for a WCF service (using BasicHttpBinding) under Mono?

After bringing my code to Mono 3.2.8, I had a surprise to see that the behavior of my service was always created like using InstanceContextMode.Single. Same on Mono 3.12.1. To be more clear, my service is not marked with any InstanceContextMode…
Learner
  • 3,297
  • 4
  • 37
  • 62
1
vote
0 answers

Why is my sessionful,NetTcpBinding, Streaming service instance not retaining session state?

I am trying to figure out why my NetTcpBinding Service is not maintaining state, as expected. (Perhaps I did it wrong) I have a WCF service with the following structure(simplified): Message Contract [MessageContract] public class…
tinonetic
  • 7,751
  • 11
  • 54
  • 79
1
vote
2 answers

Check if a async call to service is still alive

I have an async service The service contract defined like: [ServiceBehavior(InstanceContextMode = InstanceContext.PerCall] Myservice My client is defined like: MyServiceClient task= null; InstanceContext instanceContext = new…
KfirZuberi
  • 51
  • 7
1
2 3