Hi there,

i was wondering whether there is a way to change the faultcode in Axis,
which is sent back from the framework after a normal SoapException is thrown
in a Java Web Service. 

Here is the xml-text that is recieved: 

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";
<faultstring>org.apache.soap.SOAPException:my error code</faultstring> 
<faultData xsi:type="ns1:SOAPException" xmlns:ns1="http://soap.apache.org";>
<faultCode xsi:type="xsd:string" xsi:nil="true"/>
<message xsi:type="xsd:string">my error text</message>
<targetException xsi:type="xsd:anyType" xsi:nil="true"/>
<rootException xsi:type="xsd:anyType" xsi:nil="true"/>
<cause xsi:nil="true"/>

Is there any way to change or configure Axis in such a way, that the
generated XML for the execption looks like this?

  <faultstring>my error text</faultstring> 
        <!-- some kind of error code -->

in Java i use this code to throw the exception:
        throw myEXCEPTION;

and i have used this as a defition for myEXCEPTION:

import org.apache.soap.SOAPException;

public final static SOAPException myEXCEPTION = new SOAPException();
myEXCEPTION.setMessage("my error text");

In the WSDL - File the corresponding Exception parts look like these:

<schema targetNamespace="http://soap.apache.org";
   <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
   <complexType name="SOAPException">
     <element name="faultCode" nillable="true" type="xsd:string"/>
     <element name="message" nillable="true" type="xsd:string"/>
     <element name="targetException" nillable="true" type="xsd:anyType"/>
     <element name="rootException" nillable="true" type="xsd:anyType"/>
   <element name="SOAPException" nillable="true" type="tns4:SOAPException"/>

   <wsdl:message name="SOAPException">

      <wsdl:part name="fault" type="tns4:SOAPException"/>


and in every <wsdl:operation> there is then also this line:

         <wsdl:fault message="impl:SOAPException" name="SOAPException"/>

So my question is: can i somehow make the created exception look like the
one i provided? (this is needed, because in the old application this was the
returned error text and the new error needs to be the same way to work

i hope there is someone who can help me out. Any help will be greatly


Reza Eslami

Dipl.-Inform. Reza Eslami
INNOVA Beratungsgesellschaft mbH
Emil-Figge-Straße 91
44277 Dortmund
Tel: +49 (0) 231 / 97677 - 556,  Fax - 519
Homepage: www.innovaberatung.com

Geschäftsführer: Dr. Volker Zurwehn
Sitz der Gesellschaft: Dortmund
Registergericht Dortmund, HRB 14888
Steuernummer 315/5749/0367

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]