예제 #1
0
        private IList <UddiService> GetUddiServices(Identifier organizationIdentifier, UddiId serviceUddiId, string profileConformanceClaim)
        {
            keyedReference profileConformanceClaimKeyReference = new keyedReference();

            profileConformanceClaimKeyReference.tModelKey = "uddi:cc5f1df6-ae0a-4781-b24a-f30315893af7";
            profileConformanceClaimKeyReference.keyName   = "http://oio.dk/profiles/OWSA/modelT/1.0/UDDI/Categories/profileConformanceClaim/";
            profileConformanceClaimKeyReference.keyValue  = profileConformanceClaim;

            keyedReference registrationConformanceClaim = new keyedReference();

            registrationConformanceClaim.tModelKey = "uddi:80496ef5-4d24-4788-a3f8-12fb54a75106";
            registrationConformanceClaim.keyName   = "http://oio.dk/profiles/OWSA/modelT/1.0/UDDI/Categories/registrationConformanceClaim/";
            registrationConformanceClaim.keyValue  = RASPREGISTRATIONCONFORMANCECLAIM;

            keyedReference endpointKeyType = new keyedReference();

            endpointKeyType.tModelKey = "uddi:182a4a2b-3717-4283-b97c-55cc3b684dae";
            endpointKeyType.keyName   = "http://oio.dk/profiles/OIOSI/1.0/UDDI/Categories/endpointKeyType/";
            endpointKeyType.keyValue  = organizationIdentifier.KeyTypeCode;

            keyedReference endpointKey = new keyedReference();

            endpointKey.tModelKey = "uddi:e733684d-9f40-40ff-8807-1d80abc7c665";
            endpointKey.keyName   = "http://oio.dk/profiles/OIOSI/1.0/UDDI/Categories/endpointKey/";
            endpointKey.keyValue  = organizationIdentifier.GetAsString();

            keyedReference[] categories = new[] { profileConformanceClaimKeyReference, registrationConformanceClaim, endpointKeyType, endpointKey };

            categoryBag serviceCategories = new categoryBag {
                Items = categories
            };

            find_service findService = new find_service();

            findService.findQualifiers = new string[] { FindQualifers.andAllKeys.ToString() };
            if (serviceUddiId != null)
            {
                findService.tModelBag = new string[] { serviceUddiId.ID };
            }
            findService.categoryBag = serviceCategories;

            serviceList listOfServices = this.uddiProxy.find_service(findService);

            List <string> endPointUddiIds = new List <string>();

            if (listOfServices.serviceInfos == null)
            {
                return(new List <UddiService>());
            }
            foreach (serviceInfo service in listOfServices.serviceInfos)
            {
                endPointUddiIds.Add(service.serviceKey);
            }

            // Har uddi-ID på service endpoint, skal finde endpoint uri
            get_serviceDetail getServiceDetail = new get_serviceDetail();

            getServiceDetail.serviceKey = endPointUddiIds.ToArray();
            serviceDetail detail = this.uddiProxy.get_serviceDetail(getServiceDetail);

            if (detail.businessService == null)
            {
                return(new List <UddiService>());
            }

            IList <UddiService> uddiServices = new List <UddiService>();

            foreach (businessService businessServiceItem in detail.businessService)
            {
                List <UddiBinding> uddiBindings = new List <UddiBinding>();
                foreach (bindingTemplate bindingTemplate in businessServiceItem.bindingTemplates)
                {
                    List <string> tModelKeys = new List <string>();
                    foreach (tModelInstanceInfo tModel in bindingTemplate.tModelInstanceDetails)
                    {
                        tModelKeys.Add(tModel.tModelKey);
                    }

                    // Get the tModel details:
                    get_tModelDetail tModelDetail = new get_tModelDetail();
                    tModelDetail.tModelKey = tModelKeys.ToArray();
                    tModelDetail modelDetail = this.uddiProxy.get_tModelDetail(tModelDetail);

                    List <tModel> uddiTModels = new List <tModel>();
                    foreach (tModel tModelItem in modelDetail.tModel)
                    {
                        uddiTModels.Add(tModelItem);
                    }

                    UddiBinding uddiBinding = new UddiBinding(bindingTemplate, uddiTModels);
                    uddiBindings.Add(uddiBinding);
                }

                UddiService uddiService = new UddiService(businessServiceItem, uddiBindings);
                uddiServices.Add(uddiService);
            }

            return(uddiServices);
        }
예제 #2
0
        private UddiLookupResponse GetLookupResponse(LookupParameters lookupParameters, UddiService uddiService, UddiBinding uddiBinding)
        {
            Identifier         identifier        = lookupParameters.Identifier;
            EndpointAddress    endpointAddress   = uddiBinding.GetEndpointAddress();
            DateTime           activationDateUtc = uddiService.GetActivationDateUtc();
            DateTime           expirationDateUtc = uddiService.GetExpirationDateUtc();
            CertificateSubject subject           = uddiService.GetCertificateSubject();
            Uri         termsOfUse            = uddiService.GetTermsOfUseUrl();
            MailAddress mail                  = uddiService.GetContactMail();
            Version     version               = uddiService.GetVersion();
            UddiId      newerVersion          = uddiService.GetNewerVersion();
            UddiId      serviceType           = uddiBinding.GetPortType().UddiId;
            List <ProcessRoleDefinition> list = uddiBinding.GetProcessRoleDefinitions();

            UddiLookupResponse response = new UddiLookupResponse(
                identifier,
                endpointAddress,
                activationDateUtc,
                expirationDateUtc,
                subject,
                termsOfUse,
                mail,
                version,
                newerVersion,
                serviceType,
                list
                );

            return(response);
        }