Пример #1
0
        static LookupParameters GetUddiParameters(OiosiMessage message, DocumentTypeConfig docTypeConfig)
        {
            // Use an OIOSI utility to find the endpoint type in the XML document to be sent
            string endpointKeyTypeCode = Utilities.GetEndpointKeyTypeCode(message, docTypeConfig);

            // Use the XPath expression from the UBL type configuration (found in the RaspConfiguration.xml file)
            // to find the endpoint identifier in the XML document to be sent
            Identifier endpointKey = Utilities.GetEndpointKeyByXpath(
                message.MessageXml,
                docTypeConfig.EndpointType.Key.XPath,
                docTypeConfig.Namespaces,
                endpointKeyTypeCode
                );

            // create the profile tModel
            UddiId profileTModelId = GetProfileTModelId(message, docTypeConfig);

            // Find the UDDI identifier for the service contract used by the remote endpoint
            UddiId serviceContractTModel;

            try {
                serviceContractTModel = IdentifierUtility.GetUddiIDFromString(docTypeConfig.ServiceContractTModel);
            }
            catch (Exception) {
                throw new Exception("Could not find the service contract TModel for the UDDI lookup");
            }

            LookupParameters uddiLookupParameters;

            if (profileTModelId != null)
            {
                // lookup including profile
                uddiLookupParameters = new LookupParameters(
                    endpointKey,
                    serviceContractTModel,
                    new List <UddiId> {
                    profileTModelId
                },
                    new List <EndpointAddressTypeCode> {
                    EndpointAddressTypeCode.http
                });
            }
            else
            {
                // lookup without profile
                uddiLookupParameters = new LookupParameters(
                    endpointKey,
                    serviceContractTModel,
                    new List <EndpointAddressTypeCode>()
                {
                    EndpointAddressTypeCode.http
                });
            }

            return(uddiLookupParameters);
        }
Пример #2
0
        public UddiId GetNewerVersion()
        {
            keyedReference newVersKeyref;

            if (!this.categoryBag.TryGetKeyedReference(newerVersionId, out newVersKeyref))
            {
                return(null);
            }
            if (String.IsNullOrEmpty(newVersKeyref.keyValue))
            {
                return(null);
            }
            return(IdentifierUtility.GetUddiIDFromString(newVersKeyref.keyValue));
        }
Пример #3
0
        public List <ProcessRoleDefinition> GetProcessRoleDefinitions()
        {
            List <UddiTModel> processesRoleTModels = GetProcessRoleTModels();
            Converter <UddiTModel, ProcessRoleDefinition> converter = delegate(UddiTModel tmodel)
            {
                string name        = tmodel.Name;
                string description = tmodel.Description;
                string role        = tmodel.GetProfileRoleId();
                string roleType    = tmodel.GetProfileRoleTypeId();
                UddiId processDefinitionReferenceId = IdentifierUtility.GetUddiIDFromString(tmodel.GetProcessDefinitionReferenceId());
                return(new ProcessRoleDefinition(name, description, role, roleType, processDefinitionReferenceId));
            };

            return(processesRoleTModels.ConvertAll <ProcessRoleDefinition>(converter));
        }
Пример #4
0
        protected LookupParameters GetMessageParameters(OiosiMessage message, DocumentTypeConfig docTypeConfig)
        {
            string endpointKeyTypeCode = Utilities.GetEndpointKeyTypeCode(message, docTypeConfig);

            Identifier endpointKey = Utilities.GetEndpointKeyByXpath(
                message.MessageXml,
                docTypeConfig.EndpointType.Key.XPath,
                docTypeConfig.Namespaces,
                endpointKeyTypeCode
                );

            UddiId profileTModelId = GetProfileTModelId(message, docTypeConfig);

            // 2. Build MessageParameters class:
            UddiId serviceContractTModel;

            serviceContractTModel = IdentifierUtility.GetUddiIDFromString(docTypeConfig.ServiceContractTModel);

            LookupParameters uddiLookupParameters;

            if (profileTModelId == null)
            {
                uddiLookupParameters = new LookupParameters(
                    endpointKey,
                    serviceContractTModel,
                    new List <EndpointAddressTypeCode>()
                {
                    EndpointAddressTypeCode.http
                });
            }
            else
            {
                uddiLookupParameters = new LookupParameters(
                    endpointKey,
                    serviceContractTModel,
                    new List <UddiId>()
                {
                    profileTModelId
                },
                    new List <EndpointAddressTypeCode>()
                {
                    EndpointAddressTypeCode.http
                });
            }

            return(uddiLookupParameters);
        }
Пример #5
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);
        }
Пример #6
0
        private static UddiId GetProfileTModelId(OiosiMessage message, DocumentTypeConfig docTypeConfig)
        {
            UddiId uddiId      = null;
            string profileName = GetProfileName(message, docTypeConfig);

            if (string.IsNullOrEmpty(profileName) == false)
            {
                var 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("DocumentProfileMappingNotFoundException: " + profileName);
                }
            }

            return(uddiId);
        }
Пример #7
0
        private LookupParameters GetUddiParameters(OiosiMessage message, DocumentTypeConfig docTypeConfig)
        {
            // Use an OIOSI utility to find the endpoint type in the XML document to be sent
            string endpointKeyTypeCode = Utilities.GetEndpointKeyTypeCode(message, docTypeConfig);

            // Use the XPath expression from the UBL type configuration (found in the RaspConfiguration.xml file)
            // to find the endpoint identifier in the XML document to be sent
            dk.gov.oiosi.addressing.Identifier endpointKey = Utilities.GetEndpointKeyByXpath(
                message.MessageXml,
                docTypeConfig.EndpointType.Key.XPath,
                docTypeConfig.Namespaces,
                endpointKeyTypeCode
                );

            // Find the UDDI identifier for the service contract used by the remote endpoint
            UddiId serviceContractTModel;

            try {
                serviceContractTModel = IdentifierUtility.GetUddiIDFromString(docTypeConfig.ServiceContractTModel);
            }
            catch (Exception) {
                throw new Exception("Could not find the service contract TModel for the UDDI lookup");
            }


            LookupParameters uddiLookupParameters = new LookupParameters(
                endpointKey,
                serviceContractTModel,
                new List <EndpointAddressTypeCode>()
            {
                EndpointAddressTypeCode.http
            });


            return(uddiLookupParameters);
        }