SOAPElement soapElement = soapFault.addChildElement("faultactor");
soapElement.addTextNode(faultActor);
}
Exception faultCause = (Exception)faultEx.getCause();
Detail detail = faultEx.getDetail();
if (detail != null)
{
soapFault.addChildElement(detail);
}
else if (faultCause != null && (faultCause instanceof RuntimeException) == false)
{
Class javaType = faultCause.getClass();
TypeMapping typeMapping = serContext.getTypeMapping();
OperationMetaData opMetaData = msgContext.getOperationMetaData();
if (opMetaData != null && opMetaData.getFaultMetaData(javaType) != null)
{
FaultMetaData faultMetaData = opMetaData.getFaultMetaData(javaType);
QName xmlName = faultMetaData.getXmlName();
QName xmlType = faultMetaData.getXmlType();
xmlName = nsRegistry.registerQName(xmlName);
// Get the serializer from the type mapping
AbstractSerializerFactory serFactory = (AbstractSerializerFactory)typeMapping.getSerializer(javaType, xmlType);
if (serFactory == null)
throw new JAXRPCException("Cannot obtain serializer factory for: " + xmlType);
try
{
SerializerSupport ser = (SerializerSupport)serFactory.getSerializer();
Result result = ser.serialize(xmlName, xmlType, faultCause, serContext, null);
XMLFragment xmlFragment = new XMLFragment(result);
Element domElement = xmlFragment.toElement();
SOAPFactoryImpl soapFactory = new SOAPFactoryImpl();
SOAPElement soapElement = soapFactory.createElement(domElement);
detail = soapFault.addDetail();
detail.addChildElement(soapElement);
}
catch (BindingException e)
{
throw new JAXRPCException(e);
}