use of com.evolveum.midpoint.prism.marshaller.BeanMarshaller in project midpoint by Evolveum.
the class MiscSchemaUtil method serializeFaultMessage.
// TODO some better place
public static void serializeFaultMessage(Detail detail, FaultMessage faultMessage, PrismContext prismContext, Trace logger) {
try {
BeanMarshaller marshaller = ((PrismContextImpl) prismContext).getBeanMarshaller();
// TODO
XNode faultMessageXnode = marshaller.marshall(faultMessage.getFaultInfo());
RootXNode xroot = new RootXNode(SchemaConstants.FAULT_MESSAGE_ELEMENT_NAME, faultMessageXnode);
xroot.setExplicitTypeDeclaration(true);
QName faultType = prismContext.getSchemaRegistry().determineTypeForClass(faultMessage.getFaultInfo().getClass());
xroot.setTypeQName(faultType);
((PrismContextImpl) prismContext).getParserDom().serializeUnderElement(xroot, SchemaConstants.FAULT_MESSAGE_ELEMENT_NAME, detail);
} catch (SchemaException e) {
logger.error("Error serializing fault message (SOAP fault detail): {}", e.getMessage(), e);
}
}
Aggregations