Click here to Skip to main content
11,576,667 members (63,016 online)
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 7: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 Sergey Alexandrovich Kryukov 271
1 F-ES Sitecore 140
2 Abhinav S 135
3 Lucifier Rocks 105
4 Dave Kreskowiak 80
0 OriginalGriff 705
1 Sergey Alexandrovich Kryukov 626
2 Abhinav S 483
3 F-ES Sitecore 410
4 Suvendu Shekhar Giri 365


Advertise | Privacy | Mobile
Web04 | 2.8.150603.1 | Last Updated 11 Feb 2013
Copyright © CodeProject, 1999-2015
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