Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
WCF.config文件-显然出了问题_Wcf_App Config - Fatal编程技术网

WCF.config文件-显然出了问题

WCF.config文件-显然出了问题,wcf,app-config,Wcf,App Config,各位, 我的WCF的.config有点问题。当我向它发送超过8192字节(默认值)的数据时,它会失败,告诉我我的“maxStringContentLength”只有8192字节。我想我把它设定在10000000 有什么线索吗 <system.serviceModel> <bindings> <wsHttpBinding> <binding name="wsHttpBinding" maxReceivedMessageSize="500000

各位, 我的WCF的.config有点问题。当我向它发送超过8192字节(默认值)的数据时,它会失败,告诉我我的“maxStringContentLength”只有8192字节。我想我把它设定在10000000

有什么线索吗

<system.serviceModel>
 <bindings>
  <wsHttpBinding>
    <binding name="wsHttpBinding" maxReceivedMessageSize="50000000" maxBufferPoolSize="50000000" messageEncoding="Mtom">
      <readerQuotas maxDepth="200" maxStringContentLength="10000000" maxArrayLength="16384" maxBytesPerRead="10000000" maxNameTableCharCount="16384" />
    </binding>
  </wsHttpBinding>
</bindings>
<services>     
  <service name="PsychCoverage.WcfMT.Admin">
    <endpoint address="" binding="wsHttpBinding" contract="PsychCoverage.Common.IAdmin">
      <identity>
        <dns value="localhost" />
      </identity>
    </endpoint>
    <endpoint address="mex" binding="wsHttpBinding" contract="IMetadataExchange" />
    <host>
      <baseAddresses>
        <add baseAddress="http://localhost:8732/Design_Time_Addresses/WcfMT/Admin/" />
      </baseAddresses>
    </host>
  </service>
</services>
<behaviors>
  <serviceBehaviors>
    <behavior >
      <serviceMetadata httpGetEnabled="True" />
      <serviceDebug includeExceptionDetailInFaults="True"  />
    </behavior>
  </serviceBehaviors>
</behaviors>
</system.serviceModel>

您确实设置了它,但您没有在endpoint元素中引用它,因此.NET使用wsHttpBinding(8192)的默认值。添加使用endpoint元素的bindingConfiguration属性指定的配置:

<endpoint address="" binding="wsHttpBinding" bindingConfiguration="wsHttpBinding" contract="PsychCoverage.Common.IAdmin">


此外,我建议使用与wsHttpBinding不同的名称以避免混淆。

因此,如果我将我的名称更改为此。。。把我的名字改成。。。那么我的端点应该使用我的绑定配置吗?是的,您的端点应该设置bindingConfiguration=“wcfMyProject”。顺便说一下,注释不支持代码格式,只支持问题和答案。事实证明,我的编码一端是MTOM,另一端是“非MTOM”(忘记另一个选项)。解决了这个问题后,它又活了起来。我只想承认,我在这里发布了几乎相同的消息:--因为问题回来了,我无法解决它…是的-您已经将其设置在服务器/服务端-您的客户调用此服务如何??