可能看起来像一个愚蠢的问题,但WCF中的所有内容似乎都比asmx复杂得多,我怎样才能增加svc服务的超时?
这是我到目前为止:
<bindings>
<basicHttpBinding>
<binding name="IncreasedTimeout"
openTimeout="12:00:00"
receiveTimeout="12:00:00" closeTimeout="12:00:00"
sendTimeout="12:00:00">
</binding>
</basicHttpBinding>
</bindings>
Run Code Online (Sandbox Code Playgroud)
然后我的端点映射如下:
<endpoint address=""
binding="basicHttpBinding" bindingConfiguration="IncreasedTimeout"
contract="ServiceLibrary.IDownloads">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
Run Code Online (Sandbox Code Playgroud)
我得到的确切错误:
在00:00:59.9990000之后等待回复时,请求通道超时.增加传递给Request的调用的超时值或增加Binding上的SendTimeout值.分配给此操作的时间可能是较长超时的一部分.
在WCF测试客户端中,有一个配置图标,其中包含我的服务的运行时配置:
你可以看到它与我为它设定的值不一样吗?我究竟做错了什么?
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IDownloads" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="">
<extendedProtectionPolicy policyEnforcement="Never" />
</transport>
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
Run Code Online (Sandbox Code Playgroud) 在我注册新的WCF端点时,我不知道URI是什么......
public void Install(IWindsorContainer container, IConfigurationStore store)
{
var defaultClientModel = new DefaultClientModel
{
Endpoint = WcfEndpoint
.ForContract<IMyService>()
.BoundTo(new WSHttpBinding(SecurityMode.None))
.At( URI??? )
};
container.Register(WcfClient.ForChannels(defaultClientModel));
}
Run Code Online (Sandbox Code Playgroud)
有没有什么方法可以在请求IMyService实例时从容器中检索URI(这是在知道的时候)?
是否有工厂方法/动态参数可以使用的东西?