use of org.apache.axiom.soap.SOAPFaultCode in project carbon-business-process by wso2.
the class SOAPUtils method createSoapFault.
/**
* Crete SOAP Fault from fault information returned from ODE.
*
* @param bpelMessageContext DTO containing information on current messageflow.
* @param odeMessageContext ODE MyRoleMessageExchange containing information on current process
* invocation.
* @return SOAPFault instance
* @throws AxisFault in case of a error while creating SOAP Fault.
*/
public static SOAPFault createSoapFault(final BPELMessageContext bpelMessageContext, final MessageExchange odeMessageContext) throws AxisFault {
SOAPFactory soapFactory = bpelMessageContext.getSoapFactoryForCurrentMessageFlow();
OMElement detail = buildSoapDetail(bpelMessageContext, odeMessageContext);
SOAPFault fault = soapFactory.createSOAPFault();
SOAPFaultCode code = soapFactory.createSOAPFaultCode(fault);
code.setText(new QName(Namespaces.SOAP_ENV_NS, "Server"));
SOAPFaultReason reason = soapFactory.createSOAPFaultReason(fault);
reason.setText(odeMessageContext.getFault());
SOAPFaultDetail soapDetail = soapFactory.createSOAPFaultDetail(fault);
if (detail != null) {
soapDetail.addDetailEntry(detail);
}
return fault;
}
Aggregations