package personservice; import javax.jws.WebMethod; import javax.jws.WebResult; import javax.jws.WebService; import javax.jws.soap.SOAPBinding; @WebService( // all values must match corresponding attributes // and elements of the WSDL file // Name of the port type in WSDL name="PersonService", // Target namespace of WSDL, not of the schema targetNamespace="http://personservice", serviceName="PersonServicePorts", portName="PersonService", // the file must be available to the Web container wsdlLocation="WEB-INF/wsdl/PersonService.wsdl" ) /* * We'are using "bare" style since "add" operation * takes only one argument, person document. Therefore, there * is no need to "wrap" it by nesting it inside operation element. * Note that "wrapped" style is the default. */ @SOAPBinding(parameterStyle=SOAPBinding.ParameterStyle.BARE) public class PersonService { @WebResult(name = "status") public String add( Person person ) { System.out.println("Adding person :"+person ); return "Added "+person.getFullName(); } }