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,
) {
  final contentType = response.ContentType.toLowerCase();
  if (!StringUtils.IsNullOrEmpty(contentType) &&
      (contentType.startsWith("text/") ||
          contentType.startsWith("application/soap"))) {
    Service.TraceXml(TraceFlags.EwsResponse, memoryStream);
  } else {
    Service.TraceMessage(TraceFlags.EwsResponse, "Non-textual response");
  }
}