Example #1
0
        public void LookingUpWhatProfilesAnIdentifierCanSupport()
        {
            var identifier        = new Identifier(TestConstants.EAN, TestConstants.TESTEAN);
            var orderService      = new UddiGuidId("uddi:b138dc71-d301-42d1-8c2e-2c3a26faf56a", true);
            var acceptedProtocols = new List <EndpointAddressTypeCode>();

            acceptedProtocols.Add(EndpointAddressTypeCode.http);
            var profileRoleIds = new List <UddiId>();

            profileRoleIds.Add(new UddiGuidId("uddi:88fbd6d5-6a25-4c08-91cc-5344c73c4d69", true));
            RegistryLookupClientFactory rlcf             = new RegistryLookupClientFactory();
            IUddiLookupClient           ulc              = rlcf.CreateUddiLookupClient();
            LookupParameters            lookupParameters = new LookupParameters(identifier, orderService, profileRoleIds, acceptedProtocols);

            List <UddiLookupResponse> results = ulc.Lookup(lookupParameters);

            Assert.IsNotNull(results);
            Assert.AreEqual(1, results.Count);
            //There is still support for getting the process roles like the Process
            //Assert.IsNotNull(results[0].Process);
            Assert.IsNotNull(results[0].ProcessRoles);
            //There is still support for getting the process roles via. the Process
            HashSet <string> names = new HashSet <string>();
            HashSet <string> processDefinitionIds = new HashSet <string>();

            foreach (var processRoleDefinition in results[0].ProcessRoles)
            {
                names.Add(processRoleDefinition.Name);
                processDefinitionIds.Add(processRoleDefinition.ProcessDefinitionId.ID);
            }
            Assert.IsTrue(names.Contains("Procurement-OrdAdv-BilSim-1.0 SellerParty"));
            // The id of the process definition
            Assert.IsTrue(processDefinitionIds.Contains("uddi:88fbd6d5-6a25-4c08-91cc-5344c73c4d69"));
        }
Example #2
0
        /// <summary>
        /// Performs a lookup in the UDDI and validates the response.
        /// </summary>
        /// <returns>Returns the UDDI response</returns>
        protected UddiLookupResponse PerformUddiLookup(LookupParameters uddiLookupParameters)
        {
            RegistryLookupClientFactory uddiClientFactory = new RegistryLookupClientFactory();
            IUddiLookupClient           uddiClient        = uddiClientFactory.CreateUddiLookupClient();
            List <UddiLookupResponse>   uddiResponses     = uddiClient.Lookup(uddiLookupParameters);

            Assert.AreEqual(1, uddiResponses.Count, "Unexcpected number of uddi results.");
            UddiLookupResponse selectedUddiResponse = uddiResponses[0];

            return(selectedUddiResponse);
        }
Example #3
0
        public void GetProcessDefinitions()
        {
            List <UddiId> uddiIds = new List <UddiId>();

            uddiIds.Add(new UddiStringId("uddi:AEE8B6DE-298F-4cbc-A96D-9AE8AED0AC31", true));
            uddiIds.Add(new UddiStringId("uddi:c001daa0-8ba3-11dd-894e-770465b08940", true));

            RegistryLookupClientFactory rlcf = new RegistryLookupClientFactory();
            IUddiLookupClient           ulc  = rlcf.CreateUddiLookupClient();

            List <ProcessDefinition> processes = ulc.GetProcessDefinitions(uddiIds);

            Assert.AreEqual(uddiIds.Count, processes.Count);
        }
Example #4
0
        static UddiLookupResponse Uddi(OiosiMessage message, DocumentTypeConfig docTypeConfig)
        {
            UddiConfig uddiConfig = ConfigurationHandler.GetConfigurationSection <UddiConfig>();

            Console.WriteLine("1. UDDI services");

            Console.ForegroundColor = ConsoleColor.Gray;
            Console.WriteLine(" Using UDDI/NemHandel register(s):");
            foreach (Registry registry in uddiConfig.LookupRegistryFallbackConfig.PrioritizedRegistryList)
            {
                foreach (string endpoint in registry.Endpoints)
                {
                    Console.WriteLine("  " + endpoint);
                }
            }

            // Create a uddi client
            RegistryLookupClientFactory uddiClientFactory = new RegistryLookupClientFactory();

            uddiClient = uddiClientFactory.CreateUddiLookupClient();

            // Get the UDDI parameters with which to call the UDDI server
            LookupParameters parameters = GetUddiParameters(message, docTypeConfig);

            Console.WriteLine(" Lookup Parameters");
            Console.WriteLine("  EndPoint      : " + parameters.Identifier.ToString());
            Console.WriteLine("  EndPoint type : " + parameters.Identifier.KeyTypeCode);
            Console.WriteLine("  Profile       : " + GetProfileName(message, docTypeConfig));

            // Perform the actual UDDI lookup
            UddiLookupResponse uddiResponse = PerformUddiLookup(parameters);

            Console.WriteLine();
            Console.ForegroundColor = ConsoleColor.White;
            Console.WriteLine(" Got UDDI reply:");
            Console.ForegroundColor = ConsoleColor.Yellow;

            if (uddiResponse == null)
            {
                Console.WriteLine("  The endpoint is no registrated in UDDI!");
            }
            else
            {
                Console.WriteLine("  " + uddiResponse.EndpointAddress.GetKeyAsString());
            }
            Console.ForegroundColor = ConsoleColor.White;

            return(uddiResponse);
        }
Example #5
0
        //static IUddiLookupClient uddiClient;


        private UddiLookupResponse Uddi(OiosiMessage message, DocumentTypeConfig docTypeConfig)
        {
            // Create a uddi client
            RegistryLookupClientFactory uddiClientFactory = new RegistryLookupClientFactory();
            IUddiLookupClient           uddiClient        = uddiClientFactory.CreateUddiLookupClient();

            // Get the UDDI parameters with which to call the UDDI server
            LookupParameters parameters = this.GetUddiParameters(message, docTypeConfig);

            // Perform the actual UDDI lookup
            UddiLookupResponse uddiResponse = this.PerformUddiLookup(parameters, uddiClient);

            // Print out info
            Console.Write("\n  1. Got UDDI reply\n       ");
            Console.ForegroundColor = ConsoleColor.Yellow;
            Console.WriteLine(uddiResponse.EndpointAddress.GetKeyAsString());
            Console.ForegroundColor = ConsoleColor.White;

            return(uddiResponse);
        }