none
Log not complete in tracking down WCF bug RRS feed

  • Question

  • I have used both remote debugging and WCF logging to try and track down a connection reset during a web service request.  At no time is an exception thrown (includeExceptionDetailInFaults is true) or error message logged in IIS or the any of the Event logs.  With remote debugging I can watch execution of the web service call right to where it returns from the Service class.  Yet with WCF logging on verbose and with trace autoflush set to true, the logging is ending way before that point.  I need another tool or configuration parameter to expose where and why it is failing.  Please let me know if you know of one.

    I suspect the problem is occurring when the Response object is being marshalled into the XML response.  No data is returned to SoapUI.  The connection is not reset until execution continues from the breakpoint at the end of the Service handler.  The determination that the log ends early despite the autoflush, is due to the web service's functionality is to call another server's web service (a Microsoft Dynamics 2009 AX Document Service generated by the AX wizard).  The outgoing request to the AX service is logged.  The response is not.  Yet the debugger shows that the AX response is not only received, but was successfully mapped/copied into the response for the originating web service call.

    All the diagnostics are set to true: logEntireMessage, logMalformedMessages, logMessagesAtServiceLevel, logMessagesAtTransportLevel.  I have added the sources: System.ServiceModel.MessageLogging, CardSpace, System.IO.Log, System.Runtime.Serialization, and System.IdentityModel.  I have tried wsHttpBinding vs. basicHttpBinding.  I have played with the WS-A and WS-Addressing properties in SoapUI.  The message is definitely less than 64K.  The timeouts are all in excess of a minute and the processing is taking just a few seconds.  The maxItemsInObjectGraph have even been set high, even though that is not the issue.  The WSDL is returned with no problem and SoapUI is building its requests from that.  Since the processing is well along, it is not a security issue.

    I am using Visual Studio Premium 13 with the .NET Framework 4.5, WCF.  The service is contract first with the C# code generated using svcutil.exe.  If you have any suggestions, please, please let me know.  Thank you.

    Fred


    • Edited by fbrier Monday, July 20, 2015 10:19 PM
    Monday, July 20, 2015 10:16 PM

Answers

  • Hi Fbrier,

    According to this case, if your system is  Windows 8,you must run your application elevated (Run as Administrator) in order for your application to generate trace logs.

    Next,I'd like to suggest you to set your config file like below:

    <configuration>
       <system.diagnostics>
          <sources>
                <source name="System.ServiceModel"
                        switchValue="Information, ActivityTracing"
                        propagateActivity="true">
                <listeners>
                   <add name="traceListener"
                       type="System.Diagnostics.XmlWriterTraceListener"
                       initializeData= "c:\log\Traces.svclog" />
                </listeners>
             </source>
          </sources>
       </system.diagnostics>
    </configuration>

    For more information,please refer to the following articles:

    1.WCF End-To-End Tracing

    http://blogs.msdn.com/b/andreal/archive/2009/03/21/wcf-end-to-end-tracing.aspx

    I hope that will be helpful to you.

    Best Regards,

    Tracy Dj


    Best Regards, Tracy Dj

    Wednesday, July 22, 2015 2:28 AM
    Moderator

All replies

  • I turned on every logging level and that gave me an exception in the Application Event log, not the messages.svclog file for some reason.  The problem is a bug in the Microsoft XMLSerializer Code Generation that dates back to 2006 and has never been fixed.  svcutil.exe is apparently built using the same bug ridden libraries.  Your options, if you are allowed to modify the WSDL, are to add a bogus attribute to your schema, or hand remove the one set of the double brackets from your generated code.  Smelly.  Shame on you Microsoft.  2006.  That is slack.
    Tuesday, July 21, 2015 12:40 AM
  • Hi Fbrier,

    According to this case, if your system is  Windows 8,you must run your application elevated (Run as Administrator) in order for your application to generate trace logs.

    Next,I'd like to suggest you to set your config file like below:

    <configuration>
       <system.diagnostics>
          <sources>
                <source name="System.ServiceModel"
                        switchValue="Information, ActivityTracing"
                        propagateActivity="true">
                <listeners>
                   <add name="traceListener"
                       type="System.Diagnostics.XmlWriterTraceListener"
                       initializeData= "c:\log\Traces.svclog" />
                </listeners>
             </source>
          </sources>
       </system.diagnostics>
    </configuration>

    For more information,please refer to the following articles:

    1.WCF End-To-End Tracing

    http://blogs.msdn.com/b/andreal/archive/2009/03/21/wcf-end-to-end-tracing.aspx

    I hope that will be helpful to you.

    Best Regards,

    Tracy Dj


    Best Regards, Tracy Dj

    Wednesday, July 22, 2015 2:28 AM
    Moderator