Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
Hi All experts,
 
I am a bit new to WCF. I had explicit requirement to prepare a wcf application with below requiements,
 
1. Need to prepare synchronous WCF service hosted in IIS
2. Client will consume synchronous WCF service.
3. request & response might take long time, as other applications are involved in this process.
4. Need to maintain the state during this long request & response process.
5. Should not use any Workflows
 

So basically, I need to maintain state without lossing/deadlocks during the long synchronous request<->response process.
 
Please share your valuable suggestion.
 
Regards
balu
Posted 11-Feb-13 8:02am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Yeah, requirements like this comes in case of Services which depend on multiple resources.
 
I'd suggest you the following points, implementing which you could achieve your desired result:
1-In ServiceContract use the following SessionMode attribute:
[ServiceContract(SessionMode=SessionMode.Required)]
2-In ServiceBehaviour use PerSession attribute as following:
[ServiceBehaviour(InstanceContextMode=InstanceContextMode.PerSession)]
3-And since you are saying that multiple applications are involved in this Service, so use Reentrant property of Concurrency in ServiceBehaviour as following:
[ServiceBehaviour(ConcurrencyMode=ConcurrencyMode.Reentrant)]
This will help you to avoid any kind of DeadLock.
 
I'm sure if you could use the above properties efficiently then you would surely achieve your desired goal.
 
Regards,
Gittu
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 525
1 Maciej Los 319
2 BillWoodruff 174
3 Suraj Sahoo | Coding Passion 170
4 /\jmot 152
0 OriginalGriff 8,654
1 Sergey Alexandrovich Kryukov 7,407
2 DamithSL 5,639
3 Maciej Los 5,229
4 Manas Bhardwaj 4,986


Advertise | Privacy | Mobile
Web04 | 2.8.1411023.1 | Last Updated 11 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100