// Look for <exceptionName> element and create a class
// with that name - this is Axis specific and is
// replaced by the Exception map
if (name.equals("exceptionName")) {
// Set up deser of exception name string
Deserializer dser = context.getDeserializerForType(Constants.XSD_STRING);
dser.registerValueTarget(new CallbackTarget(this, "exceptionName"));
return (SOAPHandler)dser;
}
// Look up this element in our faultMap
// if we find a match, this element is the fault data
MessageContext msgContext = context.getMessageContext();
SOAPConstants soapConstants = msgContext.getSOAPConstants();
OperationDesc op = msgContext.getOperation();
Class faultClass = null;
QName faultXmlType = null;
if (op != null) {
FaultDesc faultDesc = null;
// allow fault type to be denoted in xsi:type
faultXmlType = context.getTypeFromAttributes(namespace,
name,
attributes);
if (faultXmlType != null) {
faultDesc = op.getFaultByXmlType(faultXmlType);
}
// If we didn't get type information, look up QName of fault
if (faultDesc == null) {
faultDesc = op.getFaultByQName(qn);
if ((faultXmlType == null) && (faultDesc != null)) {
faultXmlType = faultDesc.getXmlType();
}
}
// Set the class if we found a description
if (faultDesc != null) {
try {
faultClass = ClassUtils.forName(faultDesc.getClassName());
} catch (ClassNotFoundException e) {
// Just create an AxisFault, no custom exception
}
}
} else {
faultXmlType = context.getTypeFromAttributes(namespace,
name,
attributes);
}
if (faultClass == null) {
faultClass =
context.getTypeMapping().getClassForQName(faultXmlType);
}
if(faultClass != null && faultXmlType != null) {
builder.setFaultClass(faultClass);
builder.setWaiting(true);
// register callback for the data, use the xmlType from fault info
Deserializer dser = null;
if (attributes.getValue(soapConstants.getAttrHref()) == null) {
dser = context.getDeserializerForType(faultXmlType);
} else {
dser = new DeserializerImpl();
dser.setDefaultType(faultXmlType);
}
if (dser != null) {
dser.registerValueTarget(new CallbackTarget(this, "faultData"));
}
return (SOAPHandler)dser;
}
return null;
}