[英]wsDualHttpBinding not sending request to server
我目前正在开发使用wshttpdualbinding
与c#进行通信的客户端/服务器程序。 因此,我正在通过服务器上的此绑定调用Web服务。
一切工作正常,但是在最近的日子里,我遇到了以下问题:如果我从服务器调用服务,客户端将停止工作并停止响应。 客户端没有任何发送。
我不能发布太多,因为这是一个很大的项目,但是我将尝试发布最好的摘要:
捆绑:
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_AuthenticationService" closeTimeout="03:10:00"
openTimeout="03:10:00" receiveTimeout="03:10:00" sendTimeout="03:10:00"
bypassProxyOnLocal="false" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
useDefaultWebProxy="true" allowCookies="false" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" >
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
<wsDualHttpBinding>
<binding name="WSDualHttpBinding_Service" closeTimeout="03:10:00"
openTimeout="03:10:00" receiveTimeout="03:10:00" sendTimeout="03:10:00"
bypassProxyOnLocal="false" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
useDefaultWebProxy="true" messageEncoding="Text" textEncoding="utf-8" >
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="None">
<message clientCredentialType="UserName" algorithmSuite="Default"/>
</security>
</binding>
</wsDualHttpBinding>
</bindings>
问题导致代码:
Clusterrationalemapping cr = new Clusterrationalemapping
{
Textbricks = rationale,
Cluster = cluster,
Project = CurrentProject
};
var clusterrationaleId = 0;
if (cluster.AddClusterRationaleMapping(cr))
{
clusterrationaleId = _service.SaveItem(cr);
cr.Id = clusterrationaleId;
if(rationale.Clusterrationalemappings == null) rationale.Clusterrationalemappings = new List<Clusterrationalemapping>();
rationale.Clusterrationalemappings.Add(cr);
}
调用一个函数,该函数为特定集群创建新的clusterrationalemapping
。 rational
和CurrentProject
变量始终相同。 只是集群是不同的。 大多数情况下,一切正常, service.SaveItem
正常service.SaveItem
返回预期的新ID。 但是对于一个特殊的群集,它无法正常工作。 service.SaveItem
只是停止并冻结该工具,直到出现一些异常(服务器没有及时响应/没有给出答案)。
我确定wsDualHttpBinding
设置正确。 如果我注释掉Project = CurrentProject
,并用Project = new Project();
替换Project = new Project();
一切再次适用于该群集。
因此,看来clusterrationalmapping
可能太大而无法发送。 但是唯一的例外不是说。 我从服务器上获得了它-从这个方向上它起作用了。
我使用Microsoft Service Trace Viewer进行调试,并且在那里可以看到它立即引发无法到达端点的异常。 因此,我很确定在序列化对象时服务会消失。
有什么方法可以调试到服务中以查看确切的时间,或者更好的原因是什么导致失败的?
在此先感谢您的帮助。
由于我找不到解决方案-我仍然认为序列化程序和太大/嵌套的类存在问题,因此我将绑定更改为nettcp,现在可以正常工作了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.