Search code examples
web-servicesapache-axishandler

How to create axis2 login handler


I'm studying web services with Axis2, I have to create a handler that checks whether a user can access to a service. I did this, but how can I return an error message to the client? For now I'm using the AxisFaultException, is this a good practice? Is possible to give another chance to the user? maybe using InvocationResponse.Suspend.. Thanks


Solution

  • When you build authentication (username/password) within the application layer, the answer to your question is yes, a soap exception is good practice.

    When the user (the client) tries to access your service, it probably uses libraries/applications to communicate with your service, and catching soap exceptions should not be a problem.

    I'm not sure what you want to accomplish with additional attempts, but they should come in new requests, not within the same request.