Exemple #1
0
        private IList <UddiTModel> GetUddiTModels(IList <UddiId> uddiIds)
        {
            get_tModelDetail getTModelDetail = new get_tModelDetail();

            getTModelDetail.tModelKey = new string[uddiIds.Count];
            for (int i = 0; i < uddiIds.Count; i++)
            {
                getTModelDetail.tModelKey[i] = uddiIds[i].ID;
            }
            tModelDetail tmodelDetails = this.uddiProxy.get_tModelDetail(getTModelDetail);

            if (tmodelDetails.tModel == null)
            {
                return(new List <UddiTModel>());
            }

            IList <UddiTModel> uddiTmodels = new List <UddiTModel>();

            foreach (tModel tmodel in tmodelDetails.tModel)
            {
                UddiTModel uddiTmodel = new UddiTModel(tmodel);
                uddiTmodels.Add(uddiTmodel);
            }
            return(uddiTmodels);
        }
 public static uddi.apiv3.tModelDetail MapTModelDetail(uddi.apiv2.tModelDetail tModelDetail)
 {
     if (tModelDetail == null)
     {
         return(null);
     }
     uddi.apiv3.tModelDetail r = new tModelDetail();
     r.truncated          = tModelDetail.truncated == uddi.apiv2.truncated.@true;
     r.truncatedSpecified = tModelDetail.truncatedSpecified;
     r.tModel             = MapTModels(tModelDetail.tModel);
     return(r);
 }
Exemple #3
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);
        }
 public get_tModelDetailResponse(tModelDetail tModelDetail)
 {
     this.tModelDetail = tModelDetail;
 }
Exemple #5
0
        internal static void Run(string[] args)
        {
            UDDIClient clerkManager = null;
            Transport  transport    = null;
            UDDIClerk  clerk        = null;

            try
            {
                clerkManager = new UDDIClient("uddi.xml");

                transport = clerkManager.getTransport("uddiv2");

                UDDI_Security_SoapBinding    security = transport.getUDDISecurityService();
                UDDI_Inquiry_SoapBinding     inquiry  = transport.getUDDIInquiryService();
                UDDI_Publication_SoapBinding publish  = transport.getUDDIPublishService();

                clerk = clerkManager.getClerk("uddiv2");

                save_business sb = new save_business();
                get_authToken rq = new get_authToken();
                rq.cred   = "username";
                rq.userID = "username";
                String token = security.get_authToken(rq).authInfo;
                System.Console.WriteLine("Got an auth token...");
                sb.authInfo                      = token;
                sb.businessEntity                = new businessEntity[1];
                sb.businessEntity[0]             = new businessEntity();
                sb.businessEntity[0].name        = new name[] { new name("test business from .net via uddi2 translation", "en") };
                sb.businessEntity[0].description = new description[] { new description("a description", "en") };
                businessDetail detail = publish.save_business(sb);
                System.Console.WriteLine("business saved");
                PrintUDDI <businessDetail> p = new PrintUDDI <businessDetail>();
                Console.Out.WriteLine(p.print(detail));

                save_service ss = new save_service();
                ss.authInfo                       = token;
                ss.businessService                = new businessService[1];
                ss.businessService[0]             = new businessService();
                ss.businessService[0].name        = new name[] { new name("hello world", "en") };
                ss.businessService[0].businessKey = detail.businessEntity[0].businessKey;
                serviceDetail sd = publish.save_service(ss);
                System.Console.WriteLine("service saved");
                PrintUDDI <serviceDetail> p1 = new PrintUDDI <serviceDetail>();
                Console.Out.WriteLine(p1.print(sd));

                save_binding sbd = new save_binding();
                sbd.authInfo                      = token;
                sbd.bindingTemplate               = new bindingTemplate[1];
                sbd.bindingTemplate[0]            = new bindingTemplate();
                sbd.bindingTemplate[0].Item       = new accessPoint("http://localhost", "endPoint");
                sbd.bindingTemplate[0].serviceKey = sd.businessService[0].serviceKey;
                bindingDetail bd = publish.save_binding(sbd);
                System.Console.WriteLine("binding saved");
                PrintUDDI <bindingDetail> p2 = new PrintUDDI <bindingDetail>();
                Console.Out.WriteLine(p2.print(bd));

                save_tModel stm = new save_tModel();
                stm.authInfo       = token;
                stm.tModel         = new tModel[1];
                stm.tModel[0]      = new tModel();
                stm.tModel[0].name = new name("a uddiv2 tmodel", "en");
                tModelDetail td = publish.save_tModel(stm);
                System.Console.WriteLine("tModel saved");
                PrintUDDI <tModelDetail> p3 = new PrintUDDI <tModelDetail>();
                Console.Out.WriteLine(p3.print(td));
            }
            catch (Exception ex)
            {
                while (ex != null)
                {
                    System.Console.WriteLine("Error! " + ex.Message);
                    ex = ex.InnerException;
                }
            }
            finally
            {
                if (transport != null && transport is IDisposable)
                {
                    ((IDisposable)transport).Dispose();
                }
                if (clerk != null)
                {
                    clerk.Dispose();
                }
            }
        }
 public save_tModelResponse(tModelDetail tModelDetail)
 {
     this.tModelDetail = tModelDetail;
 }