This class represents a table of all of the top-level symbols from a set of WSDL Definitions and
DOM Documents: XML types; WSDL messages, portTypes, bindings, and services.
This symbolTable contains entries of the form
where key is of type QName and value is
of type Vector. The Vector's elements are all of the objects that have the given QName. This is
necessary since names aren't unique among the WSDL types. message, portType, binding, service,
could all have the same QName and are differentiated merely by type. SymbolTable contains
type-specific getters to bypass the Vector layer:
public PortTypeEntry getPortTypeEntry(QName name), etc.
add
protected void add(String context,
Definition def,
Document doc)
throws IOException,
SAXException,
WSDLException,
ParserConfigurationException
Add the given Definition and Document information to the symbol table (including imported
symbols), populating it with SymTabEntries for each of the top-level symbols. When the
symbol table has been populated, iterate through it, setting the isReferenced flag
appropriately for each entry.
context
- def
- doc
-
dump
public void dump(java.io.PrintStream out)
Dump the contents of the symbol table. For debugging purposes only.
out
-
ensureOperationMessageValid
protected void ensureOperationMessageValid(Message message)
throws IOException
ensures that a message in a
<input>
,
<output>
,
or
<fault> element in an
<operation>
element is valid. In particular, ensures that
- an attribute
message
is present (according to the
XML Schema for WSDL 1.1 message
is required
- the value of attribute
message
(a QName) refers to
an already defined message
Note: this method should throw a
javax.wsdl.WSDLException
rather than
a
java.io.IOException
message
- the message object
ensureOperationValid
protected void ensureOperationValid(Operation operation)
throws IOException
ensures that an an element
<operation>
within
an element
<portType>
is valid. Throws an exception
if the operation is not valid.
Note: this method should throw a
javax.wsdl.WSDLException
rather than a
java.io.IOException
operation
- the operation element
ensureOperationsOfPortTypeValid
protected void ensureOperationsOfPortTypeValid(PortType portType)
throws IOException
ensures that an an element
<portType>
is valid. Throws an exception if the portType is not valid.
Note: this method should throw a
javax.wsdl.WSDLException
rather than a
java.io.IOException
portType
- the portType element
existsPortWithName
protected boolean existsPortWithName(QName name)
checks whether there exists a WSDL port with a given name in the current
symbol table
name
- the QName of the port. Note: only the local part of the qname is relevant,
since port names are not qualified with a namespace. They are of type nmtoken in WSDL 1.1
and of type ncname in WSDL 1.2
- true, if there is a port element with the specified name; false, otherwise
get
public SymTabEntry get(QName qname,
Class cls)
Get the entry with the given QName of the given class. If it does not exist, return null.
qname
- cls
-
getBindingEntry
public BindingEntry getBindingEntry(QName qname)
Get the BindingEntry with the given QName. If it doesn't exist, return null.
qname
-
getDefinition
public Definition getDefinition()
Get the Definition. The definition is null until
populate is called.
getElement
public Element getElement(QName qname)
Get the Element TypeEntry with the given QName. If it doesn't
exist, return null.
qname
-
getElementFormDefaults
public Map getElementFormDefaults()
getElementIndex
public Map getElementIndex()
Return an unmodifiable map of qnames -> Elements in the symbol
table.
- an unmodifiable
Map
value
getHashMap
public HashMap getHashMap()
Get the raw symbol table HashMap.
getMessageEntries
public List getMessageEntries()
getMessageEntry
public MessageEntry getMessageEntry(QName qname)
Get the MessageEntry with the given QName. If it doesn't exist, return null.
qname
-
getOperationParameters
public Parameters getOperationParameters(Operation operation,
String namespace,
BindingEntry bindingEntry)
throws IOException
For the given operation, this method returns the parameter info conveniently collated.
There is a bit of processing that is needed to write the interface, stub, and skeleton.
Rather than do that processing 3 times, it is done once, here, and stored in the
Parameters object.
operation
- namespace
- bindingEntry
-
getParametersFromParts
public void getParametersFromParts(Vector v,
Collection parts,
boolean literal,
String opName,
BindingEntry bindingEntry)
throws IOException
This method returns a vector containing Parameters which represent
each Part (shouldn't we call these "Parts" or something?)
This routine does the wrapped doc/lit processing.
It is also used for generating Faults, and this really confuses things
but we need to do the same processing for the fault messages.
This whole method is waaaay too complex.
It needs rewriting (for instance, we sometimes new up
a Parameter, then ignore it in favor of another we new up.)
v
- The output vector of parametersparts
- The parts of the messageliteral
- Are we in a literal operation (or fault)?opName
- The operation (or fault) namebindingEntry
- The binding for this operation - can be NULL if we are looking at a fault
getPortTypeEntry
public PortTypeEntry getPortTypeEntry(QName qname)
Get the PortTypeEntry with the given QName. If it doesn't exist, return null.
qname
-
getServiceEntry
public ServiceEntry getServiceEntry(QName qname)
Get the ServiceEntry with the given QName. If it doesn't exist, return null.
qname
-
getSymbols
public Vector getSymbols(QName qname)
Get the list of entries with the given QName. Since symbols can share QNames, this list is
necessary. This list will not contain any more than one element of any given SymTabEntry.
qname
-
getType
public Type getType(QName qname)
Get the Type TypeEntry with the given QName. If it doesn't
exist, return null.
qname
-
getTypeEntry
public TypeEntry getTypeEntry(QName qname,
boolean wantElementType)
Get the type entry for the given qname.
qname
- wantElementType
- boolean that indicates type or element (for type= or ref=)
getTypeEntryCount
public int getTypeEntryCount()
Return the count of TypeEntries in the symbol table.
- an
int
value
getTypeIndex
public Map getTypeIndex()
Return an unmodifiable map of qnames -> Elements in the symbol
table.
- an unmodifiable
Map
value
getTypes
public Vector getTypes()
use specialized get{Element,Type}Index() methods instead
Get the list of all the XML schema types in the symbol table. In other words, all entries
that are instances of TypeEntry.
getWSDLURI
public String getWSDLURI()
Get the WSDL URI. The WSDL URI is null until populate
is called, and ONLY if a WSDL URI is provided.
isKnownNamespace
public boolean isKnownNamespace(String namespace)
Check if this is a known namespace (soap-enc or schema xsd or schema xsi or xml)
namespace
-
- true if this is a know namespace.
isQuiet
public boolean isQuiet()
Method isQuiet
isWrapped
public boolean isWrapped()
Are we wrapping literal soap body elements.
populate
public void populate(String uri)
throws IOException,
WSDLException,
SAXException,
ParserConfigurationException
Call this method if you have a uri for the WSDL document
uri
- wsdlURI the location of the WSDL file.
populate
public void populate(String context,
Document doc)
throws IOException,
SAXException,
WSDLException,
ParserConfigurationException
Call this method if your WSDL document has already been parsed as an XML DOM document.
context
- context This is directory context for the Document. If the Document were from file "/x/y/z.wsdl" then the context could be "/x/y" (even "/x/y/z.wsdl" would work). If context is null, then the context becomes the current directory.doc
- doc This is the XML Document containing the WSDL.
populate
public void populate(String uri,
String username,
String password)
throws IOException,
WSDLException,
SAXException,
ParserConfigurationException
Method populate
uri
- username
- password
-
populateTypes
public void populateTypes(URL context,
Document doc)
throws IOException,
SAXException,
WSDLException,
ParserConfigurationException
Populate the symbol table with all of the Types from the Document.
context
- doc
-
processTypes
protected void processTypes()
setQuiet
public void setQuiet(boolean quiet)
Method setQuiet
quiet
-
setWrapArrays
public void setWrapArrays(boolean wrapArrays)
setWrapped
public void setWrapped(boolean wrapped)
Turn on/off element wrapping for literal soap body's.
wrapped
-