What is the best workaround for the WCF client `using` block issue?

Actually, although I blogged (see Luke’s answer), I think this is better than my IDisposable wrapper. Typical code: Service<IOrderService>.Use(orderService=> { orderService.PlaceOrder(request); }); (edit per comments) Since Use returns void, the easiest way to handle return values is via a captured variable: int newOrderId = 0; // need a value for definite assignment Service<IOrderService>.Use(orderService=> { newOrderId … Read more

REST / SOAP endpoints for a WCF service

You can expose the service in two different endpoints. the SOAP one can use the binding that support SOAP e.g. basicHttpBinding, the RESTful one can use the webHttpBinding. I assume your REST service will be in JSON, in that case, you need to configure the two endpoints with the following behaviour configuration <endpointBehaviors> <behavior name=”jsonBehavior”> … Read more

WCF – How to Increase Message Size Quota

You’ll want something like this to increase the message size quotas, in the App.config or Web.config file: <bindings> <basicHttpBinding> <binding name=”basicHttp” allowCookies=”true” maxReceivedMessageSize=”20000000″ maxBufferSize=”20000000″ maxBufferPoolSize=”20000000″> <readerQuotas maxDepth=”32″ maxArrayLength=”200000000″ maxStringContentLength=”200000000″/> </binding> </basicHttpBinding> </bindings> And use the binding name in your endpoint configuration e.g. … bindingConfiguration=”basicHttp” … The justification for the values is simple, they are sufficiently … Read more

Best Practices for securing a REST API / web service [closed]

As tweakt said, Amazon S3 is a good model to work with. Their request signatures do have some features (such as incorporating a timestamp) that help guard against both accidental and malicious request replaying. The nice thing about HTTP Basic is that virtually all HTTP libraries support it. You will, of course, need to require … Read more

Collection was modified; enumeration operation may not execute

What’s likely happening is that SignalData is indirectly changing the subscribers dictionary under the hood during the loop and leading to that message. You can verify this by changing foreach(Subscriber s in subscribers.Values) To foreach(Subscriber s in subscribers.Values.ToList()) If I’m right, the problem will disappear. Calling subscribers.Values.ToList() copies the values of subscribers.Values to a separate … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)