rest - RESTful WCF call is blocked until previous call is complete -
i've got simple wcf restful service being hosted in iis. call wcf using browser. call service simultaneously using different tabs in browser. below code service
[servicecontract] public interface iwcfservice { [operationcontract] [webget(uritemplate = "dowork", responseformat = webmessageformat.json)] string dowork(); } public class wcfservice : iwcfservice { public string dowork() { string ret = "enter time " + system.datetime.now + " " + system.datetime.now.millisecond; system.threading.thread.sleep(10000); ret += ". exiting time " + system.datetime.now + " " + system.datetime.now.millisecond; return ret; } }
and below web.config file
<?xml version="1.0" encoding="utf-8" ?> <configuration> <system.servicemodel> <behaviors> <servicebehaviors> <behavior name="wcfservice.wcfservicebehavior"> <servicemetadata httpgetenabled="true" /> <servicedebug includeexceptiondetailinfaults="false" /> </behavior> </servicebehaviors> <endpointbehaviors> <behavior name="wcfservice.wcfservicebehavior"> <webhttp/> </behavior> </endpointbehaviors> </behaviors> <services> <service behaviorconfiguration="wcfservice.wcfservicebehavior" name="wcfservice.wcfservice"> <endpoint address="" binding="webhttpbinding" contract="wcfservice.iwcfservice" behaviorconfiguration="wcfservice.wcfservicebehavior"> </endpoint> <endpoint address="mex" binding="mexhttpbinding" contract="imetadataexchange" /> </service> </services> </system.servicemodel> </configuration>
even though enter address in quick successions end time of first beginning time of second eg output of 1 page is
- enter time 12/05/2015 4:55:24 pm 568.
- exiting time 12/05/2015 4:55:34 pm 569.
then next page
- enter time 12/05/2015 4:55:34 pm 578.
- exiting time 12/05/2015 4:55:44 pm 579.
what causing , how can fix calls processed arrive?
i'm not sure can try set concurrencymode on multiple servicebehavior attribute on implementing class
[servicebehavior(concurrencymode = concurrencymode.multiple)] public class wcfservice : iwcfservice
Comments
Post a Comment