Skip to content

Commit

Permalink
Setting this HANDLER property in before validaition in order to handl…
Browse files Browse the repository at this point in the history
…e errors ESB commonFault seq
  • Loading branch information
dsulochana committed Nov 11, 2020
1 parent 37f4157 commit 6bd4a5f
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,8 @@ private OperatorEndpoint getEndpoint (String address, MessageContext messageCont
*/
@Override
public boolean validate(String httpMethod, String requestPath, JSONObject jsonBody, MessageContext context) throws Exception {
// Setting this property in order to handle errors ESB commonFault seq.
HandlerUtils.setHandlerProperty(context, this.getClass().getSimpleName());
if (!httpMethod.equalsIgnoreCase("POST")) {
((Axis2MessageContext) context).getAxis2MessageContext().setProperty("HTTP_SC", 405);
throw new Exception("Method not allowed");
Expand Down

0 comments on commit 6bd4a5f

Please sign in to comment.