Place only targetNamespace in the service endpoint interface or bean service implementation.
@WebService( name = "CustomerService", targetNamespace = "http://org.company.services" ) public class CustomerService { @WebMethod @WebResult(name="CustomerRecord") public CustomerRecord locateCustomer( @WebParam(name="FirstName") String firstName, @WebParam(name="LastName") String lastName, @WebParam(name="Address") USAddress addr) { ... } };
If @WebResult or @WebParam do not have targetNamespace , the default is targetNamespace for the web service.
In the other hand, you can avoid all annotations and use only @WebService if you don't need something custom with JAX-B.
Learn more in the JSR-181 Web Services Metadata for the JavaTM Platform
source share