public class WSDL2UDDI extends Object
createWSDLPortTypeTModels(String, Map)
createWSDLBindingTModels(String, Map)
Constructor and Description |
---|
WSDL2UDDI(UDDIClerk clerk,
URLLocalizer urlLocalizer,
Properties properties)
Required Properties are: businessName, for example: 'Apache'
nodeName, for example: 'uddi.example.org_80' keyDomain, for example:
juddi.apache.org
Optional Properties are: lang: for example: 'nl'
|
Modifier and Type | Method and Description |
---|---|
protected org.uddi.api_v3.BusinessService |
createBusinessService(QName serviceQName,
javax.wsdl.Definition wsdlDefinition)
Creates a UDDI Business Service.
|
org.uddi.api_v3.BusinessServices |
createBusinessServices(javax.wsdl.Definition wsdlDefinition)
Creates a business service based off of a WSDL definition
No changes are made to the UDDI endpoints using this method Example Code: |
static org.uddi.api_v3.FindTModel |
createFindBindingTModelForPortType(String portType,
String namespace)
Builds a finder to find the binding tModels for a portType.
|
static org.uddi.api_v3.FindTModel |
createFindPortTypeTModelForPortType(String portTypeName,
String namespace)
Builds a finder to find the portType tModels for a portType.
|
protected org.uddi.api_v3.BindingTemplate |
createWSDLBinding(QName serviceQName,
String portName,
URL serviceUrl,
javax.wsdl.Definition wsdlDefinition) |
Set<org.uddi.api_v3.TModel> |
createWSDLBindingTModels(String wsdlURL,
Map<QName,javax.wsdl.Binding> bindings)
2.4.2 wsdl:binding -> uddi:tModel
|
Set<org.uddi.api_v3.TModel> |
createWSDLPortTypeTModels(String wsdlURL,
Map<QName,javax.wsdl.PortType> portTypes)
2.4.1 wsdl:portType -> uddi:tModel
|
String |
getKeyDomainURI() |
String |
getLang() |
protected static org.uddi.api_v3.KeyedReference |
newKeyedReference(String tModelKey,
String keyName,
String value) |
ServiceRegistrationResponse |
registerBusinessService(QName serviceQName,
String portName,
URL serviceUrl,
javax.wsdl.Definition wsdlDefinition) |
org.uddi.api_v3.BusinessServices |
registerBusinessServices(javax.wsdl.Definition wsdlDefinition) |
void |
setKeyDomain(String keyDomainURI) |
void |
setLang(String lang) |
String |
unRegisterBusinessService(QName serviceName,
String portName,
URL serviceUrl) |
String[] |
unRegisterBusinessServices(javax.wsdl.Definition wsdlDefinition) |
public WSDL2UDDI(UDDIClerk clerk, URLLocalizer urlLocalizer, Properties properties) throws org.apache.commons.configuration.ConfigurationException
clerk
- - can be null if register/unregister methods are not
used.urlLocalizer
- - A reference to an customproperties
- - required values keyDomain, businessKey, nodeNameorg.apache.commons.configuration.ConfigurationException
public org.uddi.api_v3.BusinessServices registerBusinessServices(javax.wsdl.Definition wsdlDefinition) throws RemoteException, org.apache.commons.configuration.ConfigurationException, TransportException, javax.wsdl.WSDLException, MalformedURLException
RemoteException
org.apache.commons.configuration.ConfigurationException
TransportException
javax.wsdl.WSDLException
MalformedURLException
public ServiceRegistrationResponse registerBusinessService(QName serviceQName, String portName, URL serviceUrl, javax.wsdl.Definition wsdlDefinition) throws RemoteException, org.apache.commons.configuration.ConfigurationException, TransportException, javax.wsdl.WSDLException, MalformedURLException
RemoteException
org.apache.commons.configuration.ConfigurationException
TransportException
javax.wsdl.WSDLException
MalformedURLException
public String[] unRegisterBusinessServices(javax.wsdl.Definition wsdlDefinition) throws RemoteException, org.apache.commons.configuration.ConfigurationException, TransportException, MalformedURLException
RemoteException
org.apache.commons.configuration.ConfigurationException
TransportException
MalformedURLException
public String unRegisterBusinessService(QName serviceName, String portName, URL serviceUrl) throws RemoteException, org.apache.commons.configuration.ConfigurationException, TransportException
RemoteException
org.apache.commons.configuration.ConfigurationException
TransportException
public String getKeyDomainURI()
public void setKeyDomain(String keyDomainURI)
public String getLang()
public void setLang(String lang)
public Set<org.uddi.api_v3.TModel> createWSDLBindingTModels(String wsdlURL, Map<QName,javax.wsdl.Binding> bindings) throws javax.wsdl.WSDLException
A wsdl:binding MUST be modeled as a uddi:tModel. The minimum information that must be captured about a binding is its entity type, its local name, its namespace, the location of the WSDL document that defines the binding, the portType that it implements, its protocol, and, optionally, the transport information. Capturing the entity type enables users to search for tModels that represent binding artifacts. Capturing the local name, namespace, and WSDL location enables users to locate the definition of the specified binding artifact. The link to the portType enables users to search for bindings that implement a particular portType.
A wsdl:binding corresponds to a WSDL service interface definition as defined by the mapping in the Version 1 Best Practice. To maintain compatibility with the previous mapping, the binding must also be characterized as type "wsdlSpec".
The wsdl:binding information is captured as follows:
The uddi:name element of the tModel MUST be the value of the name attribute of the wsdl:binding.
The tModel MUST contain a categoryBag, and the categoryBag MUST contain at least the following keyedReference elements:
If the wsdl:binding 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:binding. If the targetNamespace is absent from the binding, a categoryBag MUST NOT contain a keyedReference to the XML Namespace category system.
The tModel MUST contain an overviewDoc with an overviewURL containing the location of the WSDL document that describes the wsdl:binding.
Information about the protocol and transport, if applicable, specified in an extension to the wsdl:binding is used to categorize the binding tModel as described in the following sections. This information is specified using two of the category systems defined in this Technical Note:
The valid values for the Protocol Categorization category system are tModelKeys of tModels that are categorized as protocol tModels. Similarly, the valid values for the Transport Categorization category system are tModelKeys of tModels that are categorized as transport tModels.
The reason for having these two categorization schemes that take tModel keys as values is to allow other standard or proprietary protocols and transports to be defined and used in the same way as the standard SOAP and HTTP protocols and transport.
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.
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 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.
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.
Note that this is a different tModel from the HTTP Transport tModel, and in this case there is no separate transport tModel, and therefore no keyedReference in the categoryBag from the Transport Categorization category system.
Other wsdl:binding extensibility elements are handled in a similar fashion. It is assumed that vendors who provide other bindings will provide the appropriate protocol and transport tModels.
Example CodeURL 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); Map allBindings = wsdlDefinition.getAllBindings(); SetcreateWSDLBindingTModels = wsdl2UDDI.createWSDLBindingTModels(url.toString(), allBindings);
wsdlURL
- bindings
- Mapjavax.wsdl.WSDLException
public Set<org.uddi.api_v3.TModel> createWSDLPortTypeTModels(String wsdlURL, Map<QName,javax.wsdl.PortType> portTypes) throws javax.wsdl.WSDLException
A wsdl:portType MUST be modeled as a uddi:tModel.
The minimum information that must be captured about a portType is its entity type, its local name, its namespace, and the location of the WSDL document that defines the portType. Capturing the entity type enables users to search for tModels that represent portType artifacts. Capturing the local name, namespace, and WSDL location enables users to locate the definition of the specified portType artifact.
The wsdl:portType information is captured as follows:
The uddi:name element of the tModel MUST be the value of the name attribute of the wsdl:portType.
The tModel MUST contain a categoryBag, and the categoryBag MUST contain a keyedReference with a tModelKey of the WSDL Entity Type category system and a keyValue of "portType".
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.
The tModel MUST contain an overviewDoc with an overviewURL containing the location of the WSDL document that describes the wsdl:portType.
Example CodeURL 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); MapportTypes = (Map ) wsdlDefinition.getAllPortTypes(); Set portTypeTModels = wsdl2UDDI.createWSDLPortTypeTModels(wsdlURL, portTypes);
wsdlURL
- This is used to set the Overview URLportTypes
- Mapjavax.wsdl.WSDLException
protected static org.uddi.api_v3.KeyedReference newKeyedReference(String tModelKey, String keyName, String value)
public static org.uddi.api_v3.FindTModel createFindBindingTModelForPortType(String portType, String namespace)
portType
- namespace
- public static org.uddi.api_v3.FindTModel createFindPortTypeTModelForPortType(String portTypeName, String namespace)
portTypeName
- namespace
- public org.uddi.api_v3.BusinessServices createBusinessServices(javax.wsdl.Definition wsdlDefinition) throws MalformedURLException
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);
wsdlDefinition
- must not be nullMalformedURLException
IllegalArgumentException
- if the wsdlDefinition is nullprotected org.uddi.api_v3.BusinessService createBusinessService(QName serviceQName, javax.wsdl.Definition wsdlDefinition)
serviceQName
- wsdlDefinition
- protected org.uddi.api_v3.BindingTemplate createWSDLBinding(QName serviceQName, String portName, URL serviceUrl, javax.wsdl.Definition wsdlDefinition) throws MalformedURLException
MalformedURLException
Copyright © 2004–2021 The Apache Software Foundation. All rights reserved.