public class WSDLParser
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private CodeWriter |
code |
java.lang.String |
dirPath |
(package private) static org.slf4j.Logger |
LOG |
private org.apache.ws.commons.schema.XmlSchema |
schema |
java.lang.String |
serviceName |
java.lang.String |
serviceUrl |
private javax.wsdl.Port |
soapPort |
java.lang.String |
soapPortName |
java.lang.String |
wsdlUrl |
java.lang.String |
wsNamespace |
Constructor and Description |
---|
WSDLParser() |
Modifier and Type | Method and Description |
---|---|
private void |
convertWSDLtoHTML(org.w3c.dom.Document wsdlDoc)
Creates a HTML page for clients using XSLT that displays information
how to access/use the Web service.
|
private static java.util.List<java.lang.String> |
enumeratorValues(org.apache.ws.commons.schema.XmlSchemaSimpleType type)
Retrieve the string values for an enumeration.
|
private void |
getOperations()
Extracts the operations offered by a web service from
the WSDL definition and calls the routines for code
stub creation and respective usage documentation.
|
private java.lang.String |
getParameterDetails(java.lang.String name,
javax.xml.namespace.QName elementName,
javax.xml.namespace.QName typeName)
Fetches details (names and types) for a given operation parameter or return value
|
java.lang.String |
getPortName()
Getter for SOAP port name
|
private org.w3c.dom.Document |
getWSDLAsDocument()
Gets the WSDL content from URL and creates a document from it.
|
private void |
initializeVariables(javax.wsdl.Definition def)
Reads the details from the WSDL definition.
|
static boolean |
isEnumeration(org.apache.ws.commons.schema.XmlSchemaSimpleType type)
Return true if a simple type is a straightforward XML Schema representation of an enumeration.
|
private static boolean |
isOptional(org.apache.ws.commons.schema.XmlSchemaElement element)
Determines if an element is optional
|
private java.lang.String |
processComplexType(org.apache.ws.commons.schema.XmlSchemaComplexType elemType,
java.lang.String name)
Processes an XML Schema Complex Type entity.
|
private java.lang.String |
processSimpleType(org.apache.ws.commons.schema.XmlSchemaSimpleType type,
java.lang.String name,
boolean isOptional)
Determines the type name of an XML Schema Simple Type entity
|
void |
readWSDL()
Main method that starts the WSDL parsing process and calls other helper methods.
|
static final org.slf4j.Logger LOG
public java.lang.String wsdlUrl
public java.lang.String serviceUrl
public java.lang.String serviceName
public java.lang.String wsNamespace
public java.lang.String soapPortName
public java.lang.String dirPath
private javax.wsdl.Port soapPort
private org.apache.ws.commons.schema.XmlSchema schema
private CodeWriter code
public void readWSDL()
private org.w3c.dom.Document getWSDLAsDocument()
private void initializeVariables(javax.wsdl.Definition def)
private void convertWSDLtoHTML(org.w3c.dom.Document wsdlDoc)
private void getOperations()
private java.lang.String getParameterDetails(java.lang.String name, javax.xml.namespace.QName elementName, javax.xml.namespace.QName typeName)
name
- A String representing the name of the part within the WSDLelementName
- The qualified name of the actual part to identify it uniquely if possibletypeName
- The qualified name of the parts type to use it directly if elementName is not setprivate java.lang.String processComplexType(org.apache.ws.commons.schema.XmlSchemaComplexType elemType, java.lang.String name)
elemType
- The complex entity to parsename
- The name of this entity to use for generationprivate java.lang.String processSimpleType(org.apache.ws.commons.schema.XmlSchemaSimpleType type, java.lang.String name, boolean isOptional)
type
- The entity to checkname
- The name of that entityisOptional
- Whether this is defined as optional in the WSDL or notpublic static boolean isEnumeration(org.apache.ws.commons.schema.XmlSchemaSimpleType type)
type
- Simple type, possible an enumeration.private static java.util.List<java.lang.String> enumeratorValues(org.apache.ws.commons.schema.XmlSchemaSimpleType type)
type
- private static boolean isOptional(org.apache.ws.commons.schema.XmlSchemaElement element)
element
- The element to checkpublic java.lang.String getPortName()