/**
         * Constructs the bindingKey based on the bindingKeyFormat specified in the properties. When no
         * bindingKeyFormat is specific the default format of uddi:${keyDomain}:${nodeName}-${serviceName}-{portName} is used.
         *
         * @param properties
         * @param serviceName
         * @param portName
         * @return the bindingKey
        */
        public static String getBindingKey(Properties properties, QName serviceName, String portName, Uri bindingUrl)
        {
            Properties tempProperties = new Properties();
            tempProperties.putAll(properties);
            tempProperties.put("serviceName", serviceName.getLocalPart());
            tempProperties.put("portName", portName);
            int port = bindingUrl.Port;
            if (port < 0)
            {
                if ("http".Equals(bindingUrl.Scheme, StringComparison.CurrentCultureIgnoreCase))
                {
                    port = 80;
                }
                else if ("https".Equals(bindingUrl.Scheme))
                {
                    port = 443;
                }
            }
            if (!tempProperties.containsKey("serverPort"))
                tempProperties.put("serverPort", port.ToString());

            //Constructing the binding Key
            String keyFormat = properties.getProperty(Property.BINDING_KEY_FORMAT, DEFAULT_BINDING_KEY_FORMAT);
            String bindingKey = TokenResolver.replaceTokens(keyFormat, tempProperties).ToLower();
            return bindingKey;
        }
Beispiel #2
0
        /**
         * Constructs the bindingKey based on the bindingKeyFormat specified in the properties. When no
         * bindingKeyFormat is specific the default format of uddi:${keyDomain}:${nodeName}-${serviceName}-{portName} is used.
         *
         * @param properties
         * @param serviceName
         * @param portName
         * @return the bindingKey
         */

        public static String getBindingKey(Properties properties, QName serviceName, String portName, Uri bindingUrl)
        {
            Properties tempProperties = new Properties();

            tempProperties.putAll(properties);
            tempProperties.put("serviceName", serviceName.getLocalPart());
            tempProperties.put("portName", portName);
            int port = bindingUrl.Port;

            if (port < 0)
            {
                if ("http".Equals(bindingUrl.Scheme, StringComparison.CurrentCultureIgnoreCase))
                {
                    port = 80;
                }
                else if ("https".Equals(bindingUrl.Scheme))
                {
                    port = 443;
                }
            }
            if (!tempProperties.containsKey("serverPort"))
            {
                tempProperties.put("serverPort", port.ToString());
            }

            //Constructing the binding Key
            String keyFormat  = properties.getProperty(Property.BINDING_KEY_FORMAT, DEFAULT_BINDING_KEY_FORMAT);
            String bindingKey = TokenResolver.replaceTokens(keyFormat, tempProperties).ToLower();

            return(bindingKey);
        }
Beispiel #3
0
        /// <summary>
        /// Constructs the serviceKey based on the serviceKeyFormat specified in the properties. When no
        ///serviceKeyFormat is specific the default format of uddi:${keyDomain}:${serviceName} is used.
        /// </summary>
        /// <param name="properties"></param>
        /// <param name="serviceName"></param>
        /// <returns></returns>
        public static String getServiceKey(Properties properties, String serviceName)
        {
            Properties tempProperties = new Properties();

            tempProperties.putAll(properties);
            tempProperties.put("serviceName", serviceName);
            //Constructing the serviceKey
            String keyFormat  = tempProperties.getProperty(Property.SERVICE_KEY_FORMAT, DEFAULT_SERVICE_KEY_FORMAT);
            String serviceKey = TokenResolver.replaceTokens(keyFormat, tempProperties).ToLower();

            return(serviceKey);
        }
 /// <summary>
 /// Constructs the serviceKey based on the serviceKeyFormat specified in the properties. When no
 ///serviceKeyFormat is specific the default format of uddi:${keyDomain}:${serviceName} is used.
 /// </summary>
 /// <param name="properties"></param>
 /// <param name="serviceName"></param>
 /// <returns></returns>
 public static String getServiceKey(Properties properties, String serviceName)
 {
     Properties tempProperties = new Properties();
     tempProperties.putAll(properties);
     tempProperties.put("serviceName", serviceName);
     //Constructing the serviceKey
     String keyFormat = tempProperties.getProperty(Property.SERVICE_KEY_FORMAT, DEFAULT_SERVICE_KEY_FORMAT);
     String serviceKey = TokenResolver.replaceTokens(keyFormat, tempProperties).ToLower();
     return serviceKey;
 }
Beispiel #5
0
        /**
         * Removes the UDDI data structures belonging to the WSDLs for this
         * clerk from the UDDI node. Note, if registration fails, no exception
         * is thrown
         */
        public void unRegisterWsdls()
        {
            if (this.getWsdls() != null)
            {
                Properties properties = new Properties();
                properties.putAll(this.getUDDINode().getProperties());

                foreach (WSDL wsdl in this.getWsdls())
                {
                    try
                    {
                        ReadWSDL rw = new ReadWSDL();
                        tDefinitions wsdlDefinition = rw.readWSDL(wsdl.getFileName());
                        if (wsdl.getKeyDomain() != null)
                        {
                            properties.setProperty("keyDomain", wsdl.getKeyDomain());
                        }
                        if (wsdl.getBusinessKey() != null)
                        {
                            properties.setProperty("businessKey", wsdl.getBusinessKey());
                        }

                        WSDL2UDDI wsdl2UDDI = new WSDL2UDDI(this, new URLLocalizer(), properties);
                        wsdl2UDDI.unRegisterBusinessServices(wsdlDefinition);
                    }
                    catch (Exception e)
                    {
                        log.error("Unable to register wsdl " + wsdl.getFileName() + " ." + e.Message, e);
                    }
                }
            }
        }
Beispiel #6
0
        /**
         * Registers a WSDL Definition onto the UDDI node referenced by the
         * clerk. Note, if registration fails, no exception is thrown
         *
         * @param wsdlDefinition - the WSDL Definition
         * @param keyDomain - the keyDomain which will be used to construct the
         * UDDI key IDs. If left null the keyDomain defined in the node's
         * properties will be used.
         * @param businessKey - the key of the business to which this service
         * belongs. If left null the businessKey defined in the node's
         * properties will be used.
         *
         */
        public void registerWsdls(tDefinitions wsdlDefinition, String keyDomain, String businessKey)
        {
            try
            {
                Properties properties = new Properties();
                properties.putAll(this.getUDDINode().getProperties());

                if (keyDomain != null)
                {
                    properties.setProperty("keyDomain", keyDomain);
                }
                if (businessKey != null)
                {
                    properties.setProperty("businessKey", businessKey);
                }
                WSDL2UDDI wsdl2UDDI = new WSDL2UDDI(this, new URLLocalizer(), properties);
                wsdl2UDDI.registerBusinessServices(wsdlDefinition);
            }
            catch (Exception e)
            {
                log.error("Unable to register wsdl " + " ." + e.Message, e);
            }
        }