1

We use the Silverlight SDK to generate our WCF proxies (slsvcutil.exe)

How do we set the connection/response timeout with the resulting class to a different level?

Note: We're using MonoTouch.NET on an iPhone so there is no app.config. All settings must be done in code.

Ian Vink
  • 66,960
  • 104
  • 341
  • 555

1 Answers1

3

Do you create your own binding and endpoint address then intstaniate the client using those? A simple example (Which includes a timeout option):

BasicHttpBinding binding = new BasicHttpBinding();
binding.OpenTimeout = new TimeSpan(0, 0, 10);
binding.CloseTimeout = new TimeSpan(0, 0, 10);
binding.SendTimeout = new TimeSpan(0, 0, 30);
// more attributes for the binding

EndpointAddress endpointAddress = new EndpointAddress("https://mywcfserver.com/WCFService.svc");
ClientProxy client = new ClientProxy(binding, endpointAddress);

just to note, the bindings you define in the code, should be the same as the binding definited the web service's app.config.

Luke
  • 3,665
  • 1
  • 19
  • 39