private void VerifyExportSolution(string exportSolutionResultURL)
{
Site.Log.Add(LogEntryKind.Comment, "Verify common requirements in ExportSolution operation.");
this.VerifyCommonReqs();
// When code can run to this line, it indicates the soap out message for this operation is received, else the operation will throw exception above.
// So this operation's description is consistent with server.
Site.CaptureRequirement(
25,
@"[In ExportSolution] [The ExportSolution operation is defined as:]
<wsdl:operation name=""ExportSolution"">
<wsdl:input message=""tns:ExportSolutionSoapIn"" />
<wsdl:output message=""tns:ExportSolutionSoapOut"" />
</wsdl:operation>");
bool isSchemaRight = SchemaValidation.XmlValidationErrors.Count == 0 && SchemaValidation.XmlValidationWarnings.Count == 0;
// When the variable isSchemaRight is true, it exposes that the message's format described in the Open Specification is consistent with server. So we can verify R27.
Site.Log.Add(LogEntryKind.Debug, "Verify MS-SITESS_R27");
// Verify MS-SITESS requirement: MS-SITESS_R27
Site.CaptureRequirementIfIsTrue(
isSchemaRight,
27,
@"[In ExportSolution] [The client sends an ExportSolutionSoapIn request message and] the server responds with an ExportSolutionSoapOut response message.");
// When the variable isSchemaRight is true, it exposes that the message's format described in the Open Specification is consistent with server. So we can verify R33.
Site.Log.Add(LogEntryKind.Debug, "Verify MS-SITESS_R33");
// Verify MS-SITESS requirement: MS-SITESS_R33
Site.CaptureRequirementIfIsTrue(
isSchemaRight,
33,
@"[In ExportSolutionSoapOut] The SOAP body contains an ExportSolutionResponse element.");
// When the variable isSchemaRight is true, it exposes that the message's format described in the Open Specification is consistent with server. So we can verify R50.
Site.Log.Add(LogEntryKind.Debug, "Verify MS-SITESS_R50");
// Verify MS-SITESS requirement: MS-SITESS_R50
Site.CaptureRequirementIfIsTrue(
isSchemaRight,
50,
@"[In ExportSolutionResponse] [The ExportSolutionResponse element is defined as:] <s:element name=""ExportSolutionResponse"">
<s:complexType>
<s:sequence>
<s:element name=""ExportSolutionResult"" minOccurs=""1"" maxOccurs=""1"" type=""s:string"" />
</s:sequence>
</s:complexType>
</s:element>");
// If ExportSolution operation succeeds, we can verify whether ExportSolutionResult is a site-collection relative URL.
Site.Log.Add(LogEntryKind.Debug, "Verify MS-SITESS_R432, the exportSolutionResultURL is {0}.", exportSolutionResultURL);
// Verify MS-SITESS requirement: MS-SITESS_R432
bool isVerifyR432 = Uri.IsWellFormedUriString(exportSolutionResultURL, UriKind.Relative) && exportSolutionResultURL.Substring(0, 1) != "/";
Site.CaptureRequirementIfIsTrue(
isVerifyR432,
432,
@"[In ExportSolutionResponse] ExportSolutionResult: It MUST be the site-collection relative URL of the created solution file.");
}