开发者

Why isn't my invalid WCF message being logged?

开发者 https://www.devze.com 2023-04-04 02:33 出处:网络
I\'ve got a WCF client communicating with a WCF service using [DataContract] types, and I\'m getting a serialization error:

I've got a WCF client communicating with a WCF service using [DataContract] types, and I'm getting a serialization error:

The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://www.example.com/2007/09/Example:ExampleResult. The InnerException message was 'Deserialized object with reference id 'i3' not found in stream.'. Please see InnerException for more details.

Normally, I'd simply crank up the tracing and see exactly what happened, but in this case, I can't get the offending (response) message to appear in the log.

My configuration looks like this:

<system.serviceModel>
    ... (more stuff)
    <diagnostics>
        <messageLogging logEntireMessage="true" logMalformedMessages="true"
        logMessagesAtServiceLevel="false" logMessagesAtTransportLevel="true"
        maxMessagesToLog="10000" maxSizeOfMessageToLog="81920000" />
    </diagnostics>
</system.serviceModel>
<system.diagnostics>
    <trace autoflush="true" />
    <sources>
        <source name="System.ServiceModel" switchValue="Information, ActivityTracing"
          propagateActivity="true">
            <listeners>
                <add name="wcf_listener" />
            </listeners>
        </source>
        <source name="System.ServiceModel.MessageLogging">
            <listeners>
                <add name="wcf_listener" />
            </listeners>
        </source>
    </sources>
    <sharedListeners>
        <add name="wcf_listener" initializeData="tracelog.svclog"
          type="System.Diagnostics.XmlWriterTraceListener" />
    </sharedListeners>
</system.diagnostics>

In the resulting log file, I g开发者_StackOverflow中文版et the outbound message logged, and then the exception logged. I never see the incoming message. What am I doing wrong here?


It seems that the problem related to your flooded data between the service and the client.

Please refer to my post here

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号