Hi.

with some help from some people on this list I was able to get

custom exceptions to work on 



java version "1.4.1_03"

java, axis-1_2beta

windows xp

jakarta-tomcat-4.1.29



I did the following

1. took the code from %AXIS_HOME%\samples\faults and 

converted it to wrapped literal web service. I have attached my build.xml. This will 
create the wsdl file. 



2. Run the WSDL2java to create my server and client code.

One weird issue was I got a compiler error message. To get

around the problem I commented out the getCause() method



C:\axis-1_2beta\samples\faults\samples\faults>javac *.java

NoSuchEmployeeFault.java:33: getCause() in samples.faults.NoSuchEmployeeFault ca

nnot override getCause() in java.rmi.RemoteException; attempting to use incompat

ible return type

found   : java.lang.Object

required: java.lang.Throwable

    public java.lang.Object getCause() {

                            ^

1 error



C:\axis-1_2beta\samples\faults\samples\faults>



3. Created a test client, I was able to trap the NoSuchEmployeeFault exception. 



Hope this helps. Note: Thanks for the article, but doing the

above I didn't have to manually update the wsdl file. 



-d



 --- On Fri 08/20, matthew.hawthorne < [EMAIL PROTECTED] > wrote:

From: matthew.hawthorne [mailto: [EMAIL PROTECTED]

To: [EMAIL PROTECTED]

Date: Fri, 20 Aug 2004 09:00:34 -0700

Subject: Re: Help in Exception handling...



I read the article at 
<br>http://www-106.ibm.com/developerworks/xml/library/ws-tip-jaxrpc.html<br>and made 
some customizations to my exceptions accordingly.  The SOAP <br>looks correct,<br>but 
I just cannot get Axis to instantiate the exceptions on the client <br>side.  They are 
always<br>returned as Axis faults.<br><br>I've got the beanMappings set on the client 
side too, does anyone else <br>have any suggestions?<br><br>Is there a class that I 
can set the DEBUG log level on to see what the <br>problem is?  I'd almost<br>rather 
have it fail than return AxisFaults all the time, it would make <br>things easier to 
debug.<br><br>Thanks!<br>

_______________________________________________

<?xml version="1.0" ?>

<!DOCTYPE project [

        <!ENTITY properties SYSTEM "file:../../xmls/properties.xml">

        <!ENTITY paths  SYSTEM "file:../../xmls/path_refs.xml">

        <!ENTITY taskdefs SYSTEM "file:../../xmls/taskdefs.xml">

        <!ENTITY taskdefs_post_compile SYSTEM "file:../../xmls/taskdefs_post_compile.xml">

        <!ENTITY targets SYSTEM "file:../../xmls/targets.xml">

]>



<project default="compile">

<property name="axis.home" location="../.." />

<property name="componentName" value="samples/faults" />



    &properties;

    &paths;

    &taskdefs;

    &taskdefs_post_compile;

    &targets;

 

    <path id="axis.classpath">

      <fileset dir="${axis.home}/lib">

        <include name="**/*.jar" />

      </fileset>

    </path>

    

    <taskdef resource="axis-tasks.properties" classpathref="axis.classpath" /> 



    <target name="clean"/>



    <target name="copy" depends="setenv"/>



    <target name="compile" depends="copy">

    

    <axis-java2wsdl

     classname="samples.faults.EmployeeInfo"

     style="wrapped"

     use="literal"

     namespace="http://faults.samples";

     location="http://localhost:8080/axis/services/EmployeeInfo";

     output="EmployeeInfo.wsdl">

     <classpath refid="classpath"/>

     <mapping package="samples.faults" namespace="http://faults.samples"/>

     <complextype classname="samples.faults.NoSuchEmployeeFault" namespace="http://faults.samples"; /> 

    </axis-java2wsdl>



    </target>



</project>

Attachment: EmployeeClient.java
Description: Binary data

Reply via email to