A class used to store the response data of "CopyIntoItems" operation.
Ejemplo n.º 1
0
        /// <summary>
        /// A method used to verify CopyIntoItems operation related captures.
        /// </summary>
        /// <param name="response">A parameter represents the response of CopyIntoItems operation.</param>
        /// <param name="destinationUrlsInRequest">A parameter represents the destination URL items which is passed in the request.</param>
        private void VerifyCopyIntoItemsOperationCapture(CopyIntoItemsResponse response, string[] destinationUrlsInRequest)
        {
            if (null == response)
            {
                throw new ArgumentNullException("response");
            }

            this.VerifyTransPortAndSOAPCapture();

            // If schema validation is successful, the request and response schema definition related requirements: MS-COPYS_R204, MS-COPYS_R239, MS-COPYS_R240, MS-COPYS_R241, MS-COPYS_R255, MS-COPYS_R258 can be directly captured.
            this.Site.CaptureRequirement(
                204,
                @"[In CopyIntoItems] [The protocol client sends a CopyIntoItemsoapIn request message (section 3.1.4.2.1.1) and] the protocol server responds with a CopyIntoItemsoapOut response message (section 3.1.4.2.1.2 ) as follows.");

            // Verified requirement: MS-COPYS_R239
            this.Site.CaptureRequirement(
                239,
                @"[In CopyIntoItemsSoapOut] The CopyIntoItemsSoapOut message is the response WSDL message for a CopyIntoItems WSDL operation (section 3.1.4.2).");

            // Verified requirement: MS-COPYS_R240
            this.Site.CaptureRequirement(
                240,
                @"[In CopyIntoItemsSoapOut] The SOAP action value of the message is defined as:
http://schemas.microsoft.com/sharepoint/soap/CopyIntoItems");

            // Verified requirement: MS-COPYS_R241
            this.Site.CaptureRequirement(
                241,
                @"[In CopyIntoItemsSoapOut] The SOAP body contains a CopyIntoItemsResponse element (section 3.1.4.2.2.2).");

            // Verified requirement: MS-COPYS_R202
            this.Site.CaptureRequirement(
                202,
                @"[In CopyIntoItems] [The schema of the operation CopyIntoItems is defined as:] <wsdl:operation name=""CopyIntoItems"">
                <wsdl:input message=""tns:CopyIntoItemsoapIn"" />
                <wsdl:output message=""tns:CopyIntoItemsoapOut"" />
            </wsdl:operation>");

            // Verified requirement: MS-COPYS_R255
            this.Site.CaptureRequirement(
                255,
                @"[In CopyIntoItemsResponse] [The schema of the CopyIntoItemsResponse is defined as: ]  <s:element name=""CopyIntoItemsResponse"">
  <s:complexType>
    <s:sequence>
      <s:element minOccurs=""1"" maxOccurs=""1"" name=""CopyIntoItemsResult"" type=""s:unsignedInt"" />
      <s:element minOccurs=""0"" maxOccurs=""1"" name=""Results"" type=""tns:CopyResultCollection"" />
    </s:sequence>
  </s:complexType>
</s:element>");

            this.Site.CaptureRequirementIfIsTrue(
                response.CopyIntoItemsResult.Equals(0),
                258,
                @"[In CopyIntoItemsResponse] [CopyIntoItemsResult] The protocol server MUST set this value to zero (""0"").");

            // Verify Copy result collection and all copy result items in the collection
            this.VerifyCopyResultCollection(response.Results, destinationUrlsInRequest);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// A method used to copy a file to a destination server that is different from the source location.
        /// </summary>
        /// <param name="sourceUrl">A parameter represents the absolute URL of the file in the source location.</param>
        /// <param name="destinationUrls">A parameter represents a collection of locations on the destination server.</param>
        /// <param name="fields">A parameter represents a collection of the metadata for the file.</param>
        /// <param name="rawStreamValue">A parameter represents the contents of the file. The contents will be encoded in Base64 format and sent in request.</param>
        /// <returns>A return value represents the result of the operation.</returns>
        public CopyIntoItemsResponse CopyIntoItems(string sourceUrl, string[] destinationUrls, FieldInformation[] fields, byte[] rawStreamValue)
        {
            CopyIntoItemsResponse copyIntoItemsResponse;
            uint copyIntoItemsResult;

            CopyResult[] results;
            try
            {
                copyIntoItemsResult   = this.copySoapService.CopyIntoItems(sourceUrl, destinationUrls, fields, rawStreamValue, out results);
                copyIntoItemsResponse = new CopyIntoItemsResponse(copyIntoItemsResult, results);
            }
            catch (SoapException)
            {
                throw;
            }

            this.VerifyCopyIntoItemsOperationCapture(copyIntoItemsResponse, destinationUrls);
            return(copyIntoItemsResponse);
        }
        /// <summary>
        /// A method used to copy a file to a destination server that is different from the source location.
        /// </summary>
        /// <param name="sourceUrl">A parameter represents the absolute URL of the file in the source location.</param>
        /// <param name="destinationUrls">A parameter represents a collection of locations on the destination server.</param>
        /// <param name="fields">A parameter represents a collection of the metadata for the file.</param>
        /// <param name="rawStreamValue">A parameter represents the contents of the file. The contents will be encoded in Base64 format and sent in request.</param>
        /// <returns>A return value represents the result of the operation.</returns>
        public CopyIntoItemsResponse CopyIntoItems(string sourceUrl, string[] destinationUrls, FieldInformation[] fields, byte[] rawStreamValue)
        {
            CopyIntoItemsResponse copyIntoItemsResponse;
            uint copyIntoItemsResult;
            CopyResult[] results;
            try
            {   
                copyIntoItemsResult = this.copySoapService.CopyIntoItems(sourceUrl, destinationUrls, fields, rawStreamValue, out results);
                copyIntoItemsResponse = new CopyIntoItemsResponse(copyIntoItemsResult, results);
            }
            catch (SoapException soapEx)
            {
                this.VerifySoapExceptionDetailCapture(soapEx);
                throw;
            }

            this.VerifyCopyIntoItemsOperationCapture(copyIntoItemsResponse, destinationUrls);
            return copyIntoItemsResponse;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// A method used to verify CopyIntoItems operation related captures. 
        /// </summary>
        /// <param name="response">A parameter represents the response of CopyIntoItems operation.</param>
        /// <param name="destinationUrlsInRequest">A parameter represents the destination URL items which is passed in the request.</param>
        private void VerifyCopyIntoItemsOperationCapture(CopyIntoItemsResponse response, string[] destinationUrlsInRequest)
        {
            if (null == response)
            {
                throw new ArgumentNullException("response");
            }

            this.VerifyTransPortAndSOAPCapture();

            // If schema validation is successful, the request and response schema definition related requirements: MS-COPYS_R204, MS-COPYS_R239, MS-COPYS_R241, MS-COPYS_R255, MS-COPYS_R258 can be directly captured. 
            this.Site.CaptureRequirement(
                204,
                @"[In CopyIntoItems] [The protocol client sends a CopyIntoItemsoapIn request message (section 3.1.4.2.1.1) and] the protocol server responds with a CopyIntoItemsoapOut response message (section 3.1.4.2.1.2 ) as follows.");

            // Verified requirement: MS-COPYS_R239
            this.Site.CaptureRequirement(
                239,
                @"[In CopyIntoItemsSoapOut] The CopyIntoItemsSoapOut message is the response WSDL message for a CopyIntoItems WSDL operation (section 3.1.4.2).");

            // Verified requirement: MS-COPYS_R241
            this.Site.CaptureRequirement(
                241,
                @"[In CopyIntoItemsSoapOut] The SOAP body contains a CopyIntoItemsResponse element (section 3.1.4.2.2.2).");

            // Verified requirement: MS-COPYS_R202
            this.Site.CaptureRequirement(
                202,
                @"[In CopyIntoItems] [The schema of the operation CopyIntoItems is defined as:] <wsdl:operation name=""CopyIntoItems"">
                <wsdl:input message=""tns:CopyIntoItemsoapIn"" />
                <wsdl:output message=""tns:CopyIntoItemsoapOut"" />
            </wsdl:operation>");

            // Verified requirement: MS-COPYS_R255
            this.Site.CaptureRequirement(
                255,
                @"[In CopyIntoItemsResponse] [The schema of the CopyIntoItemsResponse is defined as: ]  <s:element name=""CopyIntoItemsResponse"">
  <s:complexType>
    <s:sequence>
      <s:element minOccurs=""1"" maxOccurs=""1"" name=""CopyIntoItemsResult"" type=""s:unsignedInt"" />
      <s:element minOccurs=""0"" maxOccurs=""1"" name=""Results"" type=""tns:CopyResultCollection"" />
    </s:sequence>
  </s:complexType>
</s:element>");

            this.Site.CaptureRequirementIfIsTrue(
                response.CopyIntoItemsResult.Equals(0),
                258,
                @"[In CopyIntoItemsResponse] [CopyIntoItemsResult] The protocol server MUST set this value to zero (""0"").");

            // Verify Copy result collection and all copy result items in the collection
            this.VerifyCopyResultCollection(response.Results, destinationUrlsInRequest);
        }