예제 #1
0
        /// <summary>
        /// Adds a meeting to an existing workspace based on a calendar object.
        /// </summary>
        /// <param name="organizerEmail">The e-mail address of the meeting organizer.</param>
        /// <param name="icalText">Information about the meeting instance to add.</param>
        /// <returns>The aggregation of AddMeetingFromICalResponseAddMeetingFromICalResult response or SoapException thrown.</returns>
        public SoapResult <AddMeetingFromICalResponseAddMeetingFromICalResult> AddMeetingFromICal(string organizerEmail, string icalText)
        {
            AddMeetingFromICalResponseAddMeetingFromICalResult result = null;
            SoapException exception = null;

            try
            {
                // Call AddMeetingFromIcal method.
                result = this.service.AddMeetingFromICal(organizerEmail, icalText);

                // As response successfully returned, the transport related requirements can be captured.
                this.CaptureTransportRelatedRequirements();
                this.ValidateAndCaptureCommonMessageSyntax();
                this.VerifyAddMeetingFromICalResponse(result);
            }
            catch (SoapException ex)
            {
                exception = ex;

                // As response successfully returned, the transport related requirements can be captured.
                this.CaptureTransportRelatedRequirements();

                // Validate soap fault message structure and capture related requirements.
                this.ValidateAndCaptureSoapFaultRequirements(exception);
            }

            return(new SoapResult <AddMeetingFromICalResponseAddMeetingFromICalResult>(result, exception));
        }
예제 #2
0
        /// <summary>
        /// Verifies the response of AddMeetingFromICal.
        /// </summary>
        /// <param name="result">The response information of AddMeetingFromICal</param>
        private void VerifyAddMeetingFromICalResponse(AddMeetingFromICalResponseAddMeetingFromICalResult result)
        {
            bool isResponseValid = ValidationResult.Success == SchemaValidation.ValidationResult;

            // If the server response pass the validation successfully, we can make sure that the server responds with an AddMeetingFromICalSoapOut response message.
            Site.CaptureRequirementIfIsTrue(
                isResponseValid,
                68,
                @"[In AddMeetingFromICal]This operation [AddMeetingFromICal method]is defined as follows. 
                <wsdl:operation name=""AddMeetingFromICal"">
                   <wsdl:input message=""AddMeetingFromICalSoapIn"" />
                   <wsdl:output message=""AddMeetingFromICalSoapOut"" />
                </wsdl:operation>");

            // If the server response pass the validation successfully, we can make sure that the server responds with an AddMeetingFromICalSoapOut response message.
            Site.CaptureRequirementIfIsTrue(
                isResponseValid,
                70,
                @"[In AddMeetingFromICal][if the client sends an AddMeetingFromICalSoapIn request message]The protocol server responds with an AddMeetingFromICalSoapOut response message (section 3.1.4.2.1.2).");

            // Verifies MS-MEETS requirement: MS-MEETS_R77.
            Site.CaptureRequirementIfIsTrue(
                this.ResponseExists(SchemaValidation.LastRawResponseXml, "AddMeetingFromICalResponse"),
                77,
                @"[In AddMeetingFromICalSoapOut]The SOAP body contains an AddMeetingFromICalResponse element (section 3.1.4.2.2.2).");

            // If the server response pass the validation successfully, we can make sure that the AddMeetingFromICal operation does not support non-Gregorian recurring meetings.
            // Verify MS-MEETS requirement: MS-MEETS_R71.
            Site.CaptureRequirementIfIsTrue(
                isResponseValid,
                71,
                @"[In AddMeetingFromICal]The AddMeeting operation (section 3.1.4.1) MUST be used when adding meetings not based on the Gregorian calendar because this operation [AddMeetingFromICal]does not support non-Gregorian recurring meetings.");

            // If the server response pass the validation successfully, we can make sure that the AddMeetingFromICalResponse is defined according to the schema.
            // Verifies MS-MEETS requirement: MS-MEETS_R86.
            Site.CaptureRequirementIfIsTrue(
                isResponseValid,
                86,
                @"[In AddMeetingFromICalResponse]This element [AddMeetingFromICalResponse]is defined as follows. 
                    <s:element name=""AddMeetingFromICalResponse"">
                      <s:complexType>
                        <s:sequence>
                          <s:element name=""AddMeetingFromICalResult"" minOccurs=""0"">
                            <s:complexType mixed=""true"">
                              <s:sequence>
                                <s:element name=""AddMeetingFromICal"" type=""tns:AddMeetingFromICal"" />
                              </s:sequence>
                            </s:complexType>
                          </s:element>
                        </s:sequence>
                      </s:complexType>
                    </s:element>");

            // Verifies MS-MEETS requirement: MS-MEETS_R902.
            Site.CaptureRequirementIfIsTrue(
                isResponseValid,
                902,
                @"[In AddMeetingFromICal]This type is defined as follows.
                 <s:complexType name=""AddMeetingFromICal"">
                   < s:complexContent >
                     < s:extension base = ""tns:AddMeeting"" >
                       < s:sequence >
                         < s:element name = ""AttendeeUpdateStatus"" type = ""tns:AttendeeUpdateStatus"" />
                       </ s:sequence >
                     </ s:extension >
                   </ s:complexContent >
                 </ s:complexType > ");

            if (result != null)
            {
                // If AddMeetingFromICalResult element exist, and the server response pass the validation successfully, 
                // we can make sure AddMeetingFromICal is defined according to the schema.
                // Verifies MS-MEETS requirement: MS-MEETS_R8601.
                Site.CaptureRequirementIfIsTrue(
                    isResponseValid,
                    8601,
                    @"[In AddMeetingFromICalResponse] [AddMeetingFromICal complex type is defined as follows: ]
                    <s:complexType name=""AddMeetingFromICal"">
                      <s:complexContent>
                        <s:extension base=""tns:AddMeeting"">
                          <s:sequence>
                            <s:element name=""AttendeeUpdateStatus"" type=""tns:AttendeeUpdateStatus"" />
                          </s:sequence>
                        </s:extension>
                      </s:complexContent>
                    </s:complexType>");

                // If AddMeetingFromICalResult element exist, and the server response pass the validation successfully, 
                // we can make sure AddMeetingFromICal is defined according to the schema.
                this.VerifyAddMeetingComplexType(isResponseValid);

                // If AddMeetingFromICalResult element exist, and the server response pass the validation successfully, 
                // we can make sure AttendeeUpdateStatus is defined according to the schema.
                this.VerifyAttendeeUpdateStatusComplexType(isResponseValid);

                // If the server response pass the validation successfully, MS-MEETS_R87 can be verified.
                Site.CaptureRequirementIfIsTrue(
                    isResponseValid,
                    87,
                    @"[In AddMeetingFromICalResponse]AddMeetingFromICalResult: The response XML consists of two elements containing information about the meeting instance newly-added to the Meeting Workspace.");
            }
        }