简体   繁体   English

wsDualHttpBinding不向服务器发送请求

[英]wsDualHttpBinding not sending request to server

i'm currently working on a client/server program which is using wshttpdualbinding for communication in vs with c#. 我目前正在开发使用wshttpdualbinding与c#进行通信的客户端/服务器程序。 So i'm calling webservices over this binding from the server. 因此,我正在通过服务器上的此绑定调用Web服务。

Everything worked fine, but in the last days i'm encountering the following problem: if i call a service from the server, the client just stops working and stops reacting. 一切工作正常,但是在最近的日子里,我遇到了以下问题:如果我从服务器调用服务,客户端将停止工作并停止响应。 Nothing gets send from the client. 客户端没有任何发送。

I can't post much, because it is a big project, but i'll try to post the best snippets: 我不能发布太多,因为这是一个很大的项目,但是我将尝试发布最好的摘要:

binding: 捆绑:

<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>

problem causing code: 问题导致代码:

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);
}

A function gets called which creates a new clusterrationalemapping for a specific cluster. 调用一个函数,该函数为特定集群创建新的clusterrationalemapping The rational and CurrentProject variables are always the same. rationalCurrentProject变量始终相同。 just cluster is different. 只是集群是不同的。 Most of the time everything works and service.SaveItem returns the new Id as expected. 大多数情况下,一切正常, service.SaveItem正常service.SaveItem返回预期的新ID。 But for one special cluster it is not working. 但是对于一个特殊的群集,它无法正常工作。 service.SaveItem just stops and freezes the tool until i get some exception (server did not respond in time/gave no answer). service.SaveItem只是停止并冻结该工具,直到出现一些异常(服务器没有及时响应/没有给出答案)。

I'm sure that the wsDualHttpBinding is set correctly. 我确定wsDualHttpBinding设置正确。 If i comment out the line Project = CurrentProject and replace it with Project = new Project(); 如果我注释掉Project = CurrentProject ,并用Project = new Project();替换Project = new Project(); everything works fine for this cluster again. 一切再次适用于该群集。

So it looks like clusterrationalmapping might get too big for sending. 因此,看来clusterrationalmapping可能太大而无法发送。 But the exception is not saying that. 但是唯一的例外不是说。 And i got it from the server - from that direction it worked. 我从服务器上获得了它-从这个方向上它起作用了。

I used Microsoft Service Trace Viewer for debugging purpose and i can see there, that it instantly throws an exception that the endpoint could not be reached. 我使用Microsoft Service Trace Viewer进行调试,并且在那里可以看到它立即引发无法到达端点的异常。 So i'm pretty sure that the service dies when serializing the object. 因此,我很确定在序列化对象时服务会消失。

Is there any way to debug into the service to see when exactly, or better why, it fails? 有什么方法可以调试到服务中以查看确切的时间,或者更好的原因是什么导致失败的?

Thanks in advance for your help. 在此先感谢您的帮助。

由于我找不到解决方案-我仍然认为序列化程序和太大/嵌套的类存在问题,因此我将绑定更改为nettcp,现在可以正常工作了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM