Beispiel #1
0
        /// <summary>
        /// Adds a document type definition to the collection
        /// </summary>
        /// <param name="profileMapping"></param>
        public virtual void Add(ProfileMapping profileMapping)
        {
            ProfileMappingCollectionConfig configuration = ConfigurationHandler.GetConfigurationSection <ProfileMappingCollectionConfig>();

            if (!configuration.ContainsProfileMappingByName(profileMapping.Name))
            {
                configuration.AddProfileMapping(profileMapping);
            }
        }
Beispiel #2
0
        protected UddiId GetProfileTModelId(OiosiMessage message, DocumentTypeConfig docTypeConfig)
        {
            UddiId uddiId;

            // If doctype does't have a XPath expression to extract the document Profile
            // then we assume that the current document type does operate with OIOUBL profiles
            if (docTypeConfig.ProfileIdXPath == null)
            {
                uddiId = null;
            }
            else if (docTypeConfig.ProfileIdXPath.XPath == null)
            {
                uddiId = null;
            }
            else if (docTypeConfig.ProfileIdXPath.XPath.Equals(""))
            {
                uddiId = null;
            }
            else
            {
                // Fetch the OIOUBL profile name
                string profileName = DocumentXPathResolver.GetElementValueByXPathNavigator(
                    message.MessageXml,
                    docTypeConfig.ProfileIdXPath.XPath,
                    docTypeConfig.Namespaces);

                ProfileMappingCollectionConfig config = ConfigurationHandler.GetConfigurationSection <ProfileMappingCollectionConfig>();
                if (config.ContainsProfileMappingByName(profileName))
                {
                    ProfileMapping profileMapping    = config.GetMapping(profileName);
                    string         profileTModelGuid = profileMapping.TModelGuid;
                    uddiId = IdentifierUtility.GetUddiIDFromString(profileTModelGuid);
                }
                else
                {
                    throw new Exception("GetProfileTModelId failed for : " + profileName);
                }
            }

            return(uddiId);
        }