Troubleshoot locking issues while calling multiple methods in a WCF service from Silverlight

I just read this interesting article about calling multiple methods in a WCF service from Silverlight at the same time:

http://weblogs.asp.net/olakarlsson/archive/2010/05/20/simultaneously-calling-multiple-methods-on-a-wcf-service-from-silverlight.aspx

The article says: “It turns out that the problem is based on a combination of Silverlight, Asp.Net and WCF, basically, if you make several calls to the single WCF web service , and you have the Asp.Net session state enabled, calls will be made sequentially by the service, therefore any long calls will block subsequent ones. "

I assume that blocking is a problem only if you make several calls to the same service , and that two simultaneous calls to two different methods for two different services should not lead to one blocking of the other?

A suggested solution to the problem in SL3 involves using the following syntax in the Application_Startup method:

WebRequest.RegisterPrefix ("http: //", WebRequestCreator.ClientHttp);

Then, session state should be maintained in WCF calls by setting up a cookie container and passing it to all your proxies (see http://forums.silverlight.net/forums/p/174322/393032.aspx )

Is this another recommended solution in Silverlight 4? Has anyone used an alternative approach?

+3
2

ASP.Net , ( , ).

, ASP.Net (, js, css ..), ASP. Net, IIS . ASP.Net(, ), , .

, WCF, , , , , , .

ASP.Net "" . WCF ( ), . ASP.Net( )

, , instancing reentrancy . , , concurrency, . , (InstanceContextMode.Single) (ConcurrencyMode.Single), .

. doco:

  • WCF ASP.Net, ()
  • WCF , [AspNetCompatibilityRequirements]
  • , , .

Wenlong Dong

, , , AspNetCompatibilityRequirementsMode.NotAllowed, ASP.Net. , , ASP.Net( , , ASP.Net, WCF, , ).

+3

.NET 4 Application_BeginRequest

if (Context.Request.Path.EndsWith("xxx.svc"))
   Context.SetSessionStateBehavior(SessionStateBehavior.Disabled);
+3

Source: https://habr.com/ru/post/1754355/


All Articles