使用 WPF CSLA 远程服务器时出现错误

发布于 2024-07-30 09:48:25 字数 1830 浏览 7 评论 0原文

我正在运行带有远程服务器设置的 WPF 应用程序,但收到“远程服务器返回意外响应:(400) 错误请求”。

这绝对是一个请求大小问题,因为我尝试减少发送的数据大小并且调用工作正常。 从我的配置来看,我似乎设置了 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>

I am running a WPF app with a remote server setup but getting "The remote server returned an unexpected response: (400) Bad Request" .

This is definitely a request size issue since I tried reducing the data size being sent and the call worked fine. From my configuration it looks like I have 2 Gigs set up, but it behaves like only the default limit (something like 65000 bytes) is being used. I am thinking there is something wrong with my configuration.

Any help would be appreciated!

Mark.

I have a remote Server set up using 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>

And my app.config on the client is:

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

指尖微凉心微凉 2024-08-06 09:48:25

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

You have to set quotas on the client and the server, not just one.

橘寄 2024-08-06 09:48:25

也许是连接超时? 对于想要通过网络服务提交的数据来说,2GB 是一个巨大的数据量。

您可能需要寻找通过网络移动数据的替代方法,例如文件共享、SFTP 等。

Maybe a connection timeout? 2GB is a huge amount of data to want to submit via a web service.

You might want to look at alternative means to move the data across the network such as a file share, SFTP, etc.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文