我正在运行一个带有远程服务器设置的 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>