You might have to clear the To header on MessageContext.
On Oct 20, 2015, at 9:14 PM, Malintha Amarasinghe <malintha.pra...@gmail.com> wrote: > Hi All, > > We are implementing a custom handler for an API (extending AbstractHandler) > such that it authenticates the client using incoming request headers and > gives a custom authentication failure message back to the client when an > authentication failure happens. We set the custom fault envelope to the > message context and send it back to the client like below. > > messageContext.setEnvelope(faultEnvelope); > Axis2Sender.sendBack(messageContext); > > When but the problem we face is when the client give a POST request to the > API with a request body, this does not send the custom response back to the > client. Instead of that, it resend the same request payload sent by the > client back to him. > > Highly appreciate if you can suggest us a better way to solve this. > > Thank you. > Malintha Amarasinghe, > Undergraduate, > Dept.of Computer Science and Engineering, > University of Moratuwa. -- Hiranya Jayathilaka Mayhem Lab/RACE Lab; Dept. of Computer Science, UCSB; http://cs.ucsb.edu E-mail: hira...@cs.ucsb.edu; Mobile: +1 (805) 895-7443 Blog: http://techfeast-hiranya.blogspot.com