Поделиться через


EWS Managed API 2.0 application debugging

Find information about debugging an application that uses the EWS Managed API.

Last modified: January 30, 2014

Applies to: EWS Managed API | Exchange Server 2007 Service Pack 1 (SP1) | Exchange Server 2010

Note: This content applies to the EWS Managed API 2.0 and earlier versions. For the latest information about the EWS Managed API, see Web services in Exchange.

Applications that you create by using the Exchange Web Services (EWS) Managed API can be more challenging to debug because part of the code does not run on the local computer. You might have to use special tools, such as network traffic monitors, to debug your EWS Managed API application. These tools can be external to your application, such as the tools built into Visual Studio 2008, or they can be internal, such as network service tracing and logging tools that work with EWS Managed API objects.

Tracing EWS Managed API requests and responses

The NetworkService object provides hooks to trace the requests and responses that are sent when your application calls EWS. To set up tracing, you must set one optional and two required properties on the ExchangeService object, as shown in the following table.

Property

Description

TraceEnabled

Set the TraceEnabled property to true to configure the ExchangeService object to send requests and responses to the trace listener.

TraceListener

Set to an instance of an object that implements the ITraceListener interface.

TraceFlags (Optional)

Set to indicate the requests and responses that the ExchangeService object sends to the trace listener. If you do not set this property, the ExchangeService object will send all requests and responses to the trace listener.

For more information about how to configure tracing for the EWS Managed API, including a code sample of a trace listener that writes trace information to text files, see Tracing EWS requests by using the EWS Managed API 2.0.