Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. My rest of the classes are:
  2. HelloWorld.java
  3. import javax.jws.WebMethod;
  4. import javax.jws.WebService;
  5. import javax.jws.soap.SOAPBinding;
  6. import javax.jws.soap.SOAPBinding.Style;
  7.  
  8. //Service Endpoint Interface
  9. @WebService
  10. @SOAPBinding(style = Style.RPC)
  11. public interface HelloWorld{
  12.  
  13. @WebMethod String getHelloWorldAsString(String name, String company);
  14.  
  15. }
  16.  
  17. HelloWorldImpl.java:
  18.  
  19. import javax.jws.WebService;
  20.  
  21. import com.sun.xml.internal.ws.developer.SchemaValidation;
  22.  
  23. //Service Implementation
  24. //@SchemaValidation
  25. @WebService(endpointInterface = "org.techsavvy.HelloWorld")
  26. public class HelloWorldImpl implements HelloWorld{
  27.  
  28. @Override
  29. public String getHelloWorldAsString(String name, String company) {
  30.  
  31. return "Hello!! your name is " + name+ " and you work in " +company+ ".";
  32.  
  33.  
  34. }
  35.  
  36. }
  37.  
  38.  
  39. HelloWorldPublisher.java
  40.  
  41. import javax.xml.ws.Endpoint;
  42. import org.techsavvy.HelloWorldImpl;
  43.  
  44. //Endpoint publisher
  45. public class HelloWorldPublisher{
  46.  
  47. public static void main(String[] args) {
  48. Endpoint.publish("http://localhost:9999/ws/hello", new HelloWorldImpl());
  49.  
  50. }
  51.  
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement