Exemple #1
0
        public businessService[] registerBusinessServices(org.xmlsoap.schemas.easyWsdl.tDefinitions wsdlDefinition)
        {
            List<businessService> businessServices = new List<businessService>();
            Dictionary<apache.juddi.v3.client.mapping.QName, org.xmlsoap.schemas.easyWsdl.tService>.Enumerator it = wsdlDefinition.getAllServices().GetEnumerator();
            while (it.MoveNext())
            {
                QName serviceQName = (QName)it.Current.Key;
                org.xmlsoap.schemas.easyWsdl.tService service = wsdlDefinition.getService(serviceQName);
                businessService businessService = null;
                //add service
                Uri serviceUrl = null;
                if (service.port != null && service.port.Count > 0)
                {
                    HashSet<org.xmlsoap.schemas.easyWsdl.tPort>.Enumerator it2 = service.port.GetEnumerator();
                    while (it2.MoveNext())
                    {
                        //for (Object portName : service.getPorts().keySet()) {
                        businessService = registerBusinessService(serviceQName, (String)it2.Current.name, serviceUrl, wsdlDefinition).getBusinessService();
                    }
                }
                if (businessService != null)
                {
                    businessServices.Add(businessService);
                }
            }

            return businessServices.ToArray();
        }
Exemple #2
0
        public String[] unRegisterBusinessServices(org.xmlsoap.schemas.easyWsdl.tDefinitions wsdlDefinition)
        {
            String[] businessServices = new String[wsdlDefinition.getAllServices().Count];
            int i = 0;
            Dictionary<apache.juddi.v3.client.mapping.QName, org.xmlsoap.schemas.easyWsdl.tService>.Enumerator it = wsdlDefinition.getAllServices().GetEnumerator();
            while (it.MoveNext())
            {

                QName serviceQName = it.Current.Key;
                org.xmlsoap.schemas.easyWsdl.tService service = it.Current.Value;
                //unregister service
                Uri serviceUrl = null;
                if (service.port != null && service.port.Count > 0)
                {
                    HashSet<org.xmlsoap.schemas.easyWsdl.tPort>.Enumerator it2 = service.port.GetEnumerator();
                    while (it2.MoveNext())
                    {
                        //construct the accessURL
                        serviceUrl = new Uri(getBindingURL((org.xmlsoap.schemas.easyWsdl.tPort)service.getPort(it2.Current.name)));
                        businessServices[i++] = unRegisterBusinessService(serviceQName, (String)it2.Current.name, serviceUrl);
                    }
                }
            }
            return businessServices;
        }
Exemple #3
0
        /// <summary>
        /// 
        /// Creates a business service based off of a WSDL definition&lt;Br&gt;No changes are made to the UDDI
        /// endpoints using this method
        /// &lt;br&gt;
        /// Example Code:
        /// &lt;pre&gt;
        /// URL url = new URL(&quot;http://graphical.weather.gov/xml/SOAP_server/ndfdXMLserver.php?wsdl&quot;);
        /// String domain = url.getHost();
        /// ReadWSDL rw = new ReadWSDL();
        /// Definition wsdlDefinition = rw.readWSDL(url);
        /// properties.put(&quot;keyDomain&quot;, domain);
        /// properties.put(&quot;businessName&quot;, domain);
        /// properties.put(&quot;serverName&quot;, url.getHost());
        /// properties.put(&quot;serverPort&quot;, url.getPort());
        /// wsdlURL = wsdlDefinition.getDocumentBaseURI();
        /// WSDL2UDDI wsdl2UDDI = new WSDL2UDDI(null, new URLLocalizerDefaultImpl(), properties);
        /// BusinessServices businessServices = wsdl2UDDI.createBusinessServices(wsdlDefinition);
        /// &lt;/pre&gt;
        /// </summary>
        /// <param name="wsdlDefinition">must not be null</param>
        /// <returns>a business service</returns>
        /// <exception cref="ArgumentNullException"> if the wsdlDefinition is null</exception>
        public businessService[] createBusinessServices(org.xmlsoap.schemas.easyWsdl.tDefinitions wsdlDefinition)
        {
            if (wsdlDefinition == null)
            {
                throw new ArgumentNullException();
            }
            List<businessService> businessServices = new List<businessService>();

            Dictionary<apache.juddi.v3.client.mapping.QName, org.xmlsoap.schemas.easyWsdl.tService>.Enumerator it = wsdlDefinition.getAllServices().GetEnumerator();
            while (it.MoveNext())
            {
                QName serviceQName = it.Current.Key;
                org.xmlsoap.schemas.easyWsdl.tService service = it.Current.Value;
                businessService businessService = createBusinessService(serviceQName, wsdlDefinition);
                //service.getExtensibilityElements().
                //add the bindingTemplates
                Uri serviceUrl = null;
                if (service.port != null && service.port.Count > 0)
                {
                    List<bindingTemplate> bts = new List<bindingTemplate>();
                    HashSet<org.xmlsoap.schemas.easyWsdl.tPort>.Enumerator it2 = service.port.GetEnumerator();
                    while (it2.MoveNext())
                    {
                        bindingTemplate bindingTemplate = createWSDLBinding(serviceQName, (String)it2.Current.name, serviceUrl, wsdlDefinition);
                        bts.Add(bindingTemplate);
                    }
                    businessService.bindingTemplates = bts.ToArray();
                }
                businessServices.Add(businessService);
            }

            return businessServices.ToArray();
        }