运行 WCF 测试客户端并在 app.config 中增加后收到 MaxReceivedMessageSize 错误

2023-12-28

我正在尝试在 VS 2013 中设置我的第一个 WCF 服务。我正忙着完成教程,但遇到了障碍......

运行一个简单的服务 (DataViewerService),该服务调用数据库以返回记录集。我已将绑定更改为:

<bindings>
  <basicHttpBinding>
    <binding allowCookies="true"
             maxReceivedMessageSize="20000000"
             maxBufferSize="20000000"
             maxBufferPoolSize="20000000">
      <readerQuotas maxDepth="32"
           maxArrayLength="200000000"
           maxStringContentLength="200000000"/>
    </binding>
  </basicHttpBinding>
</bindings>

在 system.serviceModel 中,我直接在下面包含了

<services>
  <service name="DataViewerService.Service1">
    <host>
      <baseAddresses>
        <add baseAddress="http://localhost:8733/Design_Time_Addresses/DataViewerService/Service1/" />
      </baseAddresses>
    </host>
    <endpoint address="http://localhost:2112/Viewer" 
              binding="basicHttpBinding" 
              contract="DataViewerService.IService1"> 
      <identity>
        <dns value="localhost" />
      </identity>
    </endpoint>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service>
</services>

谷歌搜索后,我读到的只是客户端和服务器都需要设置...但是,我在本地主机上运行,​​并且在 wcf 测试客户端中使用。我似乎不知道我还需要在哪里进行这些更改...我到底错过了什么?


enter image description hereYou need to edit the config on the WCF Test client.

在添加的服务的底部,您将看到一个名为“配置文件”的节点。

尝试最小化你的合同来查看它

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

运行 WCF 测试客户端并在 app.config 中增加后收到 MaxReceivedMessageSize 错误 的相关文章

随机推荐