问题
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...
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>
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>
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?
回答1:
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
来源:https://stackoverflow.com/questions/26236905/running-wcf-test-client-and-receiving-maxreceivedmessagesize-error-after-increas