Skip to content

Commit

Permalink
Merge pull request #4 from dsulochana/dev
Browse files Browse the repository at this point in the history
Setting this HANDLER property in before validaition  in order to handle errors ESB commonFault seq
  • Loading branch information
dsulochana authored Nov 11, 2020
2 parents c14d354 + 6bd4a5f commit c266ff2
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 c266ff2

Please sign in to comment.