class SoapWsdl
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private class |
SoapWsdl.ServiceConfig
The configuration for the exported WSDL service.
|
Modifier and Type | Field and Description |
---|---|
private boolean |
appendObjNameToSoapAction
Flag to append the object name to the
soapAction . |
private java.util.Map<java.lang.String,org.w3c.dom.Element> |
datasets
Map of datasets defined in this WSDL.
|
private java.lang.String |
defaultService
The default service.
|
private org.w3c.dom.Document |
dom
The WSDL document.
|
private org.w3c.dom.Element |
elTypes
The element where to append the schema elements defining all the types in a namespace.
|
private java.lang.String |
endpoint
The target endpoint (only the path, without protocol, host and port).
|
private java.lang.String |
helpString
The help string to be used as service documentation.
|
private static java.lang.String |
NS_PRODATA
The namespace for the PRODATA elements.
|
private static java.lang.String |
NS_SOAP
The namespace for the SOAP elements.
|
private static java.lang.String |
NS_WSDL
The namespace for the WSDL elements.
|
private static java.lang.String |
NS_XMLNS
The namespace for the XMLNS elements.
|
private java.lang.String |
portTypeBindingSuffix
The suffix for the port-type binding operation.
|
private org.w3c.dom.Element |
root
The WSDL root element.
|
private java.util.Map<java.lang.String,SoapWsdl.ServiceConfig> |
services
The WSDL exported services.
|
private java.lang.String |
serviceSuffix
The suffix for the service.
|
private java.lang.String |
soapAction
The default actioan name.
|
private java.util.Set<java.lang.String> |
tableParams
Set of added table parameters.
|
private java.lang.String |
targetNamespace
The default namespace for the WSDL.
|
Constructor and Description |
---|
SoapWsdl()
Create a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addOperation(SoapOperation operation)
Add a SOAP operation to a service.
|
void |
addService(java.lang.String service,
java.lang.String parentService)
Add a WSDL service.
|
private java.lang.String |
checkDataSetName(org.w3c.dom.Element el)
Check if there already exists a dataset with this name.
|
private org.w3c.dom.Element |
createBindingOperation(SoapWsdl.ServiceConfig srv,
SoapOperation operation,
java.lang.String name,
java.lang.Boolean headerID)
Create an operation associated with a WSDL binding element.
|
private org.w3c.dom.Element |
createComplexType(SoapOperation operation,
java.lang.String name,
java.util.Collection<SoapOperationParameter> parameters,
boolean asElement)
Create a complex type to declare the operation's parameters.
|
private org.w3c.dom.Element |
createDataSetBeforeImage(SoapWsdl.ServiceConfig service,
java.lang.String dsname)
Create the before-image type.
|
private org.w3c.dom.Element |
createDataSetParam(SoapOperation operation,
SoapOperationParameter par)
Create a dataset parameter for a SOAP operation.
|
private org.w3c.dom.Element |
createMessage(SoapWsdl.ServiceConfig srv,
java.lang.String name,
java.lang.String element,
java.lang.String partName)
Create a message associated with a WSDL port-type operation.
|
private org.w3c.dom.Element |
createPortTypeOperation(SoapWsdl.ServiceConfig srv,
java.lang.String name,
java.lang.String typeName)
Create an operation associated with the WSDL port-type.
|
private org.w3c.dom.Element |
createTableParam(SoapOperation operation,
SoapOperationParameter par)
Create a table parameter for a SOAP operation.
|
private org.w3c.dom.Element |
createTableParam(SoapOperation operation,
SoapOperationParameter dataset,
SoapOperationParameter tparam)
Create a table schema, considering the dataset relations (nested, etc).
|
org.w3c.dom.Document |
generate()
Generate the WSDL document.
|
private boolean |
identicalElements(org.w3c.dom.Element el1,
org.w3c.dom.Element el2)
Check if these two XML element nodes are syntactically identical (attributes, child nodes).
|
(package private) void |
initialize(java.lang.String author,
java.lang.String targetNS)
Initialize this WSDL.
|
private java.util.Map<java.lang.String,java.lang.String> |
readAttributes(org.w3c.dom.Element el)
Read all attributes from the specified node.
|
void |
setAppendObjNameToSoapAction(boolean appendObjNameToSoapAction)
Set the
appendObjNameToSoapAction flag. |
void |
setEndpoint(java.lang.String endpoint)
Set the endpoint for this WSDL.
|
void |
setHelpString(java.lang.String helpString)
Set the service documentation.
|
void |
setPortTypeBindingSuffix(java.lang.String portTypeBindingSuffix)
Set the port-type binding suffix.
|
void |
setServiceSuffix(java.lang.String serviceSuffix)
Set the service suffix.
|
void |
setSoapAction(java.lang.String soapAction)
Set the soap action.
|
private static final java.lang.String NS_SOAP
private static final java.lang.String NS_WSDL
private static final java.lang.String NS_XMLNS
private static final java.lang.String NS_PRODATA
private final java.util.Map<java.lang.String,SoapWsdl.ServiceConfig> services
private final org.w3c.dom.Document dom
private final org.w3c.dom.Element root
private final org.w3c.dom.Element elTypes
private java.lang.String targetNamespace
private java.lang.String endpoint
private java.lang.String soapAction
private boolean appendObjNameToSoapAction
soapAction
.private java.lang.String portTypeBindingSuffix
private java.lang.String serviceSuffix
private java.lang.String defaultService
private java.util.Map<java.lang.String,org.w3c.dom.Element> datasets
private java.util.Set<java.lang.String> tableParams
private java.lang.String helpString
public void setHelpString(java.lang.String helpString)
helpString
- The help string.public void setEndpoint(java.lang.String endpoint)
endpoint
- The configured endpoint from the .wsm file.public void setAppendObjNameToSoapAction(boolean appendObjNameToSoapAction)
appendObjNameToSoapAction
flag.appendObjNameToSoapAction
- The new appendObjNameToSoapAction
value.public void setPortTypeBindingSuffix(java.lang.String portTypeBindingSuffix)
portTypeBindingSuffix
- The new portTypeBindingSuffix
value.public void setServiceSuffix(java.lang.String serviceSuffix)
serviceSuffix
- The new service suffix.public void setSoapAction(java.lang.String soapAction)
soapAction
- The SOAP action.public void addService(java.lang.String service, java.lang.String parentService)
service
- The service name.parentService
- The parent service name.public void addOperation(SoapOperation operation)
operation
- The SOAP operation configuration.public org.w3c.dom.Document generate()
services
and create the WSDL
message, port-type, binding and service nodes.void initialize(java.lang.String author, java.lang.String targetNS)
author
- The author name.targetNS
- The target namespace.private org.w3c.dom.Element createBindingOperation(SoapWsdl.ServiceConfig srv, SoapOperation operation, java.lang.String name, java.lang.Boolean headerID)
srv
- The service configuration.operation
- The SOAP operation.name
- The binding operation name.headerID
- Flag indicating if the input message contains a header ID.private org.w3c.dom.Element createPortTypeOperation(SoapWsdl.ServiceConfig srv, java.lang.String name, java.lang.String typeName)
srv
- The service configuration.name
- The operation name.typeName
- The operation's type for the input, output or fault messages.private org.w3c.dom.Element createMessage(SoapWsdl.ServiceConfig srv, java.lang.String name, java.lang.String element, java.lang.String partName)
srv
- The service configuration.name
- The message name.element
- The overriding name for the 'element' attribute at the message.partName
- The 'name' attribute value. Defaults to 'parameters'.private org.w3c.dom.Element createTableParam(SoapOperation operation, SoapOperationParameter par)
operation
- The SOAP operation.par
- The table parameter.private org.w3c.dom.Element createDataSetBeforeImage(SoapWsdl.ServiceConfig service, java.lang.String dsname)
service
- The service to which this type belongs.dsname
- The dataset name.private java.lang.String checkDataSetName(org.w3c.dom.Element el)
null
so it
will not be added again to the schema. Otherwise, create an unique name for it, in the datasets
map.el
- The dataset schema element.null
if it already exists.private boolean identicalElements(org.w3c.dom.Element el1, org.w3c.dom.Element el2)
el1
- The first element.el2
- The second element.true
if the elements are identical.private java.util.Map<java.lang.String,java.lang.String> readAttributes(org.w3c.dom.Element el)
el
- The XML node.private org.w3c.dom.Element createTableParam(SoapOperation operation, SoapOperationParameter dataset, SoapOperationParameter tparam)
operation
- The SOAP operation.dataset
- The parent dataset.tparam
- The table reference.private org.w3c.dom.Element createDataSetParam(SoapOperation operation, SoapOperationParameter par)
operation
- The SOAP operation.par
- The dataset parameter.private org.w3c.dom.Element createComplexType(SoapOperation operation, java.lang.String name, java.util.Collection<SoapOperationParameter> parameters, boolean asElement)
operation
- The SOAP operation.name
- The type's name.parameters
- The operation's parameters.asElement
- Flag indicating if an element
node should be used as parent.