/// <summary>
        /// A method is used to read the HTTP response body and decode to string.
        /// </summary>
        /// <param name="wopiHttpResponse">A parameter represents the HTTP response.</param>
        /// <returns>A return value represents the string which is decode from the HTTP response body. The decode format is UTF-8 by default.</returns>
        public static string ReadHTTPResponseBodyToString(WOPIHttpResponse wopiHttpResponse)
        {
            if (null == wopiHttpResponse)
            {
                throw new ArgumentNullException("wopiHttpResponse");
            }

            string bodyString = string.Empty;
            long bodyLength = wopiHttpResponse.ContentLength;
            if (bodyLength != 0)
            {
                Stream bodStream = null;
                try
                {
                    bodStream = wopiHttpResponse.GetResponseStream();
                    using (StreamReader strReader = new StreamReader(bodStream))
                    {
                        bodyString = strReader.ReadToEnd();
                    }
                }
                finally
                {
                    if (bodStream != null)
                    {
                        bodStream.Dispose();
                    }
                }
            }

            return bodyString;
        }
        /// <summary>
        /// A method is used to get raw body contents whose length is in 1 to int.MaxValue bytes scope.
        /// </summary>
        /// <param name="wopiHttpResponse">A parameter represents the HTTP response.</param>
        /// <returns>A return value represents the raw body content.</returns>
        public static byte[] GetContentFromResponse(WOPIHttpResponse wopiHttpResponse)
        {
            List<byte[]> rawBytesOfBody = ReadRawHTTPResponseToBytes(wopiHttpResponse);
            byte[] returnContent = rawBytesOfBody.SelectMany(bytes => bytes).ToArray();

            DiscoveryProcessHelper.AppendLogs(
                      typeof(WOPIResponseHelper),
                      string.Format(
                                "Read normal size(1 to int.MaxValue bytes) data from response. actual size[{0}] bytes",
                                 returnContent.Length));

            return returnContent;
        }
        /// <summary>
        /// A method is used to read the HTTP response body to the bytes array.
        /// </summary>
        /// <param name="wopiHttpResponse">A parameter represents the HTTP response.</param>
        /// <returns>A return value represents the raw body content. If the body length is larger than (int.MaxValue) bytes, the body contents will be chunked by 1024 bytes. The max length of this method is (1024 * int.MaxValue) bytes.</returns>
        public static List<byte[]> ReadRawHTTPResponseToBytes(WOPIHttpResponse wopiHttpResponse)
        {
            if (null == wopiHttpResponse)
            {
                throw new ArgumentNullException("wopiHttpResponse");
            }

            using (Stream bodyStream = wopiHttpResponse.GetResponseStream())
            {
                long contentLengthValue = wopiHttpResponse.ContentLength;
                return ReadBytesFromHttpBodyStream(bodyStream, contentLengthValue);
            }
        }
        /// <summary>
        /// A method used to log the HTTP transport information.
        /// </summary>
        /// <param name="wopiRequest">A parameter represents the request instance of a WOPI operation. It must not be null.</param>
        /// <param name="requestBody">A parameter represents the request body of a WOPI operation.</param>
        /// <param name="wopiResponse">A parameter represents the response of a WOPI operation. It must not be null if the "isResponse" parameter is true.</param>
        /// <param name="operationName">A parameter represents the WOPI operation name.</param>
        /// <param name="isResponse">A parameter represents the HTTP transport information recorded by this method whether belong to the response of a WOPI operation.</param>
        private void LogHttpTransportInfo(HttpWebRequest wopiRequest, byte[] requestBody, WOPIHttpResponse wopiResponse, WOPIOperationName operationName, bool isResponse = true)
        {
            #region validate parameters
            if (isResponse)
            {
                if (null == wopiResponse)
                {
                    throw new ArgumentNullException("wopiResponse");
                }

                // For log response, requires the request URL.
                if (null == wopiRequest)
                {
                    throw new ArgumentNullException("wopiRequest");
                }
            }
            else
            {
                if (null == wopiRequest)
                {
                    throw new ArgumentNullException("wopiRequest");
                }
            }
            #endregion 

            #region headers

            // Build headers information
            StringBuilder headerInfoBuilder = new StringBuilder();
            WebHeaderCollection headers = isResponse ? wopiResponse.Headers : wopiRequest.Headers;
            if (null != headers && 0 != headers.Count)
            {
                foreach (string oheaderNameItem in headers.AllKeys)
                {
                    string headerValueString = string.Format(
                                                         "[{0}]:({1})",
                                                         oheaderNameItem,
                                                         headers[oheaderNameItem]);

                    headerInfoBuilder.AppendLine(headerValueString);
                }
            }

            #endregion 

            #region body information

            // Build body information
            byte[] httpBodyOfResponse = null;
            if (isResponse && 0 != wopiResponse.ContentLength)
            {
                httpBodyOfResponse = WOPIResponseHelper.GetContentFromResponse(wopiResponse);
            }

            byte[] httpBody = isResponse ? httpBodyOfResponse : requestBody;
            StringBuilder bodyInfoBuilder = new StringBuilder();
            if (null != httpBody && 0 != httpBody.Length)
            {
                switch (operationName)
                {
                    case WOPIOperationName.CheckFileInfo:
                    case WOPIOperationName.ReadSecureStore:
                    case WOPIOperationName.CheckFolderInfo:
                    case WOPIOperationName.EnumerateChildren:
                        {
                            if (isResponse)
                            {
                                // log response body by JSON format
                                bodyInfoBuilder.AppendLine(Encoding.UTF8.GetString(httpBody));
                            }

                            break;
                        }

                    case WOPIOperationName.PutRelativeFile:
                        {
                            if (isResponse)
                            {
                                // log the body by JSON format
                                bodyInfoBuilder.AppendLine(Encoding.UTF8.GetString(httpBody));
                            }
                            else
                            {
                                // log the body as bytes string value
                                bodyInfoBuilder.AppendLine(WOPIResponseHelper.GetBytesStringValue(httpBody));
                            }

                            break;
                        }

                    case WOPIOperationName.GetFile:
                        {
                            if (isResponse)
                            {
                                // log the body as bytes string value
                                bodyInfoBuilder.AppendLine(WOPIResponseHelper.GetBytesStringValue(httpBody));
                            }

                            break;
                        }

                    case WOPIOperationName.PutFile:
                        {
                            if (!isResponse)
                            {
                                // log the body as bytes string value
                                bodyInfoBuilder.AppendLine(WOPIResponseHelper.GetBytesStringValue(httpBody));
                            }

                            break;
                        }
                }
            }

            #endregion 

            string credentialInfo = string.Format(
                        "User:[{0}] Domain:[{1}]",
                        this.defaultUserName,
                        this.defaultDomain);

            string logTitle = string.Format(
                                    "{0} HTTP {1}{2} for [{3}] operation:",
                                    isResponse ? "Receive" : "Sending",
                                    isResponse ? "Response" : "Request",
                                    isResponse ? string.Empty : " with " + credentialInfo,
                                    operationName);

            StringBuilder logBuilder = new StringBuilder();
            logBuilder.AppendLine(logTitle);

            string urlInfor = string.Format("Request URL:[{0}]", wopiRequest.RequestUri.AbsoluteUri);
            logBuilder.AppendLine(urlInfor);

            string httpMethodValue = string.Format("HTTP method:[{0}]", this.GetHttpMethodForWOPIOperation(operationName));
            logBuilder.AppendLine(httpMethodValue);

            if (isResponse)
            {
                string httpStatusCodeValue = string.Format("HTTP status code:[{0}]", wopiResponse.StatusCode);
                logBuilder.AppendLine(httpStatusCodeValue);
            } 

            string headerInfo = string.Format("Headers:\r\n{0}", 0 == headerInfoBuilder.Length ? "None" : headerInfoBuilder.ToString());
            logBuilder.AppendLine(headerInfo);

            string bodyInfo = string.Format("Body:\r\n{0}", 0 == bodyInfoBuilder.Length ? "None" : bodyInfoBuilder.ToString());
            logBuilder.AppendLine(bodyInfo);

            this.Site.Log.Add(LogEntryKind.Debug, logBuilder.ToString());
        }
Exemplo n.º 5
0
        /// <summary>
        /// This method is used to validate EnumerateChildren response captures.
        /// </summary>
        /// <param name="response">A parameter represents the response from server.</param>
        private void ValidateEnumerateChildrenResponse(WOPIHttpResponse response)
        {
            // All folder children messages are follow this format. If test suite receive a succeed response, capture this requirement.
            this.Site.CaptureRequirement(
                          699,
                          @"[In HTTP://server/<...>/wopi*/folder/<id>/children] The contents of a folder being accessed by WOPI are identified by the following URI:
                          HTTP://server/<...>/wopi*/folder/<id>/children");

            // All folder children messages are follow this format. If test suite receive a succeed response, capture this requirement.
            this.Site.CaptureRequirement(
                          700,
                          @"[In HTTP://server/<...>/wopi*/folder/<id>/children] The syntax URI parameters are defined by the following ABNF:
                          id = STRING");

            string jsonString = WOPIResponseHelper.ReadHTTPResponseBodyToString(response);
            EnumerateChildren enumerateChildren = WOPISerializerHelper.JsonToObject<EnumerateChildren>(jsonString);

            // Add the debug information
            this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-WOPI_R712");

            // Verify MS-WOPI requirement: MS-WOPI_R712
            // If the value is not null indicating the JSON string has been converted to EnumerateChildren type object successfully.
            this.Site.CaptureRequirementIfIsNotNull(
                          enumerateChildren,
                          712,
                          @"[In Response Body] The response body is JSON (as specified in [RFC4627]) with the following parameters:
                          JSON:
                          {
                          ""Children"":
                            [{
                              ""Name"":""<name>"",
                              ""Url"":""<url>"",
                              ""Version"":""<version>""
                             },
                          }");
        }
        /// <summary>
        /// A method is used to send http request for MS-WOPI operation.
        /// </summary>
        /// <param name="targetResourceUrl">A parameter represents the target resource Uri.</param>
        /// <param name="headers">A parameter represents the headers which is included in the http request.</param>
        /// <param name="body">A parameter represents the body contents which is sent in the http request.</param>
        /// <param name="operationName">A parameter represents the WOPI operation which the http request belongs to.</param>
        /// <returns>A return value represents the http response of the http request which is sent with specified header, URI, body and http method. </returns>
        protected virtual WOPIHttpResponse SendWOPIRequest(string targetResourceUrl, WebHeaderCollection headers, byte[] body, WOPIOperationName operationName)
        {
            HttpWebResponse responseTemp = null;
            HttpWebRequest request = null;

            request = (HttpWebRequest)HttpWebRequest.Create(targetResourceUrl);
            request.Method = this.GetHttpMethodForWOPIOperation(operationName);
            
            // Setting the required common headers
            if (null == headers)
            {
                headers = new WebHeaderCollection();
            }

            request.Headers = headers;

            if (null == body || 0 == body.Length)
            {
                request.ContentLength = 0;
            }
            else
            {
                request.ContentLength = body.Length;
                request.ContentType = "application/binary";
                Stream stream = request.GetRequestStream();
                stream.Write(body, 0, body.Length);
            }
 
            // Get the response by default user credential
            request.Credentials = new NetworkCredential(this.defaultUserName, this.defaultPassword, this.defaultDomain);
            
            // Log the HTTP request
            this.LogHttpTransportInfo(request, body, null, operationName, false);

            try
            {
                responseTemp = request.GetResponse() as HttpWebResponse;
            }
            catch (WebException webEx)
            {
                this.Site.Log.Add(
                                LogEntryKind.Debug,
                                @"There is a WebException generated when sending WOPI request. Exception message[{0}],\r\nStackTrace:[{1}]",
                                webEx.Message,
                                webEx.StackTrace);

                this.RecordWebExceptionInformation(targetResourceUrl, operationName, webEx);
                throw;
            }

            WOPIHttpResponse wopiHttpResponse = new WOPIHttpResponse(responseTemp);

            // Log the HTTP response
            this.LogHttpTransportInfo(request, null, wopiHttpResponse, operationName);

            this.ValidateCommonMessageCapture();
           
            return wopiHttpResponse;
        }
Exemplo n.º 7
0
        /// <summary>
        /// This method is used to validate CheckFolderInfo response captures.
        /// </summary>
        /// <param name="response">A parameter represents the response from server.</param>
        private void ValidateCheckFolderInfoResponse(WOPIHttpResponse response)
        {
            string jsonString = WOPIResponseHelper.ReadHTTPResponseBodyToString(response);
            CheckFolderInfo checkFolderInfo = WOPISerializerHelper.JsonToObject<CheckFolderInfo>(jsonString);

            // Add the debug information
            this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-WOPI_R602");

            // Verify MS-WOPI requirement: MS-WOPI_R602
            // The object is not null means JSON string can change to object. JSON to object check all require and optional item.
            this.Site.CaptureRequirementIfIsNotNull(
                          checkFolderInfo,
                          602,
                          @"[In Response Body] The response body is JSON (as specified in [RFC4627]) with the following parameters:
                          JSON:
                          {
                          ""FolderName"":{""type"":""string"",""optional"":false},
                          ""BreadcrumbBrandIconUrl"":{""type"":""string"",""default"":"""",""optional"":true},
                          ""BreadcrumbBrandName"":{""type"":""string"",""default"":"""",""optional"":true},
                          ""BreadcrumbBrandUrl"":{""type"":""string"",""default"":"""",""optional"":true},
                          ""BreadcrumbDocName"":{""type"":""string"",""default"":"""",""optional"":true},
                          ""BreadcrumbDocUrl"":{""type"":""string"",""default"":"""",""optional"":true},
                          ""BreadcrumbFolderName"":{""type"":""string"",""default"":"""",""optional"":true},
                          ""BreadcrumbFolderUrl"":{""type"":""string"",""default"":"""",""optional"":true},
                          ""ClientUrl"":{""type"":""string"",""default"":"""",""optional"":true},
                          ""CloseButtonClosesWindow"":{""type"":""bool"",""default"":false,""optional"":true},
                          ""CloseUrl"":{""type"":""string"",""default"":"""",""optional"":true},
                          ""FileSharingUrl"":{""type"":""string"",""default"":"""",""optional"":true},
                          ""HostAuthenticationId""{""type"":""string"",""default"":"""",""optional"":true},
                          ""HostEditUrl"":{""type"":""string"",""default"":"""",""optional"":true},
                          ""HostEmbeddedEditUrl"":{""type"":""string"",""default"":"""",""optional"":true},
                          ""HostEmbeddedViewUrl"":{""type"":""string"",""default"":"""",""optional"":true},
                          ""HostName"":{""type"":""string"",""default"":"""",""optional"":true},
                          ""HostViewUrl"":{""type"":""string"",""default"":"""",""optional"":true},
                          ""OwnerId"":{""type"":""string"",""optional"":false},
                          ""PresenceProvider""{""type"":""string"",""default"":"""",""optional"":true},
                          ""PresenceUserId""{""type"":""string"",""default"":"""",""optional"":true},
                          ""PrivacyUrl"":{""type"":""string"",""default"":"""",""optional"":true},
                          ""SignoutUrl"":{""type"":""string"",""default"":"""",""optional"":true},
                          ""SupportsSecureStore"":{""type"":""bool"",""default"":false,""optional"":true},
                          ""TenantId""{""type"":""string"",""default"":"""",""optional"":true},
                          ""TermsOfUseUrl"":{""type"":""string"",""default"":"""",""optional"":true},
                          ""UserCanWrite"":{""type"":""bool"",""default"":false,""optional"":true},
                          ""UserFriendlyName"":{""type"":""string"",""default"":"""",""optional"":true},
                          ""UserId"":{""type"":""string"",""default"":"""",""optional"":true},
                          ""WebEditingDisabled"":{""type"":""bool"",""default"":false,""optional"":true},
                          }");

            this.ValidateURL(checkFolderInfo.CloseUrl, "CloseUrl");
            this.ValidateURL(checkFolderInfo.FileSharingUrl, "FileSharingUrl");
            this.ValidateURL(checkFolderInfo.HostEmbeddedEditUrl, "HostEmbeddedEditUrl");
            this.ValidateURL(checkFolderInfo.HostEmbeddedViewUrl, "HostEmbeddedViewUrl");
            this.ValidateURL(checkFolderInfo.PrivacyUrl, "PrivacyUrl");
            this.ValidateURL(checkFolderInfo.SignoutUrl, "SignoutUrl");
        }
Exemplo n.º 8
0
        /// <summary>
        /// This method is used to validate ReadSecureStore response captures.
        /// </summary>
        /// <param name="response">A parameter represents the response from server.</param>
        private void ValidateReadSecureStoreResponse(WOPIHttpResponse response)
        {
            string jsonString = WOPIResponseHelper.ReadHTTPResponseBodyToString(response);

            // If the JSON string can be converted to the ReadSecureStore succeed, that means it match the JSON schema definition.
            WOPISerializerHelper.JsonToObject<ReadSecureStore>(jsonString);

            // If the JSON string can converted to object. The process of "JSON to object" check all require and optional item.
            this.Site.CaptureRequirement(
                          541,
                          @"[In Response Body] The response body is JSON (as specified in [RFC4627]) with the following parameters:
                          JSON:
                          {
                          ""UserName"":{""type"":""string"",""optional"":false},
                          ""Password"":{""type"":""string"",""default"":"""",""optional"":false},
                          ""IsWindowsCredentials"":{""type"":""bool"",""default"":""false"",""optional"":true},
                          ""IsGroup"":{""type"":""bool"",""default"":""false"",""optional"":true},
                          }");
        }
Exemplo n.º 9
0
        /// <summary>
        /// This method is used to validate Lock response captures.
        /// </summary>
        /// <param name="response">A parameter represents the response from server.</param>
        private void ValidateLockResponse(WOPIHttpResponse response)
        {
            // Add the debug information
            this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-WOPI_R402");

            // Verify MS-WOPI requirement: MS-WOPI_R402
            // "X-WOPI-OldLock" is not null in response means this item is required.
            this.Site.CaptureRequirementIfIsNotNull(
                          response.Headers["X-WOPI-OldLock"],
                          402,
                          @"[In Lock] X-WOPI-OldLock is Required.");
        }
Exemplo n.º 10
0
        /// <summary>
        /// This method is used to validate PutRelativeFile response captures.
        /// </summary>
        /// <param name="response">A parameter represents the response from server.</param>
        private void ValidatePutRelativeFileResponse(WOPIHttpResponse response)
        {
            string jsonString = WOPIResponseHelper.ReadHTTPResponseBodyToString(response);
            PutRelativeFile putRelativeFile = WOPISerializerHelper.JsonToObject<PutRelativeFile>(jsonString);

            // Add the debug information
            this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-WOPI_R382");

            // Verify MS-WOPI requirement: MS-WOPI_R382
            // The object is not null means JSON string can change to object. JSON to object check all require and optional item.
            this.Site.CaptureRequirementIfIsNotNull(
                          putRelativeFile,
                          382,
                          @"[In Response Body] [Name] The response body is JSON (as specified in [RFC4627]) with the following parameters:
                          JSON:
                          {
                          ""Name"":{""type"":""string"",""optional"":false},
                          ""Url"":{""type"":""string"",""default"":"""",""optional"":false},
                          ""HostViewUrl"":{""type"":""string"",""default"":"""",""optional"":true},
                          ""HostEditUrl"":{""type"":""string"",""default"":"""",""optional"":true},
                          }");
            this.ValidateURL(putRelativeFile.HostViewUrl, "HostViewUrl");
            this.ValidateURL(putRelativeFile.HostEditUrl, "HostEditUrl");
        }
Exemplo n.º 11
0
        /// <summary>
        /// This method is used to validate CheckFileInfo response captures.
        /// </summary>
        /// <param name="response">A parameter represents the response from server.</param>
        private void ValidateCheckFileInfoResponse(WOPIHttpResponse response)
        {
            string jsonString = WOPIResponseHelper.ReadHTTPResponseBodyToString(response);
            CheckFileInfo checkFileInfo = WOPISerializerHelper.JsonToObject<CheckFileInfo>(jsonString);

            // Add the debug information
            this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-WOPI_R273");

            // Verify MS-WOPI requirement: MS-WOPI_R273
            // If the value is not null indicating the JSON string has been converted to CheckFileInfo type object successfully.
            this.Site.CaptureRequirementIfIsNotNull(
                          checkFileInfo,
                          273,
                          @"[In Response Body] The response body is JavaScript Object Notation (JSON) (as specified in [RFC4627]) with the following parameters:
                          JSON:
                          {
                          ""AllowExternalMarketplace"":{""type"":""bool"",""default"":false,""optional"":true},
                          ""BaseFileName"":{""type"":""string"",""optional"":false},
                          ""BreadcrumbBrandName"":{""type"":""string"",""default"":"""",""optional"":true},
                          ""BreadcrumbBrandUrl"":{""type"":""string"",""default"":"""",""optional"":true},
                          ""BreadcrumbDocName"":{""type"":""string"",""default"":"""",""optional"":true},
                          ""BreadcrumbDocUrl"":{""type"":""string"",""default"":"""",""optional"":true},
                          ""BreadcrumbFolderName"":{""type"":""string"",""default"":"""",""optional"":true},
                          ""BreadcrumbFolderUrl"":{""type"":""string"",""default"":"""",""optional"":true},
                          ""ClientUrl"":{""type"":""string"",""default"":"""",""optional"":true},
                          ""CloseButtonClosesWindow"":{""type"":""bool"",""default"":false,""optional"":true},
                          ""CloseUrl"":{""type"":""string"",""default"":"""",""optional"":true},
                          ""DisableBrowserCachingOfUserContent"":{""type"":""bool"",""default"":false,""optional"":true},
                          ""DisablePrint"":{""type"":""bool"",""default"":false,""optional"":true},
                          ""DisableTranslation"":{""type"":""bool"",""default"":false,""optional"":true},
                          ""DownloadUrl"":{""type"":""string"",""default"":"""",""optional"":true},
                          ""FileSharingUrl"":{""type"":""string"",""default"":"""",""optional"":true}, 
                          ""FileUrl"":{""type"":""string"",""default"":"""",""optional"":true},
                          ""HostAuthenticationId""{""type"":""string"",""default"":"""",""optional"":true},
                          ""HostEditUrl"":{""type"":""string"",""default"":"""",""optional"":true},
                          ""HostEmbeddedEditUrl"":{""type"":""string"",""default"":"""",""optional"":true},
                          ""HostEmbeddedViewUrl"":{""type"":""string"",""default"":"""",""optional"":true},
                          ""HostName"":{""type"":""string"",""default"":"""",""optional"":true},
                          ""HostNotes"":{""type"":""string"",""default"":"""",""optional"":true},
                          ""HostRestUrl""{""type"":""string"",""default"":"""",""optional"":true},
                          ""HostViewUrl"":{""type"":""string"",""default"":"""",""optional"":true},
                          ""IrmPolicyDescription"":{""type"":""string"",""default"":"""",""optional"":true},
                          ""IrmPolicyTitle"":{""type"":""string"",""default"":"""",""optional"":true},
                          ""OwnerId"":{""type"":""string"",""optional"":false},
                          ""PresenceProvider""{""type"":""string"",""default"":"""",""optional"":true},
                          ""PresenceUserId""{""type"":""string"",""default"":"""",""optional"":true},
                          ""PrivacyUrl"":{""type"":""string"",""default"":"""",""optional"":true},
                          ""ProtectInClient"":{""type"":""bool"",""default"":false,""optional"":true},
                          ""ReadOnly"":{""type"":""bool"",""default"":false,""optional"":true},
                          ""RestrictedWebViewOnly"":{""type"":""bool"",""default"":false,""optional"":true},
                          ""SHA256"":{""type"":""string"",""optional"":false},
                          ""SignoutUrl"":{""type"":""string"",""default"":"""",""optional"":true},
                          ""Size"":{""type"":""int"",""optional"":false},
                          ""SupportsCoauth"":{""type"":""bool"",""default"":false,""optional"":true},
                          ""SupportsCobalt"":{""type"":""bool"",""default"":false,""optional"":true},
                          ""SupportsFolders"":{""type"":""bool"",""default"":false,""optional"":true},
                          ""SupportsLocks"":{""type"":""bool"",""default"":false,""optional"":true},
                          ""SupportsScenarioLinks"":{""type"":""bool"",""default"":false,""optional"":true},
                          ""SupportsSecureStore"":{""type"":""bool"",""default"":false,""optional"":true},
                          ""SupportsUpdate"":{""type"":""bool"",""default"":false,""optional"":true},
                          ""TenantId""{""type"":""string"",""default"":"""",""optional"":true},
                          ""TermsOfUseUrl"":{""type"":""string"",""default"":"""",""optional"":true},
                          ""TimeZone""{""type"":""string"",""default"":"""",""optional"":true},
                          ""UserCanAttend"":{""type"":""bool"",""default"":false,""optional"":true},
                          ""UserCanNotWriteRelative"":{""type"":""bool"",""default"":false,""optional"":true},
                          ""UserCanPresent"":{""type"":""bool"",""default"":false,""optional"":true},
                          ""UserCanWrite"":{""type"":""bool"",""default"":false,""optional"":true},
                          ""UserFriendlyName"":{""type"":""string"",""default"":"""",""optional"":true},
                          ""UserId"":{""type"":""string"",""default"":"""",""optional"":true},
                          ""Version"":{""type"":""string"",""optional"":false}
                          ""WebEditingDisabled"":{""type"":""bool"",""default"":false,""optional"":true},
                          }");

            if (WOPISerializerHelper.CheckContainItem(jsonString, "ReadOnly"))
            {
                // Check whether "ReadOnly" is in JSON. If JSON string contain this item,it must follow JSON response format.
                this.Site.CaptureRequirement(
                              925,
                              @"[In Response Body] ReadOnly is a Boolean value.");
            }

            if (WOPISerializerHelper.CheckContainItem(jsonString, "SupportsCoauth"))
            {
                // Check whether "SupportsCoauth" is in JSON. If JSON string contain this item,it must follow JSON response format.
                this.Site.CaptureRequirement(
                              950,
                              @"[In Response Body] SupportsCoauth is a Boolean value.");
            }

            if (WOPISerializerHelper.CheckContainItem(jsonString, "SupportsCobalt"))
            {
                // Check whether "SupportsCobalt" is in JSON. If JSON string contain this item,it must follow JSON response format.
                this.Site.CaptureRequirement(
                              775,
                              @"[In Response Body] SupportsCobalt is a Boolean value.");
            }

            if (WOPISerializerHelper.CheckContainItem(jsonString, "SupportsFolders"))
            {
                // Check whether "SupportsFolders" is in JSON. If JSON string contain this item,it must follow JSON response format.
                this.Site.CaptureRequirement(
                              777,
                              @"[In Response Body] SupportsFolders is a Boolean value.");
            }

            if (WOPISerializerHelper.CheckContainItem(jsonString, "SupportsLocks"))
            {
                // Check whether "SupportsLocks" is in JSON. If JSON string contain this item,it must follow JSON response format.
                this.Site.CaptureRequirement(
                              779,
                              @"[In Response Body] SupportsLocks is a Boolean value.");
            }

            if (WOPISerializerHelper.CheckContainItem(jsonString, "SupportsSecureStore"))
            {
                // Check whether "SupportsSecureStore" is in JSON. If JSON string contain this item,it must follow JSON response format.
                this.Site.CaptureRequirement(
                              923,
                              @"[In Response Body] SupportsSecureStore is a Boolean value.");
            }

            if (WOPISerializerHelper.CheckContainItem(jsonString, "SupportsUpdate"))
            {
                // Check whether "SupportsUpdate" is in JSON. If JSON string contain this item,it must follow JSON response format.
                this.Site.CaptureRequirement(
                              783,
                              @"[In Response Body] SupportsUpdate is a Boolean value.");
            }

            if (WOPISerializerHelper.CheckContainItem(jsonString, "UserCanNotWriteRelative"))
            {
                // Check whether "UserCanNotWriteRelative" is in JSON. If JSON string contain this item,it must follow JSON response format.
                this.Site.CaptureRequirement(
                              920,
                              @"[In Response Body] UserCanNotWriteRelative is a Boolean value.");
            }

            if (WOPISerializerHelper.CheckContainItem(jsonString, "UserCanWrite"))
            {
                // Check whether "UserCanWrite" is in JSON. If JSON string contain this item,it must follow JSON response format.
                this.Site.CaptureRequirement(
                              928,
                              @"[In Response Body] UserCanWrite is a Boolean value.");
            }

            this.ValidateURL(checkFileInfo.CloseUrl, "CloseUrl");
            this.ValidateURL(checkFileInfo.DownloadUrl, "DownloadUrl");
            this.ValidateURL(checkFileInfo.FileSharingUrl, "FileSharingUrl");
            this.ValidateURL(checkFileInfo.HostViewUrl, "HostViewUrl");
        }