0

我正在运行一个带有远程服务器设置的 WPF 应用程序,但得到 "The remote server returned an unexpected response: (400) Bad Request" 。

这绝对是一个请求大小问题,因为我尝试减少发送的数据大小并且调用工作正常。从我的配置看来,我设置了 2 个 Gig,但它的行为就像只使用了默认限制(比如 65000 字节)。我认为我的配置有问题。

任何帮助,将不胜感激!

标记。

我有一个使用 WCF web.config 设置的远程服务器:

  <system.serviceModel>
<bindings>
  <wsHttpBinding>
    <binding name="wsHttpBindingSettings" closeTimeout="00:10:00" openTimeout="00:10:00" sendTimeout="00:10:00" maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647" messageEncoding="Text">
      <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
    </binding>
  </wsHttpBinding>
</bindings>
<services>
  <service name="Csla.Server.Hosts.WcfPortal">
    <endpoint contract="Csla.Server.Hosts.IWcfPortal" binding="wsHttpBinding"/>
  </service>
</services>

我在客户端的 app.config 是:

<system.serviceModel>
<bindings>
  <wsHttpBinding>
    <binding name="wsHttpBindingSettings" closeTimeout="00:10:00" openTimeout="00:10:00" sendTimeout="00:10:00" maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647" messageEncoding="Text">
      <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
    </binding>
  </wsHttpBinding>
</bindings>
<client>
  <endpoint name="WcfDataPortal" address="http://alcatraz.dev/AlcatrazHost/WcfPortal.svc" binding="wsHttpBinding" contract="Csla.Server.Hosts.IWcfPortal" bindingConfiguration="wsHttpBindingSettings" />
</client>

4

2 回答 2

1

您必须在客户端和服务器上设置配额,而不仅仅是一个。

于 2009-08-27T18:41:10.847 回答
0

也许连接超时?2GB 是要通过 Web 服务提交的大量数据。

您可能想查看通过网络移动数据的替代方法,例如文件共享、SFTP 等。

于 2009-08-07T22:14:24.290 回答