Sunday, May 22, 2016

Hosting a SOAP Web Service Java


Step 1
Create a dynamic web project in eclipse
Create an endpoint interface
package org.myProject.passwordManager;
 import javax.jws.WebMethod;
 import javax.jws.WebService;
 @WebService public interface PasswordManagerWS {
 @WebMethod public abstract String getPassword(String appId);
 }
Create an implementation of Web Service
package org.myProject.passwordManager;
 import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding; @WebService(endpointInterface="org.myProject.passwordManager.PasswordManagerWS", serviceName="PasswordManagerWS")
@SOAPBinding(style=SOAPBinding.Style.DOCUMENT)
 public class PasswordManagerWSImpl implements PasswordManagerWS{
 @WebMethod public String getPassword(@WebParam(name="appId")String appId) { System.out.println("test ws"); return "test";
 }
 }

No comments:

Post a Comment

ec2-user@ec2 Permission denied