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 Bjoern Krueger <kr...@tyntec.biz> on 2007/11/26 12:57:05 UTC

[Axis2] How to send HTTP Status Code 401

Hi,
how can I send a Http Status Code 401 from an AxisFault?

I tried to set the AxisFault Error Code to the HttpStatus Code but it 
still sends back an AxisFault.

Code:
            throw new org.apache.axis2.AxisFault("", 
HttpStatus.getStatusText(HttpStatus.SC_UNAUTHORIZED));

Is there a way to send back a HTTP Status Code?

Please Help me

regards


Björn Krüger

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: [Axis2] How to send HTTP Status Code 401

Posted by Martin Gainty <mg...@hotmail.com>.
Bjoern-
from org.apache.axis.handlers.SimpleAuthorizationHandler.java

          throw new AxisFault(
"Server.Unauthorized",Messages.getMessage("notAuth00", userID,
serviceName),null, null );

Would'nt you want your Security provider code (Rampart?) to handle these
exceptions?

Martin-
----- Original Message -----
From: "Bjoern Krueger" <kr...@tyntec.biz>
To: <ax...@ws.apache.org>
Sent: Monday, November 26, 2007 6:57 AM
Subject: [Axis2] How to send HTTP Status Code 401


> Hi,
> how can I send a Http Status Code 401 from an AxisFault?
>
> I tried to set the AxisFault Error Code to the HttpStatus Code but it
> still sends back an AxisFault.
>
> Code:
>             throw new org.apache.axis2.AxisFault("",
> HttpStatus.getStatusText(HttpStatus.SC_UNAUTHORIZED));
>
> Is there a way to send back a HTTP Status Code?
>
> Please Help me
>
> regards
>
>
> Björn Krüger
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org