工具和资源来解决 exchange 的 EWS 应用程序Tools and resources for troubleshooting EWS applications for Exchange

查找可帮助您对 EWS 托管 API 或 EWS 应用程序进行故障排除的资源。Find resources to help you troubleshoot your EWS Managed API or EWS application.

有些事情并不总是按计划进行。Things don't always go as planned. 有时 EWS 请求失败,或提供意外的结果。Sometimes EWS requests fail, or provide unexpected results. 这可能会令人沮丧,尤其是当原因不明显时。This can be frustrating, especially if the reason isn't obvious. 但愿这永远不会发生,但如果是这样,本文将提供有关工具和资源的信息,您可以使用这些工具和资源来帮助您解决问题。Hopefully this never happens to you, but if it does, this article provides information about tools and resources that you can use to help troubleshoot your problem.


本文提供了有关疑难解答信息的一般故障排除建议和源。This article provides general troubleshooting advice and sources for troubleshooting information. 遗憾的是,不能提供详细的故障排除步骤。Unfortunately it isn't possible to give detailed troubleshooting steps. 有关解决特定错误的帮助,请参阅后续步骤For assistance troubleshooting your specific error, see Next steps.

检查 SOAP 请求和响应Examine the SOAP requests and responses

当事情不能正常运行时,它确实有助于查看发生的情况。When things aren't working correctly, it really helps to be able to see what's going on. 在调查 EWS 或 EWS 托管 API 的问题时,第一行查询是检查您的应用程序通过网络发送的请求以及服务器发送回的响应。The first line of inquiry when investigating a problem with EWS or the EWS Managed API is to examine the requests that your application is sending over the network and the responses that the server is sending back.

EWS 托管 API 使 SOAP 请求和响应易于通过其内置跟踪功能进行检查。The EWS Managed API makes examining SOAP requests and responses easy with its built in tracing functionality. 如果使用 EWS,则可能会也可能无法访问类似的跟踪功能,具体取决于用于发送请求的平台或类。If you are using EWS, you might or might not have access to similar tracing functionality, depending on what platform or classes you use to send your requests. 但是,您始终可以使用网络跟踪工具(如网络监视器Fiddler )来检查网络流量并查看请求和响应负载。However, you can always use a network tracing tool like Network Monitor or Fiddler to examine the network traffic and view the request and response payloads.

此外,还可以检测客户端请求,以增强请求和响应中提供的信息。Additionally, you can instrument your client requests to enhance the information available in requests and responses.

在获得请求和响应后,请自己询问以下各项:是否正确?After you have the requests and responses, ask yourself the following: Do they look correct? 您的应用程序是否需要发送的值是什么?Are the values that your application is sending expected? 做出的响应是否有意义?Do the responses make sense?

检查错误代码Examine error codes

有时,错误代码可能会很长一段时间来查明问题,即使乍一看看似乎没有意义也是如此。Sometimes the error code can go a long way toward pinpointing the problem, even if at first glance it doesn't seem to make sense. 该错误是否指示正在限制你的客户端?Does the error indicate that your client is being throttled? 可能会调用自动发现以刷新配置信息,是否按顺序进行?Perhaps a call to Autodiscover to refresh configuration information is in order?

有关处理特定错误的详细信息,请参阅以下文章:For more information about handling specific errors, see the following articles:

验证版本Verify versions

EWS 操作中涉及许多不同的组件,这些组件的版本可能会影响结果。There are a number of different components involved in EWS operations, and the versions of those components can influence the results.

表1。可能影响 EWS 进程的版本控制组件Table 1. Versioned components that can affect EWS processes

组件Component EWS Managed APIEWS Managed API EWSEWS 备注Notes
请求的服务器版本Requested server version
ExchangeServiceBase属性ExchangeServiceBase.RequestedServerVersion property
RequestServerVersion元素RequestServerVersion element
此值控制用于处理 EWS 请求的 EWS 架构的版本。This value controls which version of the EWS schema is used to process the EWS request. 请确保在此处指定的架构版本对要发送的请求有意义。Make sure that the schema version specified here makes sense for the request you are sending. 某些属性和操作在架构的早期版本中不可用。Some properties and operations are not available in earlier versions of the schema.
服务器版本The server version
ExchangeServiceBase属性ExchangeServiceBase.ServerInfo property
ServerVersionInfo元素ServerVersionInfo element
此值由服务器以 EWS 响应的形式返回,并指示处理响应的服务器的版本。This value is returned by the server in EWS responses, and indicates the version of the server that processed the response. 请确保此值是您所期望的值。Make sure this value is what you expect. 如果可能,请确保 Exchange 服务器对你的主要版本的 Exchange 运行的是最新的更新。If possible, make sure that the Exchange server is running the most recent update for your major version of Exchange.
EWS 托管 API 版本The EWS Managed API version
WebServices 文件的 "产品版本" 属性。The Product version property of the Microsoft.Exchange.WebServices.dll file.
不适用Not applicable
如果使用的是 EWS 托管 API,请确保使用的是最新版本If you're using the EWS Managed API, make sure that you are using the most recent version.

验证访问Verify access

默认情况下,EWS 处于启用状态,但可以更改默认值EWS is enabled by default, but defaults can be changed. 使用set-organizationconfig cmdlet 可确保在服务器上启用 ews,并使用set-casmailbox cmdlet 来确保为用户的邮箱启用了 ews。Use the Get-OrganizationConfig cmdlet to make sure that EWS is enabled on the server, and the Get-CASMailbox cmdlet to make sure that EWS is enabled for the user's mailbox. 此外,请检查 EWS 允许或阻止列表的 cmdlet 响应,并确保您的应用程序不会被阻止使用 EWS。Also check both cmdlet responses for an EWS allow or block list, and make sure that your application isn't blocked from using EWS.

此外,还应验证 EWS 虚拟目录上的默认身份验证设置是否尚未修改。You should also verify that the default authentication settings on the EWS virtual directory have not been modified.

尝试其他 EWS 客户端Try another EWS client

有时,尝试来自另一个客户端的相同请求并比较结果会很有帮助。Sometimes it is helpful to try the same request from another client and compare results. 如果其他客户端得到不同的结果,有何不同?If another client gets different results, what is different? 在成功的请求和失败的请求之间找出不同的信息可帮助解释特定请求失败的原因。Figuring out what is different between a successful request and a failed request can help explain why a particular request is failing.

当然,您可以编写另一个客户端以供测试,但不必再进行!While you can certainly write another client to test with, you don't have to! EWSEditor是一个使用 EWS 托管 API 和 ews 的示例客户端。EWSEditor is a sample client that uses the EWS Managed API and EWS. 您可以下载客户端(包括源代码),并使用它来尝试在您的应用程序中出现故障的相同请求。You can download the client (including the source code) and use it to try the same requests that are failing in your application.

检查 IIS 日志Examine IIS logs

如果您有权访问 Exchange 服务器,客户端访问服务器上的 Internet 信息服务(IIS)提供的日志记录功能可以提供有关故障的详细信息。If you have access to the Exchange server, the logging functionality provided by Internet Information Services (IIS) on the Client Access servers can provide more information about failures. 但请记住,IIS 日志将仅在收到 HTTP 错误时才有用。However, keep in mind that IIS logs will only be helpful if you are receiving an HTTP error.

IIS 提供了两种不同的日志记录方法: iis 日志记录失败请求跟踪IIS provides two different logging methods: IIS logging and failed requests tracing. 若要使用 IIS 日志,可以使用Log Parser Studio,其中包括许多内置的 EWS 查询。To work with IIS logs, you can use Log Parser Studio, which includes a number of built-in EWS queries.

后续步骤Next steps

现在,您已经了解了可用于进行故障排除的工具和资源,您可能需要帮助了解这些工具提供的信息。Now that you've learned about the tools and resources that you can use to troubleshoot, you might need help understanding the information provided by those tools. 以下是获取帮助的一些选项:The following are some options for getting help:

另请参阅See also

另请参阅以下文章:See the following articles:

下载以下内容:Download the following: