【发布时间】:2014-10-07 13:12:57
【问题描述】:
我正在尝试在 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>
用谷歌搜索后,我读到的只是客户端和服务器都需要设置...但是,我在 localhost 上运行,并且在 wcf 测试客户端中使用。我似乎无法弄清楚我还需要在哪里进行这些更改...我到底错过了什么?
【问题讨论】:
标签: c# wcf visual-studio wcf-binding