[英]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. 我正在使用Axis2研究Web服务,我必须创建一个处理程序来检查用户是否可以访问服务。 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?
现在,我正在使用AxisFaultException,这是一个好习惯吗? Is possible to give another chance to the user?
可以给用户另一个机会吗? maybe using InvocationResponse.Suspend.. Thanks
也许使用InvocationResponse.Suspend ..谢谢
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. 我不确定要通过其他尝试来完成什么,但是它们应该出现在新请求中,而不是在同一请求中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.