【发布时间】:2014-11-05 18:53:38
【问题描述】:
我正在使用basicHttpsbinding 来使用 Web 服务,如下所示
EXCClient CreateClient()
{
var binding = new System.ServiceModel.BasicHttpsBinding();
binding.ReaderQuotas.MaxArrayLength = int.MaxValue;
binding.MaxReceivedMessageSize = int.MaxValue;
binding.UseDefaultWebProxy = false;
var endpoint = new System.ServiceModel.EndpointAddress("https://{siteName}/{service}");
var client = new EXCClient(binding, endpoint);
return client;
//return new EXCClient();
}
消费站点托管在 IIS 7.5 上,并且在服务器上有多个站点。我正在使用 .net 表单站点,调用代码如下所示
var x = service.Client.GetResults({parameter});
运行此服务时会返回结果约 15 分钟,然后开始出现此错误。
向 https://{siteName}/{service}/ 发出 HTTP 请求时出错。这可能是由于在 HTTPS 情况下未使用 HTTP.SYS 正确配置服务器证书。这也可能是由于客户端和服务器之间的安全绑定不匹配造成的
底层连接已关闭:发送时发生意外错误。 ---> System.IO.IOException: 由于意外的数据包格式,握手失败。
如果我回收该站点的应用程序池,该服务会在大约 15 分钟内再次开始返回结果,然后再次开始失败。我的应用程序池没有内存限制。
app.config 看起来像
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_EXC">
<security mode="Transport" />
</binding>
<binding name="BasicHttpBinding_EXC1" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="https://vadrs.tax.utah.gov/vdx/" binding="basicHttpsBinding"
bindingConfiguration="BasicHttpBinding_EXC" contract="UTVehicleServices.EXC"
name="BasicHttpBinding_EXC" />
</client>
【问题讨论】:
标签: c# wcf basichttpbinding