How to Diagnose Problems with the WCF Adapters

This section contains steps that you can follow to help diagnose problems with the WCF adapters.

Check the IIS log and HTTPERR log of the IIS server for errors

  • The source or target IIS server log files can contain information that is helpful for troubleshooting problems with the isolated WCF adapters. By default the IIS log files on a Windows Server computer are located in the following directory:

    %WinDir%\system32\LogFiles\W3SVC1\

    Note

    %WinDir% is a placeholder for the location of the Windows directory on the IIS server.

    By default the HTTPERR log files on a Windows Server 2003 and Windows Server 2008 SP2 based computers are located in the following directory:

    Note

    The HTTPERR log file is available only on Windows Server 2003 and Windows Server 2008 SP2 based computers.

    %WinDir%\system32\LogFiles\HTTPERR\

Use WCF message logging for fault monitoring and diagnosis of problems from the WCF adapters

  1. WCF provides the capability to log incoming and outgoing messages for offline consumption. You can use message logging to see what the messages incoming and outgoing through the WCF adapters look like. WCF does not log messages by default. To activate message logging, you have to modify the configuration files that the WCF adapters use. For more information about WCF message logging, see "Message Logging" at https://go.microsoft.com/fwlink/?LinkId=89003.

  2. For the in-process WCF adapters, you can enable WCF message logging by modifying the application configuration file, BTSNtSvc.exe.config, for BTSNtSvc.exe. The configuration file can be found in the BizTalk Server installation path. If you installed BizTalk Server to the default location, BtsNtSvc.exe will be in the directory \Program Files (x86)\Microsoft BizTalk Server <VERSION>.

  3. For the isolated WCF adapters, you can enable WCF message logging by modifying the Web.config file that the BizTalk WCF Service Publishing Wizard creates in the Web application folder.

  4. To modify BTSNtSvc.exe.config or Web.config, open the configuration file by using Notepad, and then configure WCF message logging, as indicated in the following configuration example:

    <configuration>
      <system.serviceModel>
        <diagnostics>
          <messageLogging
               logEntireMessage="true"
               logMalformedMessages="false"
               logMessagesAtServiceLevel="true"
               logMessagesAtTransportLevel="true"
               maxMessagesToLog="300000"
               maxSizeOfMessageToLog="200000"
        />
        </diagnostics>
      </system.serviceModel>
    
      <system.diagnostics>
        <sources>
          <source name="System.ServiceModel.MessageLogging">
            <listeners>
              <add name="messages"
              type="System.Diagnostics.XmlWriterTraceListener"
              initializeData="c:\wcfTrace.e2e" />
            </listeners>
          </source>
        </sources>
      </system.diagnostics>
    </configuration>
    
  5. You can use the Windows Communication Foundation (WCF) Service Trace Viewer Tool to analyze messages logged by WCF. Service Trace Viewer is included in the Microsoft Windows Software Development Kit (SDK) for Windows Vista and .NET Framework Runtime Components. You can download the Windows SDK from the Microsoft Download Center. For more information about using this tool, see "Service Trace Viewer Tool (SvcTraceViewer.exe)"at https://go.microsoft.com/fwlink/?LinkId=88991.

Return managed exception information to the client in a SOAP fault to ease debugging

  1. You can select the Include exception in faults option for the standard WCF receive location to return managed exception information to the client in SOAP faults to ease debugging. Use the following steps to select the Include exception in faults option.

    1. In the BizTalk Server Administration console, expand BizTalk Server Administration, expand BizTalk Group, expand Applications, expand Receive Locations, right-click a receive location using a standard WCF adapter, and then click Properties.

    2. In the Receive Location Properties dialog box, click Configure.

    3. In the transport dialog box, on the Messages tab, select the Include exception in faults option.

  2. If you use the WCF-Custom or the WCF-CustomIsolated adapter, you can set the IncludeExceptionDetailInFaults property of the ServiceDebugElement to return managed exception information to the client. To do so, use the following steps:

    1. In the BizTalk Server Administration console, expand BizTalk Server Administration, expand BizTalk Group, expand Applications, expand Receive Locations, right-click a receive location using the WCF-Custom or the WCF-CustomIsolated adapter, and then click Properties.

    2. In the Receive Location Properties dialog box, click Configure.

    3. In the transport dialog box, on the Behavior tab, right-click the ServiceBehavior node, and then click Add extension.

    4. In the Select Behavior Extension dialog box, select serviceDebug, and then click OK.

    5. In the transport dialog box, on the Behavior tab, click the serviceDebug node, and then select True for the includeExceptionDetail property in the Configuration list view.

    Note

    Returning managed exception information to clients can be a security risk because exception details expose information about the internal service implementation that could be used by unauthorized clients.

See Also

Tools and Utilities to Use for Troubleshooting Troubleshooting the WCF Adapters BTSNTSvc.exe.config File