I'm using user-defined exceptions so I can try to help you.
I'm not really sure it will answer your problem because I don't use Java2WSDL to generate my WSDL.
But in your server code, if you want to change the faultcode, faultstring, details, etc, you can try this :
} catch (the-thrown-exception) {
AxisFault af = new AxisFault("your own faultcode", "your own faultstring", "the actor", null);
// if you want to add details :
af.addFaultDetail(new QName("my namespace", "my tag"), "its value");
throw af;
}
I think it's the better way to throw a user-defined exception. And I don't use special (de)serializers, just Bean(De)Serializer.
Hope this help, Olivier
Gei�, Matthias wrote:
Would I need to realise own serializers / deserializers for my exceptions?
-----Urspr�ngliche Nachricht-----
Von: Gei�, Matthias Gesendet: Dienstag, 1. April 2003 15:25
An: ' ([EMAIL PROTECTED])'
Betreff: Wrong Fault-Elements in dynamically generated WSDL
Hi,
Hope someone can help me with my problem:
I start from a Java interface (possible Exceptions are all in one seperate package), generate the WSDL description (that contains the appropriate xml schema type definitions, the message definitions and the <wsdl:fault .../> Elements in the operation definition.
I generate the server-deployment-file and the client-stub (who's methods throw the correct Java exceptions). BUT when I deploy the Web Service and view the dynamically generated WSDL it contains no definitions for exception types / messages and no wsdl:fault elements!!!
If an exception is really thrown on the server side, the following SOAP-message is sent:
<?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body> <soapenv:Fault> <faultcode xmlns:ns1="http://xml.apache.org/axis/">ns1:Server.userException</faultcode> <faultstring>mypackage.myexceptions.BlaException: Exception message blablabla.</faultstring> <detail> <ns2:stackTrace xmlns:ns2="http://xml.apache.org/axis/">... </ns2:stackTrace> </detail> </soapenv:Fault> </soapenv:Body> </soapenv:Envelope>
I guess in the faultcode element the real name of the exception should be found. Thanks for your help, Best regards, Matthias
