Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- My rest of the classes are:
- HelloWorld.java
- import javax.jws.WebMethod;
- import javax.jws.WebService;
- import javax.jws.soap.SOAPBinding;
- import javax.jws.soap.SOAPBinding.Style;
- //Service Endpoint Interface
- @WebService
- @SOAPBinding(style = Style.RPC)
- public interface HelloWorld{
- @WebMethod String getHelloWorldAsString(String name, String company);
- }
- HelloWorldImpl.java:
- import javax.jws.WebService;
- import com.sun.xml.internal.ws.developer.SchemaValidation;
- //Service Implementation
- //@SchemaValidation
- @WebService(endpointInterface = "org.techsavvy.HelloWorld")
- public class HelloWorldImpl implements HelloWorld{
- @Override
- public String getHelloWorldAsString(String name, String company) {
- return "Hello!! your name is " + name+ " and you work in " +company+ ".";
- }
- }
- HelloWorldPublisher.java
- import javax.xml.ws.Endpoint;
- import org.techsavvy.HelloWorldImpl;
- //Endpoint publisher
- public class HelloWorldPublisher{
- public static void main(String[] args) {
- Endpoint.publish("http://localhost:9999/ws/hello", new HelloWorldImpl());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement