Java Web 服务 - WebSphere 应用服务器
Java WebService - WebSphere Application Server
我需要 运行 WebSphere Application Server (Liberty Profile) 上的 Web 服务,以便我可以获得 wsdl 并使用它在 SoapUI 上进行测试。
我在 Eclipse Luna 上使用 WebSphere Developer Tools。
我有这个webservice的代码,如下:
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";
}
}
现在,我应该如何运行 web 服务并获取 wsdl 文件?
丹尼尔,
尝试为 webmethod 注释提供 action 属性。
您可以在 Eclipse 中查看您的 Web 服务名称。然后展开您的 Web 项目 JAX-WS Web Services > Web Services
。您的服务可能称为 CommunicateImplService
,因此 wsdl 应该可以通过以下方式访问:http://host:port/context/serviceName?wsdl
在您的情况下可能是 CommunicateImplService?wsdl
。还要确保您的项目已添加到服务器。
在 WEBSPHERE.give 上下文路径名上创建一个 WAR file.DEPLOY 然后访问 url 中的网络服务
使用 http://ipadress:port/contextpath/webservice name?wsdl
我需要 运行 WebSphere Application Server (Liberty Profile) 上的 Web 服务,以便我可以获得 wsdl 并使用它在 SoapUI 上进行测试。 我在 Eclipse Luna 上使用 WebSphere Developer Tools。
我有这个webservice的代码,如下:
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";
}
}
现在,我应该如何运行 web 服务并获取 wsdl 文件?
丹尼尔,
尝试为 webmethod 注释提供 action 属性。
您可以在 Eclipse 中查看您的 Web 服务名称。然后展开您的 Web 项目 JAX-WS Web Services > Web Services
。您的服务可能称为 CommunicateImplService
,因此 wsdl 应该可以通过以下方式访问:http://host:port/context/serviceName?wsdl
在您的情况下可能是 CommunicateImplService?wsdl
。还要确保您的项目已添加到服务器。
在 WEBSPHERE.give 上下文路径名上创建一个 WAR file.DEPLOY 然后访问 url 中的网络服务 使用 http://ipadress:port/contextpath/webservice name?wsdl