IEwsHttpWebResponse
{
var serviceResponse;
try {
this.Service.ProcessHttpResponseHeaders(TraceFlags_1.TraceFlags.EwsResponseHttpHeaders, response);
// If tracing is enabled, we read the entire response into a MemoryStream so that we
// can pass it along to the ITraceListener. Then we parse the response from the
// MemoryStream.
if (this.Service.IsTraceEnabledFor(TraceFlags_1.TraceFlags.EwsResponse)) {
}
else {
if (this.Service.RenderingMethod == RenderingMode_1.RenderingMode.Xml) {
serviceResponse = this.ReadResponseXmlJsObject(response);
}
else if (this.Service.RenderingMethod == RenderingMode_1.RenderingMode.JSON) {
serviceResponse = this.ReadResponseJson(response);
}
else {
throw new Error
InvalidOperationException
"Unknown RenderingMethod.");
}
}
}
catch (ex) {
if (ex.Response != null) {
//IEwsHttpWebResponse exceptionResponse = this.Service.HttpWebRequestFactory.CreateExceptionResponse(e);
this.Service.ProcessHttpResponseHeaders(TraceFlags_1.TraceFlags.EwsResponseHttpHeaders, response);
}
throw new ServiceRequestException_1.ServiceRequestException(ExtensionMethods_1.StringHelper.Format(Strings_1.Strings.ServiceRequestFailed, ex.Message), ex);
}
return serviceResponse;
};
SimpleServiceRequestBase.prototype.ReadResponseJson = function (jsObject
System.IO.Stream
{
//var jsonResponse: JsonObject = new JsonParser(responseStream).Parse();
return _super.prototype.BuildResponseObjectFromJson.call(this, jsObject);
};
SimpleServiceRequestBase.prototype.WebRequestAsyncCallback = function (webAsyncResult
System.IAsyncResult
{ throw new Error("SimpleServiceRequestBase.ts - WebRequestAsyncCallback : Not implemented."); };
return SimpleServiceRequestBase;
})(ServiceRequestBase_1.ServiceRequestBase);
exports.SimpleServiceRequestBase = SimpleServiceRequestBase;