log.debug("Deserialize fault: " + faultMetaData);
QName xmlType = faultMetaData.getXmlType();
Class javaType = faultMetaData.getJavaType();
// Get the deserializer from the type mapping
AbstractDeserializerFactory desFactory = (AbstractDeserializerFactory)typeMapping.getDeserializer(javaType, xmlType);
if (desFactory == null)
throw new JAXRPCException("Cannot obtain deserializer factory for: " + xmlType);
// Try jaxb deserialization
try
{
// http://jira.jboss.org/jira/browse/JBWS-955
// Cannot deserialize fault detail
String prefix = deName.getPrefix();
if (prefix.length() > 0)
{
String nsURI = deName.getURI();
String attrValue = deElement.getAttribute("xmlns:" + prefix);
if (nsURI.length() > 0 && attrValue.length() == 0)
deElement.addNamespaceDeclaration(prefix, nsURI);
}
Source xmlFragment = new DOMSource(deElement);
DeserializerSupport des = (DeserializerSupport)desFactory.getDeserializer();
Object userEx = des.deserialize(xmlName, xmlType, xmlFragment, serContext);
if (userEx == null || (userEx instanceof Exception) == false)
throw new WSException("Invalid deserialization result: " + userEx);
faultEx.initCause((Exception)userEx);