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(); }
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; }
/// <summary> /// /// Creates a business service based off of a WSDL definition<Br>No changes are made to the UDDI /// endpoints using this method /// <br> /// Example Code: /// <pre> /// URL url = new URL("http://graphical.weather.gov/xml/SOAP_server/ndfdXMLserver.php?wsdl"); /// String domain = url.getHost(); /// ReadWSDL rw = new ReadWSDL(); /// Definition wsdlDefinition = rw.readWSDL(url); /// properties.put("keyDomain", domain); /// properties.put("businessName", domain); /// properties.put("serverName", url.getHost()); /// properties.put("serverPort", url.getPort()); /// wsdlURL = wsdlDefinition.getDocumentBaseURI(); /// WSDL2UDDI wsdl2UDDI = new WSDL2UDDI(null, new URLLocalizerDefaultImpl(), properties); /// BusinessServices businessServices = wsdl2UDDI.createBusinessServices(wsdlDefinition); /// </pre> /// </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(); }