You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by rabelenda <ra...@gmail.com> on 2009/01/07 15:17:48 UTC

InFlow module response

Hi, I', trying to make an axis2 module to check, when a message comes to a
service, if the user has access rights to the operation. For this I need in
the handler to make a response to the client when the user hasn't got
permission. How can I manage to create a response to the client in the
InFlow handler of the service? Any ideas will be appreciated.
-- 
View this message in context: http://www.nabble.com/InFlow-module-response-tp21332168p21332168.html
Sent from the Axis - User mailing list archive at Nabble.com.


Re: InFlow module response

Posted by rabelenda <ra...@gmail.com>.


Nunny wrote:
> 
> On 1/7/09, rabelenda <ra...@gmail.com> wrote:
>>
>> Hi, I', trying to make an axis2 module to check, when a message comes to
>> a
>> service, if the user has access rights to the operation. For this I need
>> in
>> the handler to make a response to the client when the user hasn't got
>> permission.
> 
> If you attach your handler to phase after the dispatching phase, you
> will be able to get the service name and the operation name. How do
> find who the user is ? Transport headers ? or custom header with
> username ? If you the user information also you can do the necessary
> check.
> 
I use rampart and spring, putting the user obtained from the rampart handler
and putting it into a spring bean.

Nunny wrote:
> 
> How can I manage to create a response to the client in the
>> InFlow handler of the service? Any ideas will be appreciated.
> 
> Can't you just return a fault by throwing an AxisFault ?
> 
The problem that I'm having with this approach (throwing an AxisFault) is
that when I throw an AxisFault (ie: throw new AxisFaut("The user hasn't got
permission");) then the rampart client throws an exception
"org.apache.rampart.RampartException: SOAP header missing", I think that it
is because the AxisFault thrown by me isn't catched by the rampart module,
so I was thinking in reply with some type of message. Any ideas?
-- 
View this message in context: http://www.nabble.com/InFlow-module-response-tp21332168p21335193.html
Sent from the Axis - User mailing list archive at Nabble.com.


Re: InFlow module response

Posted by Nandana Mihindukulasooriya <na...@gmail.com>.
On 1/7/09, rabelenda <ra...@gmail.com> wrote:
>
> Hi, I', trying to make an axis2 module to check, when a message comes to a
> service, if the user has access rights to the operation. For this I need in
> the handler to make a response to the client when the user hasn't got
> permission.

If you attach your handler to phase after the dispatching phase, you
will be able to get the service name and the operation name. How do
find who the user is ? Transport headers ? or custom header with
username ? If you the user information also you can do the necessary
check.

How can I manage to create a response to the client in the
> InFlow handler of the service? Any ideas will be appreciated.

Can't you just return a fault by throwing an AxisFault ?

thanks,
nandana


-- 
Nandana Mihindukulasooriya
WSO2 inc.

http://nandana83.blogspot.com/
http://www.wso2.org