8,757
社区成员
发帖
与我相关
我的任务
分享
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_Service" maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
</binding>
</basicHttpBinding>
</bindings>
客户端
public static ServiceClient GetServiceClient()
{ //CannelFamily
EndpointAddress address = new EndpointAddress(new Uri(Application.Current.Host.Source, WcfAddress + "Service.svc"));
return new ServiceClient("BasicHttpBinding_Service", address);
}
服务端和客户端使用的契约要一致。var web= new WebClient();
web.OpenReadCompleted += .....
web.OpenReadAsync(new Uri(url))这样简单的代码就能使用json跟服务器交互传递.net业务对象了,何必整什么劳什子的WCF?我们最大时通讯(查询并下载)一个15M的对象(一个地下管网简单shape图层数据),也没有出现过通讯失败的情况。
Dim httpTransportBinding As HttpTransportBindingElement = New HttpTransportBindingElement()
httpTransportBinding.MaxBufferSize = 2147483647
httpTransportBinding.MaxReceivedMessageSize = 2147483647
....