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 230
1 PIEBALDconsult 150
2 DamithSL 125
3 Andreas Gieriet 90
4 Jochen Arndt 90
0 OriginalGriff 5,790
1 DamithSL 4,601
2 Maciej Los 4,012
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,195


Advertise | Privacy | Mobile
Web04 | 2.8.141220.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