我们使用Silverlight SDK来生成WCF代理(slsvcutil.exe)
如何将与结果类的连接/响应超时设置为不同的级别?
注意:我们在MonoTouch.NET上使用iPhone,所以没有app.config。所有设置都必须用代码完成。
发布于 2011-03-31 07:45:17
您是否创建了自己的绑定和端点地址,然后使用这些地址集成客户端?一个简单的例子(其中包括一个超时选项):
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);请注意,您在代码中定义的绑定应该与定义web服务的app.config的绑定相同。
https://stackoverflow.com/questions/5494621
复制相似问题