简体   繁体   中英

Java WebService - WebSphere Application Server

I need to run a webservice on a WebSphere Application Server (Liberty Profile) so I can get the wsdl and use it to make tests on SoapUI. I'm using WebSphere Developer Tools on Eclipse Luna.

I have the code for this webservice, as follows:

Communicate.java

package xpto;

import javax.jws.WebMethod;
import javax.jws.WebService;

@WebService
public interface Communicate {
        @WebMethod String initiate(String var);
}

CommunicateImpl.java

package xpto;

import javax.jws.WebService;

@WebService(endpointInterface = "xpto.Communicate")
public class CommunicateImpl implements Communicate {
    @Override
    public String initiate(String var){
        System.out.println("Communicating");
        return "S";
    }
}

Now, what should I do to run the webservice and get the wsdl file?

You can check your web service name in the Eclipse. Expand your web project then JAX-WS Web Services > Web Services . Your service is probably called CommunicateImplService , so wsdl should be accessible by: http://host:port/context/serviceName?wsdl in your case probably CommunicateImplService?wsdl . Also make sure that your project is added to the server.

创建一个WAR文件。在WEBSPHERE上将其部署。给定上下文路径名,然后使用Http:// ipadress:port / contextpath / webservice name?wsdl访问URL中的Webservice

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM