public static IsExistElementInSoapBody ( string soapBody, string elementName ) : bool | ||
soapBody | string | A string value indicates the SOAP body. |
elementName | string | A string value indicates the element name. |
return | bool |
/// <summary> /// Verify the GetVersions operation related requirements. /// </summary> /// <param name="getVersionResult">The GetVersionsResponseGetVersionsResult object /// indicates GetVersions operation response.</param> /// <param name="soapBody">The string value indicates the SOAP body in GetVersions operation response.</param> private void VerifyGetVersions(GetVersionsResponseGetVersionsResult getVersionResult, string soapBody) { bool isSchemaVerified = SchemaValidation.ValidationResult.Equals(ValidationResult.Success); #region Verify MS-VERSS_R119 // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-VERSS_R119"); // Verify MS-VERSS requirement: MS-VERSS_R119 Site.CaptureRequirementIfIsTrue( isSchemaVerified, 119, @"[In GetVersions][The schema of GetVersions is defined as:] <wsdl:operation name=""GetVersions""> <wsdl:input message=""tns:GetVersionsSoapIn"" /> <wsdl:output message=""tns:GetVersionsSoapOut"" /> </wsdl:operation>"); #endregion #region Verify MS-VERSS_R121 // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-VERSS_R121"); // Verify MS-VERSS requirement: MS-VERSS_R121 Site.CaptureRequirementIfIsNotNull( getVersionResult, 121, @"[In GetVersions] [The protocol client sends a GetVersionsSoapIn request message,] and the protocol server responds with a GetVersionsSoapOut response message."); #endregion #region Verify MS-VERSS_R127 // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-VERSS_R127"); bool isR127Verified = AdapterHelper.IsExistElementInSoapBody(soapBody, "GetVersionsResponse"); // Verify MS-VERSS requirement: MS-VERSS_R127 Site.CaptureRequirementIfIsTrue( isR127Verified, 127, @"[In GetVersionsSoapOut] The SOAP body contains a GetVersionsResponse element."); #endregion #region Verify MS-VERSS_R130 // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-VERSS_R130"); // Verify MS-VERSS requirement: MS-VERSS_R130 Site.CaptureRequirementIfIsTrue( isSchemaVerified, 130, @"[In GetVersionsResponse][The schema of GetVersionsResponse element is defined as:] <s:element name=""GetVersionsResponse""> <s:complexType> <s:sequence> <s:element minOccurs=""1"" maxOccurs=""1"" name=""GetVersionsResult""> <s:complexType> <s:sequence> <s:element name=""results"" minOccurs=""1"" maxOccurs=""1"" type=""tns:Results"" /> </s:sequence> </s:complexType> </s:element> </s:sequence> </s:complexType> </s:element>"); #endregion this.VerifyResultsComplexType(getVersionResult.results, isSchemaVerified); }
/// <summary> /// Verify the DeleteAllVersions operation related requirements. /// </summary> /// <param name="deleteAllversionsResult">The DeleteAllVersionsResponseDeleteAllVersionsResult object /// indicates DeleteAllVersions operation response.</param> /// <param name="soapBody">The string value indicates the SOAP body in DeleteAllVersions operation response.</param> private void VerifyDeleteAllVersions( DeleteAllVersionsResponseDeleteAllVersionsResult deleteAllversionsResult, string soapBody) { bool isSchemaVerified = SchemaValidation.ValidationResult.Equals(ValidationResult.Success); #region Verify MS-VERSS_R80 // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-VERSS_R80"); // Verify MS-VERSS requirement: MS-VERSS_R80 Site.CaptureRequirementIfIsTrue( isSchemaVerified, 80, @"[In DeleteAllVersions operation][The schema of DeleteAllVersions is defined as:] <wsdl:operation name=""DeleteAllVersions""> <wsdl:input message=""tns:DeleteAllVersionsSoapIn"" /> <wsdl:output message=""tns:DeleteAllVersionsSoapOut"" /> </wsdl:operation>"); #endregion #region Verify MS-VERSS_R82 // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-VERSS_R82"); // Verify MS-VERSS requirement: MS-VERSS_R82 Site.CaptureRequirementIfIsNotNull( deleteAllversionsResult, 82, @"[In DeleteAllVersions operation] [The protocol client sends a DeleteAllVersionsSoapIn request message], and the protocol server responds with a DeleteAllVersionsSoapOut response message."); #endregion #region Verify MS-VERSS_R88 // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-VERSS_R88"); bool isR88Verified = AdapterHelper.IsExistElementInSoapBody(soapBody, "DeleteAllVersionsResponse"); // Verify MS-VERSS requirement: MS-VERSS_R88 Site.CaptureRequirementIfIsTrue( isR88Verified, 88, @"[In DeleteAllVersionsSoapOut] The SOAP body contains a DeleteAllVersionsResponse element."); #endregion #region Verify MS-VERSS_R91 // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-VERSS_R91"); // Verify MS-VERSS requirement: MS-VERSS_R91 Site.CaptureRequirementIfIsTrue( isSchemaVerified, 91, @"[In DeleteAllVersionsResponse][The schema of DeleteAllVersionsResponse element is defined as:] <s:element name=""DeleteAllVersionsResponse""> <s:complexType> <s:sequence> <s:element minOccurs=""1"" maxOccurs=""1"" name=""DeleteAllVersionsResult""> <s:complexType> <s:sequence> <s:element name=""results"" minOccurs=""1"" maxOccurs=""1"" type=""tns:Results"" /> </s:sequence> </s:complexType> </s:element> </s:sequence> </s:complexType> </s:element>"); #endregion this.VerifyResultsComplexType(deleteAllversionsResult.results, isSchemaVerified); }