Title: Message
Hi
 
I am trying to trap the AXIS fault from my webservice in a server request handler and modify SOAP Fault Block
with a custom message.
 
  public void onFault(MessageContext ctx) {
    System.out.println("Hello, got invoked. I'm onFault method of ErrorHandler.");
 
    try {
 
        Message message = ctx.getResponseMessage();
        SOAPEnvelope soapEnvelope = message.getSOAPEnvelope();
        SOAPBody soapBody = (org.apache.axis.message.SOAPBody) soapEnvelope.getBody();
        SOAPFault soapFault = (org.apache.axis.message.SOAPFault) soapBody.getFault();
        AxisFault af = new AxisFault();
        af.setFaultActor("http://localhost/CustomerService");
        af.setFaultCode("ABCD123456789");
        af.setFaultString("Internationalized Error Messgae");
        soapFault.setFault(af);
        message.saveChanges();
 }
 
 
But at the client side the SOAP Fault message is still the orginal one and not the modified one.
How do I add my own customer error Message?
 
regards
Rajesh
 

Reply via email to