在app.config中增加后,运行WCF测试客户端并收到MaxReceivedMessageSize错误 [英] Running WCF Test Client and receiving MaxReceivedMessageSize error after increasing in app.config

查看:117
本文介绍了在app.config中增加后,运行WCF测试客户端并收到MaxReceivedMessageSize错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am trying to set up my first WCF service in VS 2013. I'm busy working my way through a tutorial, but have hit a snag...

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

Running a simple Service (DataViewerService) which calls out to a database to return a recordset. I have changed my bindings to:

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

在system.serviceModel内,并且在其正下方,我已包含

within system.serviceModel, and directly below I have included

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

在Google周围,我读到的所有内容都是必须同时设置客户端和服务器...但是,我在localhost上运行,并且在wcf Test Client中使用.我似乎无法弄清楚我还需要在哪里进行这些更改……我到底想念什么呢?

Having googled around, all I read is that the client and server both need to be set... However, I am running on localhost, and I am consuming within the wcf Test Client. I can't seem to figure out where else I need to make these changes... What the heck am I missing?

推荐答案

您需要在WCF测试客户端上编辑配置.

You need to edit the config on the WCF Test client.

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

Right at the bottom of your added service you will see a node called "Config file".

尝试最小化合同以查看合同

Try minimizing your contract to see it

这篇关于在app.config中增加后,运行WCF测试客户端并收到MaxReceivedMessageSize错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆