Example #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);
        }
Example #2
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);
        }
Example #3
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);
        }