Exemplo n.º 1
0
        public void MSCPSWS_S03_TC01_HierarchyProviderSchema()
        {
            // Retrieve the schema of the current hierarchy provider.
            SPProviderSchema responseOfHierarchyProviderSchemaResult = CPSWSAdapter.HierarchyProviderSchema();

            if (responseOfHierarchyProviderSchemaResult == null)
            {
                Site.Assert.Inconclusive("There is no schema for the current hierarchy provider in the test environment!", responseOfHierarchyProviderSchemaResult);
            }
        }
 private static SPProviderSchema GetProfileSchema() {
     SPProviderSchema sPProviderSchema = new SPProviderSchema();
     sPProviderSchema.SupportsHierarchy = true;
     //sPProviderSchema.AddSchemaElement(new SPSchemaElement(EntityDataKeys.Picture, StringResourceManager.GetString(LocStringId.ClaimProvider_SchemaElementNames_Picture), SPSchemaElementType.DetailViewOnly));
     //if ((searchFlags & ProfileSearchFlags.Organization) != (ProfileSearchFlags)0) {
     //    sPProviderSchema.AddSchemaElement(new SPSchemaElement(EntityDataKeys.Leaders, StringResourceManager.GetString(LocStringId.ClaimProvider_SchemaElementNames_Leaders), SPSchemaElementType.Both));
     //    sPProviderSchema.AddSchemaElement(new SPSchemaElement(EntityDataKeys.MemberCount, StringResourceManager.GetString(LocStringId.ClaimProvider_SchemaElementNames_MemberCount), SPSchemaElementType.Both));
     //}
     //if ((searchFlags & ProfileSearchFlags.User) != (ProfileSearchFlags)0) {
     //    sPProviderSchema.AddSchemaElement(new SPSchemaElement(PeopleEditorEntityDataKeys.Email, StringResourceManager.GetString(LocStringId.ClaimProvider_SchemaElementNames_Email), SPSchemaElementType.TableViewOnly));
     //    sPProviderSchema.AddSchemaElement(new SPSchemaElement(PeopleEditorEntityDataKeys.JobTitle, StringResourceManager.GetString(LocStringId.ClaimProvider_SchemaElementNames_JobTitle), SPSchemaElementType.Both));
     //    sPProviderSchema.AddSchemaElement(new SPSchemaElement(EntityDataKeys.Location, StringResourceManager.GetString(LocStringId.ClaimProvider_SchemaElementNames_Location), SPSchemaElementType.Both));
     //    sPProviderSchema.AddSchemaElement(new SPSchemaElement(PeopleEditorEntityDataKeys.SIPAddress, StringResourceManager.GetString(LocStringId.ClaimProvider_SchemaElementNames_SIPAddress), SPSchemaElementType.DetailViewOnly));
     //    sPProviderSchema.AddSchemaElement(new SPSchemaElement(PeopleEditorEntityDataKeys.WorkPhone, StringResourceManager.GetString(LocStringId.ClaimProvider_SchemaElementNames_WorkPhone), SPSchemaElementType.TableViewOnly));
     //}
     return sPProviderSchema;
 }
Exemplo n.º 3
0
        /// <summary>
        /// A method used to retrieve a list of claims provider schemas from a list of claims providers.
        /// </summary>
        /// <param name="providerNames">A parameter represents a list of provider names.</param>
        /// <returns>A return value represents a list of claims provider schemas</returns>
        public SPProviderSchema[] ProviderSchemas(ArrayOfString providerNames)
        {
            SPProviderSchema[] responseOfProviderSchemas = new SPProviderSchema[0];
            try
            {
                responseOfProviderSchemas = this.cpswsClient.ProviderSchemas(providerNames);
                this.CaptureTransportRelatedRequirements();
            }
            catch (FaultException faultEX)
            {
                this.Site.Log.Add(
                    LogEntryKind.Debug,
                    @"There is an exception generated when calling [ProviderSchemas] method:\r\n{0}",
                    faultEX.Message);
                this.CaptureTransportRelatedRequirements();
                this.ValidateAndCaptureSOAPFaultRequirement(faultEX);
                throw;
            }

            this.VerifyProviderSchemas(responseOfProviderSchemas);

            return(responseOfProviderSchemas);
        }
Exemplo n.º 4
0
        /// <summary>
        /// A method used to retrieve schema for the current hierarchy provider.
        /// </summary>
        /// <returns>A return value represents the hierarchy claims provider schema.</returns>
        public SPProviderSchema HierarchyProviderSchema()
        {
            SPProviderSchema responseOfHierarchyProviderSchema = new SPProviderSchema();

            try
            {
                responseOfHierarchyProviderSchema = this.cpswsClient.HierarchyProviderSchema();
                this.CaptureTransportRelatedRequirements();
            }
            catch (FaultException faultEX)
            {
                this.Site.Log.Add(
                    LogEntryKind.Debug,
                    @"There is an exception generated when calling [HierarchyProviderSchema] method:\r\n{0}",
                    faultEX.Message);
                this.CaptureTransportRelatedRequirements();
                this.ValidateAndCaptureSOAPFaultRequirement(faultEX);
                throw;
            }

            this.VerifyHierarchyProviderSchema(responseOfHierarchyProviderSchema);

            return(responseOfHierarchyProviderSchema);
        }
 protected override void FillSchema(SPProviderSchema schema)
 {
     schema.AddSchemaElement(new SPSchemaElement(PeopleEditorEntityDataKeys.DisplayName, "Display nem", SPSchemaElementType.Both));
 }
 protected override void FillSchema(SPProviderSchema schema)
 {
 }
 //The schema is used by People Picker control to display the entity data.
 protected override void FillSchema(SPProviderSchema schema)
 {
     throw new NotImplementedException();
 }
 protected override void FillSchema(SPProviderSchema schema) {
     Validation.ArgumentNotNull(schema, "schema");
     schema.AddSchemaElement(
         new SPSchemaElement(PeopleEditorEntityDataKeys.AccountName, "员工编号", SPSchemaElementType.Both)
     );
 }
 protected override void FillSchema(SPProviderSchema schema)
 {
 }
Exemplo n.º 10
0
        /// <summary>
        /// A method used to verify the ProviderSchemas response. 
        /// </summary>
        /// <param name="providerSchemasResult">A parameter represents the ProviderSchemas result.</param> 
        private void VerifyProviderSchemas(SPProviderSchema[] providerSchemasResult)
        {
            XmlElement xmlResponse = SchemaValidation.LastRawResponseXml;
            bool isResponseValid = SchemaValidation.ValidationResult == ValidationResult.Success;

            if (this.ResponseExists(xmlResponse, "ProviderSchemasResponse"))
            {
                // The response have been received successfully, then the following requirement can be captured.
                Site.CaptureRequirementIfIsTrue(
                    isResponseValid,
                    258,
                    @"[In ProviderSchemas] The following is the WSDL port type specification of the ProviderSchemas WSDL operation.
<wsdl:operation name=""ProviderSchemas""  xmlns:wsdl=""http://schemas.xmlsoap.org/wsdl/"">
  <wsdl:input wsam:Action=""http://schemas.microsoft.com/sharepoint/claims/IClaimProviderWebService/ProviderSchemas"" message=""tns:IClaimProviderWebService_ProviderSchemas_InputMessage"" xmlns:wsaw=""http://www.w3.org/2006/05/addressing/wsdl""/>
  <wsdl:output wsam:Action=""http://schemas.microsoft.com/sharepoint/claims/IClaimProviderWebService/ProviderSchemasResponse"" message=""tns:IClaimProviderWebService_ProviderSchemas_OutputMessage"" xmlns:wsaw=""http://www.w3.org/2006/05/addressing/wsdl""/>
</wsdl:operation>");

                // The response have been received successfully, then the following requirement can be captured.
                Site.CaptureRequirementIfIsTrue(
                    isResponseValid,
                    259,
                    @"[In ProviderSchemas] The protocol client sends an IClaimProviderWebService_ProviderSchemas_InputMessage (section 3.1.4.7.1.1) request WSDL message and the protocol server responds with an IClaimProviderWebService_ProviderSchemas_OutputMessage (section 3.1.4.7.1.2) response message.");
                
                // If the response is contained in the response raw XML, then the following requirement can be captured.
                Site.CaptureRequirementIfIsTrue(
                    this.ResponseExists(xmlResponse, "ProviderSchemasResponse"),
                    269,
                    @"[In IClaimProviderWebService_ProviderSchemas_OutputMessage] The SOAP body contains the ProviderSchemasResponse element.");

                if (providerSchemasResult != null)
                {
                    // If the response passed the XML validation, then the following requirement can be captured.
                    Site.CaptureRequirementIfIsTrue(
                        isResponseValid,
                        272,
                        @"[In ProviderSchemasResponse] The ProviderSchemasResponse element specifies the result data for the ProviderSchemas WSDL operation.
<xs:element name=""ProviderSchemasResponse"" xmlns:xs=""http://www.w3.org/2001/XMLSchema"">
  <xs:complexType>
    <xs:sequence>
      <xs:element minOccurs=""0"" maxOccurs=""1"" name=""ProviderSchemasResult"" type=""tns:ArrayOfSPProviderSchema""/>
    </xs:sequence>
  </xs:complexType>
</xs:element>");

                    // If the response passed the XML validation, then the following requirement can be captured.
                    Site.CaptureRequirementIfIsTrue(
                        isResponseValid,
                        275,
                        @"[In ArrayOfSPProviderSchema] An array of SPProviderSchema (section 2.2.4.14) elements.
<xs:complexType name=""ArrayOfSPProviderSchema"" xmlns:xs=""http://www.w3.org/2001/XMLSchema"">
  <xs:sequence>
    <xs:element minOccurs=""0"" maxOccurs=""unbounded"" name=""SPProviderSchema"" nillable=""true"" type=""tns:SPProviderSchema""/>
  </xs:sequence>
</xs:complexType>");

                    if (providerSchemasResult.Length > 0)
                    {
                        foreach (SPProviderSchema providerSchema in providerSchemasResult)
                        {
                            this.VerifySPProviderSchemaComplexType(providerSchema);
                        }
                    }
                }
            }
        }
Exemplo n.º 11
0
        /// <summary>
        /// A method used to verify the HierarchyProviderSchema response. 
        /// </summary>
        /// <param name="hierarchyProviderSchemaResult">A parameter represents the HierarchyProviderSchema result.</param> 
        private void VerifyHierarchyProviderSchema(SPProviderSchema hierarchyProviderSchemaResult)
        {
            XmlElement xmlResponse = SchemaValidation.LastRawResponseXml;
            bool isResponseValid = SchemaValidation.ValidationResult == ValidationResult.Success;

            if (this.ResponseExists(xmlResponse, "HierarchyProviderSchemaResponse"))
            {
                // The response have been received successfully, then the following requirement can be captured.
                Site.CaptureRequirementIfIsTrue(
                    isResponseValid,
                    242,
                    @"[In HierarchyProviderSchema] The following is the WSDL port type specification of the HierarchyProviderSchema WSDL operation.

<wsdl:operation name=""HierarchyProviderSchema"" xmlns:wsdl=""http://schemas.xmlsoap.org/wsdl/"">
  <wsdl:input wsam:Action=""http://schemas.microsoft.com/sharepoint/claims/IClaimProviderWebService/HierarchyProviderSchema"" message=""tns:IClaimProviderWebService_HierarchyProviderSchema_InputMessage""/>
  <wsdl:output wsam:Action=""http://schemas.microsoft.com/sharepoint/claims/IClaimProviderWebService/HierarchyProviderSchemaResponse"" message=""tns:IClaimProviderWebService_HierarchyProviderSchema_OutputMessage""/>
</wsdl:operation>");

                // The response have been received successfully, then the following requirement can be captured.
                Site.CaptureRequirementIfIsTrue(
                    isResponseValid,
                    243,
                    @"[In HierarchyProviderSchema] The protocol client sends an IClaimProviderWebService_HierarchyProviderSchema_InputMessage (section 3.1.4.6.1.1) request WSDL message and the protocol server responds with an IClaimProviderWebService_HierarchyProviderSchema_OutputMessage (section 3.1.4.6.1.2) response message.");

                // If the response is contained in the response raw XML, then the following requirement can be captured.
                Site.CaptureRequirementIfIsTrue(
                    this.ResponseExists(xmlResponse, "HierarchyProviderSchemaResponse"),
                    253,
                    @"[In IClaimProviderWebService_HierarchyProviderSchema_OutputMessage] The SOAP body contains the HierarchyProviderSchemaResponse element.");

                if (hierarchyProviderSchemaResult != null)
                {
                    // If the response passed the XML validation, then the following requirement can be captured.
                    Site.CaptureRequirementIfIsTrue(
                        isResponseValid,
                        255,
                        @"[In HierarchyProviderSchema] The HierarchyProviderSchemaResponse element specifies the result data for the HierarchyProviderSchema WSDL operation.
<xs:element name=""HierarchyProviderSchemaResponse"" xmlns:xs=""http://www.w3.org/2001/XMLSchema"">
  <xs:complexType>
    <xs:sequence>
      <xs:element minOccurs=""0"" maxOccurs=""1"" name=""HierarchyProviderSchemaResult"" type=""tns:SPProviderSchema""/>
    </xs:sequence>
  </xs:complexType>
</xs:element>");

                    this.VerifySPProviderSchemaComplexType(hierarchyProviderSchemaResult);
                }
            }
        }
Exemplo n.º 12
0
        /// <summary>
        /// A method used to verify the SPProviderSchema complex type.
        /// </summary>
        /// <param name="providerSchema">A parameter represents an instance of the SPProviderSchema complex type.</param>
        private void VerifySPProviderSchemaComplexType(SPProviderSchema providerSchema)
        {
            bool isResponseValid = SchemaValidation.ValidationResult == ValidationResult.Success;

            if (providerSchema != null)
            {
                // If the response passed XML validation, then the following requirement can be captured.
                Site.CaptureRequirementIfIsTrue(
                    isResponseValid,
                    74,
                    @"[In SPProviderSchema] The user interface display characteristics of a claims provider.
<xs:complexType name=""SPProviderSchema"" xmlns:xs=""http://www.w3.org/2001/XMLSchema"">
  <xs:sequence>
    <xs:element minOccurs=""0"" maxOccurs=""1"" name=""DisplayName"" type=""xs:string""/>
    <xs:element minOccurs=""0"" maxOccurs=""1"" name=""ProviderName"" type=""xs:string""/>
    <xs:element minOccurs=""0"" maxOccurs=""1"" name=""ProviderSchema"" type=""tns:ArrayOfSPSchemaElement""/>
    <xs:element minOccurs=""1"" maxOccurs=""1"" name=""SupportsHierarchy"" type=""xs:boolean""/>
  </xs:sequence>
</xs:complexType>");

                if (providerSchema.ProviderSchema != null)
                {
                    // If the response passed XML validation, then the following requirement can be captured.
                    Site.CaptureRequirementIfIsTrue(
                        isResponseValid,
                        99,
                        @"[In SPSchemaElementType] The display type of a field.
<xs:simpleType name=""SPSchemaElementType"" xmlns:xs=""http://www.w3.org/2001/XMLSchema"">
  <xs:restriction base=""xs:string"">
    <xs:enumeration value=""None""/>
    <xs:enumeration value=""TableViewOnly""/>
    <xs:enumeration value=""DetailViewOnly""/>
    <xs:enumeration value=""Both""/>
  </xs:restriction>
</xs:simpleType>");

                    // If the response passed XML validation, then the following requirement can be captured.
                    Site.CaptureRequirementIfIsTrue(
                        isResponseValid,
                        42,
                        @"[In ArrayOfSPSchemaElement] ArrayOfSPSchemaElement: An array of SPSchemaElement (section 2.2.4.15) elements.
<xs:complexType name=""ArrayOfSPSchemaElement"" xmlns:xs=""http://www.w3.org/2001/XMLSchema"">
  <xs:sequence>
    <xs:element minOccurs=""0"" maxOccurs=""unbounded"" name=""SPSchemaElement"" nillable=""true"" type=""tns:SPSchemaElement""/>
  </xs:sequence>
</xs:complexType>");

                    if (providerSchema.ProviderSchema.Length > 0)
                    {
                        this.VerifySPSchemaElementComplexType(isResponseValid);
                    }
                }
            }
        }
 protected override void FillSchema(SPProviderSchema schema)
 {
     schema.AddSchemaElement(new SPSchemaElement(PeopleEditorEntityDataKeys.DisplayName, "DisplayName",
                                                 SPSchemaElementType.TableViewOnly));
 }
Exemplo n.º 14
0
 protected override void FillSchema(SPProviderSchema schema)
 {
     // Add the schema element that we need at a minimum in our picker node.
     schema.AddSchemaElement(new
           SPSchemaElement(PeopleEditorEntityDataKeys.DisplayName,
           "Display Name", SPSchemaElementType.Both));
 }
        /// <summary>
        /// A method used to retrieve a list of claims provider schemas from a list of claims providers.
        /// </summary>
        /// <param name="providerNames">A parameter represents a list of provider names.</param>
        /// <returns>A return value represents a list of claims provider schemas</returns>
        public SPProviderSchema[] ProviderSchemas(ArrayOfString providerNames)
        {
            SPProviderSchema[] responseOfProviderSchemas = new SPProviderSchema[0];
            try
            {
                responseOfProviderSchemas = this.cpswsClient.ProviderSchemas(providerNames);
                this.CaptureTransportRelatedRequirements();
            }
            catch (FaultException faultEX)
            {
                this.Site.Log.Add(
                                LogEntryKind.Debug,
                                @"There is an exception generated when calling [ProviderSchemas] method:\r\n{0}",
                                faultEX.Message);
                this.CaptureTransportRelatedRequirements();
                this.ValidateAndCaptureSOAPFaultRequirement(faultEX);
                throw;
            }

            this.VerifyProviderSchemas(responseOfProviderSchemas);

            return responseOfProviderSchemas;
        }
        /// <summary>
        /// A method used to retrieve schema for the current hierarchy provider.
        /// </summary>
        /// <returns>A return value represents the hierarchy claims provider schema.</returns>
        public SPProviderSchema HierarchyProviderSchema()
        {
            SPProviderSchema responseOfHierarchyProviderSchema = new SPProviderSchema();
            try
            {
                responseOfHierarchyProviderSchema = this.cpswsClient.HierarchyProviderSchema();
                this.CaptureTransportRelatedRequirements();
            }
            catch (FaultException faultEX)
            {
                this.Site.Log.Add(
                                LogEntryKind.Debug,
                                @"There is an exception generated when calling [HierarchyProviderSchema] method:\r\n{0}",
                                faultEX.Message);
                this.CaptureTransportRelatedRequirements();
                this.ValidateAndCaptureSOAPFaultRequirement(faultEX);
                throw;
            }

            this.VerifyHierarchyProviderSchema(responseOfHierarchyProviderSchema);

            return responseOfHierarchyProviderSchema;
        }