Try using the WebFault.faultBean element.
@javax.xml.ws.WebFault(faultBean="fromjava.soap12.nosei.server.MyFault2Bean",
name="MyFault2", targetNamespace="
http://mynamespace")
public class Fault2 extends Exception {
int age;
public Fault2 (String message, int age) {
super(message);
this.age = age;
}
public int getAge() {
return age;
}
}
Dima Gutzeit wrote:
> Can anyone comment on this please :-) ?
>
> ----- Original Message -----
> From: Dima Gutzeit <mailto:dima_at_mailvision.com>
> To: users_at_jax-ws.dev.java.net <mailto:users_at_jax-ws.dev.java.net>
> Sent: Thursday, October 19, 2006 9:39 AM
> Subject: @WebFault namespace customization
>
> Hello,
>
> I have several webservices in my application, and each one of them
> can throw a general exception which resides in common namespace of
> my application.
> Each webservice has its own namespace.
>
> After building the webservices and generating wsdl and schema I
> see that each application defines its own exception object in its
> own name space, instead of using the exception from common namespace.
>
> The webfault definition has the targetnamespace attribute :
>
> @WebFault(name="testException",
> targetNamespace=http://test.blah.common)
>
> It seems that webfault behavior differes from simple object
> behavior in this case.
> Any pointers would be appriciated.
>
>
> Regards,
> Dima Gutzeit.
>