1

我在 WCF 中收到此错误。它刚刚在我重新安装的服务中启动。我没有更改任何配置设置。

我尝试增加 maxSizeOfMessageToLog,尝试在配置中注释掉诊断设置,尝试将 logEntireMessage 设置为 false,但它仍然给出相同的错误。我在服务和客户端配置中进行了这些更改。

这是我的配置文件:

<?xml version="1.0"?>
<configuration>
    <configSections>
        <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
        <section name="Tobin.DocumentImaging.Server.ConversionService.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
            <section name="Tobin.DocumentImaging.Server.ConversionServer.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
        </sectionGroup>
    </configSections>
    <connectionStrings>
        <add name="Tobin.DocumentImaging.Server.ConversionServer.Properties.Settings.ConnectionString" connectionString="Data Source=WELLDEV;Persist Security Info=True;User ID=DOC_IMG;Password=DOC_IMG_WELLDEV;Unicode=True" providerName="System.Data.OracleClient"/>
    </connectionStrings>
    <applicationSettings>
        <Tobin.DocumentImaging.Server.ConversionService.Properties.Settings>
      <setting name="ConversionServerPort" serializeAs="String">
          <value>8093</value>
      </setting>
      <setting name="ConversionServiceName" serializeAs="String">
          <value>ConversionServer</value>
      </setting>
  </Tobin.DocumentImaging.Server.ConversionService.Properties.Settings>
        <Tobin.DocumentImaging.Server.ConversionServer.Properties.Settings>
            <setting name="ExpirationProcessInterval" serializeAs="String">
                <value>30</value>
            </setting>
            <setting name="CacheItemExpirationTime" serializeAs="String">
                <value>120</value>
            </setting>
            <setting name="CacheItemUnloadTime" serializeAs="String">
                <value>60</value>
            </setting>
        </Tobin.DocumentImaging.Server.ConversionServer.Properties.Settings>
    </applicationSettings>
  <system.diagnostics>
    <sources>
      <source name="System.ServiceModel.MessageLogging">
        <listeners>
          <add name="messages"
          type="System.Diagnostics.XmlWriterTraceListener"
          initializeData="c:\\messages.svclog"  />
        </listeners>
      </source>
    </sources>
  </system.diagnostics>
    <system.serviceModel>
      <diagnostics>
        <messageLogging
             logEntireMessage="true"
             logMalformedMessages="true"
             logMessagesAtServiceLevel="true"
             logMessagesAtTransportLevel="true"
             maxMessagesToLog="3000"
             maxSizeOfMessageToLog="2000"/>
      </diagnostics>
        <behaviors>
            <serviceBehaviors>
                <behavior name="standard">
                    <serviceDebug httpHelpPageEnabled="false" httpsHelpPageEnabled="false" includeExceptionDetailInFaults="true"/>
                    <dataContractSerializer maxItemsInObjectGraph="100000"/>
                    <serviceThrottling maxConcurrentCalls="48" maxConcurrentSessions="30" maxConcurrentInstances="60"/>
                </behavior>
            </serviceBehaviors>
        </behaviors>
        <bindings>
            <netTcpBinding>
                <binding name="ConversionBinding" sendTimeout="00:10:00" listenBacklog="40" maxBufferPoolSize="167772160" maxBufferSize="20971520" maxConnections="40" maxReceivedMessageSize="20971520">
                    <readerQuotas maxArrayLength="20971520"/>
                    <reliableSession inactivityTimeout="00:10:00"/>
                </binding>
            </netTcpBinding>
        </bindings>
        <services>
            <service behaviorConfiguration="standard" name="Tobin.DocumentImaging.Server.ConversionServer.DocumentConverter">
                <endpoint address="net.tcp://denv0201:8093/ConversionServer" binding="netTcpBinding" bindingConfiguration="ConversionBinding" name="ConversionServer" contract="Tobin.DocumentImaging.Server.ConversionServer.Public.IDocumentConverter"/>
            </service>
        </services>
      <client>
        <endpoint address="net.tcp://localhost:8093/ConversionServer" binding="netTcpBinding" bindingConfiguration="ConversionBinding" contract="Tobin.DocumentImaging.Server.ConversionServer.Public.IDocumentConverter" name="NetTcpBinding_IDocumentConverter" />
      </client>
    </system.serviceModel>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>

有什么想法可能导致这种情况吗?

4

1 回答 1

0

最有可能发生的事情是服务器端发生了问题,而您正在检查和更改客户端配置,反之亦然。

异常消息肯定与被记录消息的大小有关,只需检查服务器和客户端上的此配置值即可。

于 2014-12-19T12:14:42.827 回答