users@jax-ws.java.net

Re: _at_WebFault namespace customization

From: Dima Gutzeit <dima_at_mailvision.com>
Date: Tue, 14 Nov 2006 21:33:02 +0200

Sergey,

First of all you have to make sure that your exception class is annotated like the following :

@WebFault(name = "MyException", targetNamespace = "http://my.namespace/commons",
    faultBean = "com.company.ws.MyExceptionBean")
public class MyException extends RemoteException {...}

Please pay special attention to the "faultBean" attribute. If you use the exception from several different namespaces, this attribute tell JAXWS to reuse the exception, instead of declaring it over and over again. JAX-WS would create the class by himself at compile time, so you do not have to create it by yourself.

_Exception suffix is not something you should be worried about ....


Now, one more tip about package name customization:

You should use package-info.java file in each package if you wish to customize the default namespace of the package:

@javax.xml.bind.annotation.XmlSchema(
    namespace = "http://my.namespace/commons"
) package com.company.ws

HIH.

Regards,
Dima Gutzeit.
  ----- Original Message -----
  From: Sergey Shepelevich
  To: dima_at_mailvision.com
  Sent: Tuesday, November 14, 2006 3:47 PM
  Subject: @WebFault namespace customization


  Hi Dima,




  We have similar problem with exceptions generated by jaxws.

  Did you find the solution of how to use your own exceptions instead of generated

  or at least how to make @WebFault working and get rid from "_Exception" suffix ?




  Let me know please :)

  Thanks in advance.




  --

  Best Regards,

  Bytex

  mailto:sergey_at_shepelevich.com