I have a lot of endpoints annotated with @WebService(targetNamespace = "mynamespace"). Every @WebResult and @WebParam has the same definition of targetNamespace = "mynamespace".
Is there a way to configure JAX-WS (Metro implementation) to use "mynamespace" as targetNamespace by default?
I would like to use the annotations without any attributes and get rid of the duplicate declarations, just like convention over configuration.
Only put the
targetNamespacein the service endpoint interface or service implementation bean.If
@WebResultor@WebParamhave notargetNamespace, the default is thetargetNamespacefor the Web Service.In another hand, you can avoid the all annotations and only use the
@WebServiceif you don't need something custom with JAX-B.See more in JSR-181 Web Services Metadata for the JavaTM Platform