TraceResponseXml method

void TraceResponseXml(
  1. IEwsHttpWebResponse response,
  2. MemoryStream memoryStream
)
Traces the response. This should only be used for synchronous requests, or synchronous situations (such as a WebException on an asynchrounous request). The response. The response content in a MemoryStream.

Implementation

void TraceResponseXml(
    IEwsHttpWebResponse response, MemoryStream memoryStream) {
  // todo("check OrdinalIgnoreCase argument");
  if (!StringUtils.IsNullOrEmpty(response.ContentType) &&
      (response.ContentType.startsWith(
              "text/" /*, StringComparison.OrdinalIgnoreCase*/) ||
          response.ContentType.startsWith(
              "application/soap" /*, StringComparison.OrdinalIgnoreCase)*/))) {
    this.Service.TraceXml(TraceFlags.EwsResponse, memoryStream);
  } else {
    this.Service.TraceMessage(TraceFlags.EwsResponse, "Non-textual response");
  }
}