WSDL2UDDI { public Set<TModel> createWSDLPortTypeTModels(String wsdlURL, Map<QName, PortType> portTypes) throws WSDLException { Set<TModel> tModels = new HashSet<TModel>(); for (QName qName : portTypes.keySet()) { TModel tModel = new TModel(); String localpart = qName.getLocalPart(); String namespace = qName.getNamespaceURI(); tModel.setTModelKey(keyDomainURI + localpart); Name name = new Name(); name.setLang(lang); name.setValue(localpart); tModel.setName(name); OverviewURL overviewURL = new OverviewURL(); overviewURL.setUseType(AccessPointType.WSDL_DEPLOYMENT.toString()); overviewURL.setValue(wsdlURL); OverviewDoc overviewDoc = new OverviewDoc(); overviewDoc.setOverviewURL(overviewURL); tModel.getOverviewDoc().add(overviewDoc); CategoryBag categoryBag = new CategoryBag(); KeyedReference typesReference = newKeyedReference( "uddi:uddi.org:wsdl:types", "uddi-org:wsdl:types", "portType"); categoryBag.getKeyedReference().add(typesReference); 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); tModels.add(tModel); } return tModels; } WSDL2UDDI(UDDIClerk clerk, URLLocalizer urlLocalizer, Properties properties); BusinessServices registerBusinessServices(Definition wsdlDefinition); @SuppressWarnings("unchecked") ServiceRegistrationResponse registerBusinessService(QName serviceQName, String portName, URL serviceUrl, Definition wsdlDefinition); String[] unRegisterBusinessServices(Definition wsdlDefinition); String unRegisterBusinessService(QName serviceName, String portName, URL serviceUrl); String getKeyDomainURI(); void setKeyDomain(String keyDomainURI); String getLang(); void setLang(String lang); Set<TModel> createWSDLBindingTModels(String wsdlURL, Map<QName, Binding> bindings); Set<TModel> createWSDLPortTypeTModels(String wsdlURL, Map<QName, PortType> portTypes); static FindTModel createFindBindingTModelForPortType(String portType, String namespace); static FindTModel createFindPortTypeTModelForPortType(String portTypeName, String namespace); BusinessServices createBusinessServices(Definition wsdlDefinition);  }
@Test public void testUDDIBindingModel() throws WSDLException, JAXBException, ConfigurationException , Exception{ Definition wsdlDefinition = rw.readWSDL("wsdl/HelloWorld.wsdl"); String wsdlURL = wsdlDefinition.getDocumentBaseURI(); Properties properties = new Properties(); properties.put("keyDomain", "juddi.apache.org"); WSDL2UDDI wsdl2UDDI = new WSDL2UDDI(null, new URLLocalizerDefaultImpl(), properties); Set<TModel> tModels = new HashSet<TModel>(); @SuppressWarnings("unchecked") Map<QName,PortType> portTypes = (Map<QName,PortType>) wsdlDefinition.getAllPortTypes(); Set<TModel> portTypeTModels = wsdl2UDDI.createWSDLPortTypeTModels(wsdlURL, portTypes); tModels.addAll(portTypeTModels); for (TModel tModel : tModels) { System.out.println("UDDI PortType TModel " + tModel.getName().getValue()); if (serialize) System.out.println(pTModel.print(tModel)); } Assert.assertEquals(1,tModels.size()); }