FaultInfopublic class FaultInfo extends Object Fault information object. This should probably really be FaultEntry and
it should be a subclass of SymTabEntry, but faults aren't first-class
objects in WSDL, so I'm not sure what the FaultEntry should contain and
how it should be constructed, so for now leave it as a simple object. |
Fields Summary |
---|
private javax.wsdl.Message | messageField message | private QName | xmlTypeField xmlType | private org.apache.axis.constants.Use | useField use | private QName | qNameField qName | private String | nameField name |
Constructors Summary |
---|
public FaultInfo(javax.wsdl.Fault fault, org.apache.axis.constants.Use use, String namespace, SymbolTable symbolTable)This constructor creates FaultInfo for a binding fault.
If the part of the fault is a type, then the QName is
derived from the element name and the provided namespace
(this namespace SHOULD come from the binding).
If the part of the fault is an element, then the QName is
the QName of the element, and the given namespace is ignored.
this.message = fault.getMessage();
this.xmlType = getFaultType(symbolTable, getFaultPart());
this.use = (use != null) ? use : Use.LITERAL;
this.name = fault.getName();
Part part = getFaultPart();
if (part == null) {
this.qName = null;
} else if (part.getTypeName() != null) {
this.qName = new QName(namespace, part.getName());
} else {
this.qName = part.getElementName();
}
| public FaultInfo(javax.wsdl.extensions.soap.SOAPHeaderFault fault, SymbolTable symbolTable)This constructor creates FaultInfo for a soap:headerFault.
MessageEntry mEntry = symbolTable.getMessageEntry(fault.getMessage());
if (mEntry == null) {
throw new IOException(
Messages.getMessage("noMsg", fault.getMessage().toString()));
}
this.message = mEntry.getMessage();
Part part = message.getPart(fault.getPart());
this.xmlType = getFaultType(symbolTable, part);
this.use = Use.getUse(fault.getUse());
if (part == null) {
this.qName = null;
} else if (part.getTypeName() != null) {
this.qName = new QName(fault.getNamespaceURI(), part.getName());
} else {
this.qName = part.getElementName();
}
this.name = qName.getLocalPart();
| public FaultInfo(QName faultMessage, String faultPart, String faultUse, String faultNamespaceURI, SymbolTable symbolTable)Constructor FaultInfo
MessageEntry mEntry = symbolTable.getMessageEntry(faultMessage);
if (mEntry == null) {
throw new IOException(Messages.getMessage("noMsg",
faultMessage.toString()));
}
this.message = mEntry.getMessage();
Part part = message.getPart(faultPart);
this.xmlType = getFaultType(symbolTable, part);
this.use = Use.getUse(faultUse);
if (part == null) {
this.qName = null;
} else if (part.getTypeName() != null) {
this.qName = new QName(faultNamespaceURI, part.getName());
} else {
this.qName = part.getElementName();
}
this.name = qName.getLocalPart();
|
Methods Summary |
---|
private javax.wsdl.Part | getFaultPart()It is assumed at this point that the fault message has only
0 or 1 parts. If 0, return null. If 1, return it.
// get the name of the part
Map parts = message.getParts();
// If no parts, skip it
if (parts.size() == 0) {
return null;
} else {
return (Part) parts.values().iterator().next();
}
| private javax.xml.namespace.QName | getFaultType(SymbolTable st, javax.wsdl.Part part)Get the XML type (QName) for a Fault - look in the (single) fault
part for type="" or element="" - if type, return the QName. If
element, return the reference type for the element.
if (part != null) {
if (part.getTypeName() != null) {
return part.getTypeName();
}
// Literal, so get the element's type
TypeEntry entry = st.getElement(part.getElementName());
if ((entry != null) && (entry.getRefType() != null)) {
return entry.getRefType().getQName();
}
}
return null;
| public javax.wsdl.Message | getMessage()Method getMessage
return message;
| public java.lang.String | getName()Return the name of the fault.
This is the name= attribute from a portType fault
or the localname of a header fault.
return name;
| public javax.xml.namespace.QName | getQName()Return the QName of a fault. This method may return null if no parts
are in the fault message.
If the part of the fault is a type, then the QName is
derived from the element name and the provided namespace
(this namespace SHOULD come from the binding).
If the part of the fault is an element, then the QName is
the QName of the element, and the given namespace is ignored.
return qName;
| public org.apache.axis.constants.Use | getUse()Method getUse
return use;
| public javax.xml.namespace.QName | getXMLType()Method getXMLType
return xmlType;
|
|