File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes Custom Authentication in Axis1.4 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Custom Authentication in Axis1.4" Watch "Custom Authentication in Axis1.4" New topic

Custom Authentication in Axis1.4

Jaideep Pujara

Joined: Jun 19, 2003
Posts: 11
I have used my own AuthenticationHandler(extends HTTPAuthHandler of Axis), to authenticate all incoming requests, in an application which host multiple web services using Apache Axis 1.4.
There is a appropritely defined server-config.wsdd, snippet as follows:-
<handler name="auth"
<handler name="http" type="java rg.apache.axis.handlers.http.HTTPAuthHandler">
<service name="getTrades" provider="java:RPC" >
<parameter name="className" value=""/>
<parameter name="allowedMethods" value="getTradeExecutionReport"/>

<handler type="soapmonitor"/>
<handler name="h" type="http"/>
<handler name="as" type="auth"/>

<handler type="soapmonitor"/>

<operation name="getTradeExecutionReport" returnQName="return" returnType="RTypeNS:String" xmlns:RTypeNS="" >
<parameter name="companyName" type="tns:string" xmlns:tns=""/>
<parameter name="userName" type="tns:string" xmlns:tns=""/>

Problem statement is:-
In case of authentication failure, I want to stop the further processing of request and respond back a specific XML message(NOT AxisFault), from AuthenticationHandler itself, containing adequate text: "Authentication Failed due".

But I could not figure out any procedure to do this. I dont want to raise AxisFault because it has standard response format.

Putting it in other words: I want to send a response(for client: as if it is coming from the actual service called) from AuthenticationHandler itself, in event of Auth Failure.

subject: Custom Authentication in Axis1.4
Similar Threads
problem when trying to use return type Integer
JSP as webservice client
Why XSL failed to transform the XML when root node has namespace defined?
The AXIS engine could not find a target service to invoke
Axis Fault: no such operation