Microsoft.Protocols.TestSuites.Common.MapiHttpAdapter.NotificationWaitCall C# (CSharp) Method

NotificationWaitCall() public method

The method to send NotificationWait request to the server.
public NotificationWaitCall ( IRequestBody requestBody ) : NotificationWaitSuccessResponseBody
requestBody IRequestBody The NotificationWait request body.
return NotificationWaitSuccessResponseBody
        public NotificationWaitSuccessResponseBody NotificationWaitCall(IRequestBody requestBody)
        {
            string requestType = "NotificationWait";
            HttpWebResponse response = SendMAPIHttpRequest(this.site, this.mailStoreUrl, this.userName, this.domain, this.userPassword, requestBody, requestType, this.cookies);

            NotificationWaitSuccessResponseBody result = null;

            string responseCode = response.Headers["X-ResponseCode"];

            byte[] rawBuffer = ReadHttpResponse(response);

            response.GetResponseStream().Close();

            if (int.Parse(responseCode) == 0)
            {
                ChunkedResponse chunkedResponse = ChunkedResponse.ParseChunkedResponse(rawBuffer);
                NotificationWaitSuccessResponseBody responseSuccess = NotificationWaitSuccessResponseBody.Parse(chunkedResponse.ResponseBodyRawData);
                result = responseSuccess;
            }
            else
            {
                this.site.Assert.Fail("MAPIHTTP call failed, the error code returned from server is: {0}", responseCode);
            }

            return result;
        }