content top
What is my remote IP? Creating Java web-service for JBoss Deploy Java webservice on JBoss SSH/SFTP client in VB.net with sources

Creating Java web-service for JBoss

As I was struggling to figure out why I had a hard time getting some existing web-services to run on JBoss, I made some very limited web-service just to bug-track and see what was actually going on. This is a -very- limited example on a web-service that can be deployed on a JBoss installation. But it has enough in it, for you to use as a framework and continue to build on. You’re only limited by your own thoughts.

ServiceRemote.java

/**
 * @author Kjell Arne Brudvik (kjell.arne@brudvik.org)
 * @since 27. aug.. 2009 14.22.17
 */
package org.brudvik.webservice.test;
 
import javax.jws.WebService;
 
/**
 * @author Kjell Arne Brudvik (kjell.arne@brudvik.org)
 * @since 27. aug.. 2009 14.22.17
 */
@WebService
public interface ServiceRemote {
 
    public String greet(String input);
 
}

ServiceEndpoint.java

/**
 * @author Kjell Arne Brudvik (kjell.arne@brudvik.org)
 * @since 27. aug.. 2009 13.50.42
 */
package org.brudvik.webservice.test;
 
import javax.ejb.Remote;
import javax.ejb.Stateless;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
 
/**
 * @author Kjell Arne Brudvik (kjell.arne@brudvik.org)
 * @since 27. aug.. 2009 13.50.42
 */
 
@WebService(serviceName = "BrudvikService", name = "ServiceEndpoint", targetNamespace = "http://ws.brudvik.org/BrudvikWs")
@SOAPBinding(style = SOAPBinding.Style.RPC)
@Remote(ServiceRemote.class)
@Stateless
public class ServiceEndpoint implements ServiceRemote {
 
    @WebMethod
    public String greet(@WebParam(name = "name")String name) {
        return "Hello " + name;
    }
 
}
Skrevet av Kjell Arne Brudvik den 27.08.2009 liker denne artikkelen.
content top