Package org.uddi.api_v3

Examples of org.uddi.api_v3.KeyedReference


        }

        @Test
        public void UDDI_764SORT_BY_DATE_DESCSortBinding() throws Exception {
                findbinding(new String[]{UDDIConstants.SORT_BY_DATE_DESC},
                     new KeyedReference[]{new KeyedReference(UDDIConstants.TRANSPORT_HTTP, "test", "test")});
                //(UDDIConstants.SORT_BY_DATE_DESC);
        }
View Full Code Here


        }

        @Test
        public void UDDI_764SORT_BY_DATE_DESCSortBindingKey() throws Exception {
                findbinding(new String[]{UDDIConstants.SORT_BY_DATE_DESC_TMODEL},
                     new KeyedReference[]{new KeyedReference(UDDIConstants.TRANSPORT_HTTP, "test", "test")});
        }
View Full Code Here

                        // Set the categoryBag
                        CategoryBag categoryBag = new CategoryBag();

                        if (namespace != null && !"".equals(namespace)) {
                                // A keyedReference with a tModelKey of the WSDL Entity Type category system and a keyValue of "binding".
                                KeyedReference namespaceReference = newKeyedReference(
                                        "uddi:uddi.org:xml:namespace", "uddi-org:xml:namespace", namespace);
                                categoryBag.getKeyedReference().add(namespaceReference);
                        }

                        // A keyedReference with a tModelKey of the WSDL Entity Type category system and a keyValue of "binding".
                        KeyedReference typesReference = newKeyedReference(
                                "uddi:uddi.org:wsdl:types", "uddi-org:wsdl:types", "binding");
                        categoryBag.getKeyedReference().add(typesReference);

            // A keyedReference with a tModelKey of the WSDL portType Reference category system and a keyValue
                        // of the tModelKey that models the wsdl:portType to which the wsdl:binding relates.
                        Binding binding = bindings.get(qName);
                        String portTypeKey = keyDomainURI + binding.getPortType().getQName().getLocalPart();
                        KeyedReference namespaceReference = newKeyedReference(
                                "uddi:uddi.org:wsdl:porttypereference", "uddi-org:wsdl:portTypeReference",
                                portTypeKey);
                        categoryBag.getKeyedReference().add(namespaceReference);

            //  A keyedReference with a tModelKey of the UDDI Types category system and a keyValue of
                        // "wsdlSpec" for backward compatibility.
                        KeyedReference typesReferenceBackwardsCompatible = newKeyedReference(
                                "uddi:uddi.org:categorization:types", "uddi-org:types", "wsdlSpec");
                        categoryBag.getKeyedReference().add(typesReferenceBackwardsCompatible);

                        // One or two keyedReferences as required to capture the protocol
                        for (Object object : binding.getExtensibilityElements()) {
                                SOAPBinding sb = null;
                                SOAP12Binding sb12 = null;
                                HTTPBinding hb = null;

                                try {
                                        hb = (HTTPBinding) object;
                                } catch (Exception x) {
                                }
                                try {
                                        sb = (SOAPBinding) object;
                                } catch (Exception x) {
                                }
                                try {
                                        sb12 = (SOAP12Binding) object;
                                } catch (Exception x) {
                                }
                                if (sb != null) {
                    // If the wsdl:binding contains a soap:binding extensibility element from the
                                        // 'http://schemas.xmlsoap.org/wsdl/soap/' namespace then the categoryBag MUST
                                        //include a keyedReference with a tModelKey of the Protocol Categorization
                                        // category system and a keyValue of the tModelKey of the SOAP Protocol tModel.
                                        SOAPBinding soapBinding = sb;
                                        KeyedReference soapProtocol = newKeyedReference(
                                                "uddi:uddi.org:wsdl:categorization:protocol", "uddi-org:protocol:soap", "uddi:uddi.org:protocol:soap");
                                        categoryBag.getKeyedReference().add(soapProtocol);
                    // If the value of the transport attribute of the soap:binding element
                                        // is 'http://schemas.xmlsoap.org/soap/http' then the categoryBag MUST
                                        // include a keyedReference with a tModelKey of the Transport Categorization
                                        // category system and a keyValue of the tModelKey of the HTTP Transport tModel.
                                        if ("http://schemas.xmlsoap.org/soap/http".equals(soapBinding.getTransportURI())) {
                                                KeyedReference httpTransport = newKeyedReference(
                                                        "uddi:uddi.org:wsdl:categorization:transport", "uddi-org:http", "uddi:uddi.org:transport:http");
                                                categoryBag.getKeyedReference().add(httpTransport);
                                        } else if (soapBinding.getTransportURI() != null) {
                        // TODO If the value of the transport attribute is anything else,
                                                // then the bindingTemplate MUST include an additional keyedReference with a tModelKey
                                                // of the Transport Categorization category system and a keyValue of the tModelKey of
                                                // an appropriate transport tModel.
                                                log.warn("not implemented, binding transport is " + soapBinding.getTransportURI());
                                        }

                                } else if (hb != null) {

                    // If the wsdl:binding contains an http:binding extensibility element from the
                                        // http://schemas.xmlsoap.org/wsdl/http/ namespace then the categoryBag MUST
                                        // include a keyedReference with a tModelKey of the Protocol Categorization
                                        // category system and a keyValue of the tModelKey of the HTTP Protocol tModel.
                                        KeyedReference soapProtocol = newKeyedReference(
                                                "uddi:uddi.org:wsdl:categorization:protocol", "uddi-org:protocol:http", "uddi:uddi.org:protocol:http");
                                        categoryBag.getKeyedReference().add(soapProtocol);
                                } else if (sb12 != null) {
                    // If the wsdl:binding contains a soap:binding extensibility element from the
                                        // 'http://schemas.xmlsoap.org/wsdl/soap/' namespace then the categoryBag MUST
                                        //include a keyedReference with a tModelKey of the Protocol Categorization
                                        // category system and a keyValue of the tModelKey of the SOAP Protocol tModel.

                                        KeyedReference soapProtocol = newKeyedReference(
                                                "uddi:uddi.org:wsdl:categorization:protocol", "uddi-org:protocol:soap", "uddi:uddi.org:protocol:soap");
                                        categoryBag.getKeyedReference().add(soapProtocol);
                    // If the value of the transport attribute of the soap:binding element
                                        // is 'http://schemas.xmlsoap.org/soap/http' then the categoryBag MUST
                                        // include a keyedReference with a tModelKey of the Transport Categorization
                                        // category system and a keyValue of the tModelKey of the HTTP Transport tModel.
                                        if ("http://schemas.xmlsoap.org/soap/http".equals(sb12.getTransportURI())) {
                                                KeyedReference httpTransport = newKeyedReference(
                                                        "uddi:uddi.org:wsdl:categorization:transport", "uddi-org:http", "uddi:uddi.org:transport:http");
                                                categoryBag.getKeyedReference().add(httpTransport);
                                        } else if (sb12.getTransportURI() != null) {
                        // TODO If the value of the transport attribute is anything else,
                                                // then the bindingTemplate MUST include an additional keyedReference with a tModelKey
View Full Code Here

                        // Create the categoryBag, The tModel MUST contain a categoryBag
                        CategoryBag categoryBag = new CategoryBag();

            // the categoryBag MUST contain a keyedReference with a tModelKey of the WSDL
                        // Entity Type category system and a keyValue of "portType".
                        KeyedReference typesReference = newKeyedReference(
                                "uddi:uddi.org:wsdl:types", "uddi-org:wsdl:types", "portType");
                        categoryBag.getKeyedReference().add(typesReference);

            // If the wsdl:portType has a targetNamespace then the categoryBag MUST also contain an
                        // additional keyedReference with a tModelKey of the XML Namespace category system and a
                        // keyValue of the target namespace of the wsdl:definitions element that contains the
                        // wsdl:portType. If the targetNamespace is absent from the portType, a categoryBag
                        // MUST NOT contain a keyedReference to the XML Namespace category system.
                        if (namespace != null && !"".equals(namespace)) {
                                KeyedReference namespaceReference = newKeyedReference(
                                        "uddi:uddi.org:xml:namespace", "uddi-org:xml:namespace", namespace);
                                categoryBag.getKeyedReference().add(namespaceReference);
                        }

                        tModel.setCategoryBag(categoryBag);
View Full Code Here

                }
                return tModels;
        }

        protected static KeyedReference newKeyedReference(String tModelKey, String keyName, String value) {
                KeyedReference typesReference = new KeyedReference();
                typesReference.setTModelKey(tModelKey);
                typesReference.setKeyName(keyName);
                typesReference.setKeyValue(value);
                return typesReference;
        }
View Full Code Here

                FindTModel findTModel = new FindTModel();
                CategoryBag categoryBag = new CategoryBag();

                if (namespace != null && namespace.length() != 0) {
                        KeyedReference namespaceReference = newKeyedReference(
                                "uddi:uddi.org:xml:namespace", "uddi-org:xml:namespace", namespace);
                        categoryBag.getKeyedReference().add(namespaceReference);
                }
                KeyedReference bindingReference = newKeyedReference(
                        "uddi:uddi.org:wsdl:types", "uddi-org:wsdl:types", "binding");
                categoryBag.getKeyedReference().add(bindingReference);

                KeyedReference portTypeReference = newKeyedReference(
                        "uddi:uddi.org:wsdl:porttypereference", "uddi-org:wsdl:portTypeReference", portType);
                categoryBag.getKeyedReference().add(portTypeReference);

                findTModel.setCategoryBag(categoryBag);
View Full Code Here

                name.setValue(portTypeName);
                findTModel.setName(name);

                CategoryBag categoryBag = new CategoryBag();
                if (namespace != null && namespace.length() != 0) {
                        KeyedReference namespaceReference = newKeyedReference(
                                "uddi:uddi.org:xml:namespace", "uddi-org:xml:namespace", namespace);
                        categoryBag.getKeyedReference().add(namespaceReference);
                }
                KeyedReference bindingReference = newKeyedReference(
                        "uddi:uddi.org:wsdl:types", "uddi-org:wsdl:types", "portType");
                categoryBag.getKeyedReference().add(bindingReference);

                findTModel.setCategoryBag(categoryBag);
View Full Code Here

                CategoryBag categoryBag = new CategoryBag();

                String namespace = serviceQName.getNamespaceURI();
                if (namespace != null && namespace.length() != 0) {
                        KeyedReference namespaceReference = newKeyedReference(
                                "uddi:uddi.org:xml:namespace", "uddi-org:xml:namespace", namespace);
                        categoryBag.getKeyedReference().add(namespaceReference);
                }

                KeyedReference serviceReference = newKeyedReference(
                        "uddi:uddi.org:wsdl:types", "uddi-org:wsdl:types", "service");
                categoryBag.getKeyedReference().add(serviceReference);

                KeyedReference localNameReference = newKeyedReference(
                        "uddi:uddi.org:xml:localname", "uddi-org:xml:localName", serviceQName.getLocalPart());
                categoryBag.getKeyedReference().add(localNameReference);

                service.setCategoryBag(categoryBag);
View Full Code Here

                Assert.assertEquals(2, tModel.getCategoryBag().getKeyedReference().size());
                for (KeyedReference keyedReference : tModel.getCategoryBag().getKeyedReference()) {
                        boolean match = false;
                        Iterator<KeyedReference> iter = specTModel.getCategoryBag().getKeyedReference().iterator();
                        while (iter.hasNext() && match == false) {
                                KeyedReference specKeyedRef = iter.next();
                                if (specKeyedRef.getTModelKey().equals(keyedReference.getTModelKey())) {
                                        match = true;
                                        Assert.assertEquals(specKeyedRef.getKeyName(), keyedReference.getKeyName());
                                        Assert.assertEquals(specKeyedRef.getKeyValue(), keyedReference.getKeyValue());
                                }
                        }
                        //expecting a match for each keyedReference
                        Assert.assertTrue("Expected a match for keyedReference " + keyedReference.getTModelKey(), match);
                }
View Full Code Here

                Assert.assertEquals(6, tModel.getCategoryBag().getKeyedReference().size());
                for (KeyedReference keyedReference : tModel.getCategoryBag().getKeyedReference()) {
                        boolean match = false;
                        Iterator<KeyedReference> iter = specTModel.getCategoryBag().getKeyedReference().iterator();
                        while (iter.hasNext() && match == false) {
                                KeyedReference specKeyedRef = iter.next();
                                if (specKeyedRef.getTModelKey().equals(keyedReference.getTModelKey())) {
                                        match = true;
                                        Assert.assertEquals(specKeyedRef.getKeyName(), keyedReference.getKeyName());
                                        Assert.assertEquals(specKeyedRef.getKeyValue(), keyedReference.getKeyValue());
                                }
                        }
                        //expecting a match for each keyedReference
                        Assert.assertTrue("Expected a match for keyedReference " + keyedReference.getTModelKey(), match);
                }
View Full Code Here

TOP

Related Classes of org.uddi.api_v3.KeyedReference

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.