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 Chris McCormack <ch...@theedmgroup.co.uk> on 2006/03/23 09:01:46 UTC
RE: [axis1.3]Handling AxisFault [any help?]
bump
-----Original Message-----
From: Chris McCormack [mailto:chris.mccormack@theedmgroup.co.uk]
Sent: 22 March 2006 15:45
To: axis-user@ws.apache.org
Subject: RE: [axis1.3]Handling AxisFault
In follow up to my own question :P (after reading around for the 10th time).
Is it possible to define an alternative response type alongside your normal
types. i.e.
<complexType name="CompositeType">
<choice>
<element name="MyDesiredObject" minOccurs="1" maxOccurs="1"
type="tns:MyObject"/>
<element name="NastyString" minOccurs="0" maxOccurs="1"
type="soapenc:string"/>
</choice>
</complexType>
<message name="PO">
<part name="composite" type="tns:Composite"/>
</message>
i.e. MyDesiredObject is "if everything went ok" I would get one of these
back fully populated etc.
Or if an AxisFault was thrown, it would be caught(server side) and the
server alters the message(this bit I have no clue about) and returns a
NastyString with the faultString inside.
Thanks
Chris
-----Original Message-----
From: Chris McCormack [mailto:chris.mccormack@theedmgroup.co.uk]
Sent: 22 March 2006 14:52
To: axis-user@ws.apache.org
Subject: [axis1.3]Handling AxisFault
Hello all -
I am fairly new to Webservices and Axis but have managed ok so far.
Currently using Tomcat 5.5.9, Tiger(1.5), Axis 1.3 final.
I have created a service that has a request flow defined like :
<service name="LookupService" provider="java:RPC" style="rpc" use="encoded">
<requestFlow>
<handler type="DBAuthentication"/>
<handler type="SimpleAuthorisation"/>
</requestFlow>
.
.
.
</service>
The handlers are defined as :
<!-- define an authorisation handler -->
<handler name="DBAuthentication"
type="java:com.blah.webservices.handler.AuthenticationHandler"/>
<handler name="SimpleAuthorisation"
type="java:org.apache.axis.handlers.SimpleAuthorizationHandler">
<parameter name="allowByDefault" value="true"/>
</handler>
This is working fine. But I want to understand how to make it behave
slightly differently.
So my question is :
Inside the "org.apache.axis.handlers.SimpleAuthorizationHandler" invoke
method.
It checks for
if (user == null)
throw new AxisFault("Server.NoUser",
Messages.getMessage("needUser00"), null, null);
Is it possible to catch this/all AxisFault server side and have it returned
to the client as a substituted String?
Or even just the getFaultString() message as a String?
thanks
Chris
______________________________
This email has been scanned for all viruses by the MessageLabs SkyScan
service. For more information on a proactive anti-virus service working
around the clock, around the globe, visit http://www.messagelabs.com
This email originated externally and has been scanned by MessageLabs
______________________________
This email has been scanned for all viruses by the MessageLabs SkyScan
service. For more information on a proactive anti-virus service working
around the clock, around the globe, visit http://www.messagelabs.com
This email originated externally and has been scanned by MessageLabs
______________________________
This email has been scanned for all viruses by the MessageLabs SkyScan
service. For more information on a proactive anti-virus service working
around the clock, around the globe, visit http://www.messagelabs.com