C# SOAP WCF Webservice在本地或远程调用时表现不同
我有一个WCFSOAP1.1WebService,配置如下 对该端点的任何方法的并发调用将挂起,直到远程调用(从网络上的另一台计算机)时另一个方法返回为止 当本地调用这些方法时(客户端位于同一台机器上),我无法复制这些方法 我试图增加maxConcurrentCalls,但没有成功。。。根据客户端的本地/远程位置,服务行为似乎有所不同。猜猜看C# SOAP WCF Webservice在本地或远程调用时表现不同,c#,.net,wcf,soap,C#,.net,Wcf,Soap,我有一个WCFSOAP1.1WebService,配置如下 对该端点的任何方法的并发调用将挂起,直到远程调用(从网络上的另一台计算机)时另一个方法返回为止 当本地调用这些方法时(客户端位于同一台机器上),我无法复制这些方法 我试图增加maxConcurrentCalls,但没有成功。。。根据客户端的本地/远程位置,服务行为似乎有所不同。猜猜看 当查看并发调用场景的ServiceModelEndpoint性能计数器时,结果很有趣:远程“未完成调用”达到了2个调用的限制。。。而20个并发线程的本地调
当查看并发调用场景的ServiceModelEndpoint性能计数器时,结果很有趣:远程“未完成调用”达到了2个调用的限制。。。而20个并发线程的本地调用最多可达到18个“未完成的调用”! 2个“远程”调用的限制似乎是“每个进程” 谢谢
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.serviceModel>
<services>
<service behaviorConfiguration="MyCustomBehavior" name="CONTOSO.CONTOSOServerApi.IContosoServiceApiImplV1">
<endpoint address="" binding="customBinding" bindingConfiguration="WebBinding"
bindingNamespace="http://contoso.com" contract="CONTOSO.CONTOSOServerApiInterfaceV1.IContosoServiceApiV1" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="MyCustomBehavior">
<serviceMetadata httpGetEnabled="true" httpGetUrl="http://localhost:8080/MyEndPointV1" />
<serviceDebug httpHelpPageEnabled="false" includeExceptionDetailInFaults="true" />
<serviceThrottling maxConcurrentSessions="10000" maxConcurrentCalls="1000"/>
<dataContractSerializer maxItemsInObjectGraph="2147483647" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<customBinding>
<binding name="WebBinding">
<textMessageEncoding messageVersion="Soap11" maxReadPoolSize="2147483647" maxWritePoolSize="2147483647">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
</textMessageEncoding>
<httpsTransport />
</binding>
</customBinding>
</bindings>
</system.serviceModel>
</configuration>
这是一个客户端问题,System.Net控制HttpWebRequest使用的出站TCP连接数默认为每个端点2个:
ServicePointManager.DefaultConnectionLimit=10代码>您将它放在什么位置?如果您在客户端计算机(XP、Vista、7)上并在IIS中托管,您将遇到一些连接问题。它是通过ServiceHost自托管的。服务器在Windows Server 2008下,客户端为XP/Win7。我试图远程连接到Win7上托管的同一服务,同样的问题。也尝试了没有防火墙和防病毒。。。同样的问题。它似乎与WCF有关。当查看并发调用场景的ServiceModelEndpoint性能计数器时,结果很有趣:远程“未完成调用”达到了2个调用的限制。。。而20个并发线程的本地调用最多可达到18个“未完成的调用”!2个“远程”调用的限制似乎是“每个进程”。