FileDocCategorySizeDatePackage
FaultInfo.javaAPI DocApache Axis 1.47421Sat Apr 22 18:57:28 BST 2006org.apache.axis.wsdl.symbolTable

FaultInfo

public 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
message
Field message
private QName
xmlType
Field xmlType
private org.apache.axis.constants.Use
use
Field use
private QName
qName
Field qName
private String
name
Field 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.

param
fault
param
use
param
namespace
param
symbolTable


        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.

param
fault
param
symbolTable
throws
IOException


        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

param
faultMessage
param
faultPart
param
faultUse
param
faultNamespaceURI
param
symbolTable
throws
IOException


        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.PartgetFaultPart()
It is assumed at this point that the fault message has only 0 or 1 parts. If 0, return null. If 1, return it.

return


        // 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.QNamegetFaultType(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.

param
part the Fault to dig into
param
st the SymbolTable we're using
return
the XML type of the Fault's part, or null


        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.MessagegetMessage()
Method getMessage

return

        return message;
    
public java.lang.StringgetName()
Return the name of the fault. This is the name= attribute from a portType fault or the localname of a header fault.

return

        return name;
    
public javax.xml.namespace.QNamegetQName()
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

        return qName;
    
public org.apache.axis.constants.UsegetUse()
Method getUse

return

        return use;
    
public javax.xml.namespace.QNamegetXMLType()
Method getXMLType

return

        return xmlType;