Java WebService - WebSphere 应用程序服务器

标签 java web-services wsdl websphere

我需要在 WebSphere Application Server (Liberty Profile) 上运行 Web 服务,以便获取 wsdl 并使用它在 SoapUI 上进行测试。 我正在 Eclipse Luna 上使用 WebSphere Developer Tools。

我有这个网络服务的代码,如下:

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 文件?

最佳答案

您可以在 Eclipse 中检查您的 Web 服务名称。展开您的 Web 项目,然后展开 JAX-WS Web Services > Web Services。您的服务可能称为 CommunicateImplService,因此 wsdl 应该可以通过以下方式访问: http://host:port/context/serviceName?wsdl 在您的情况下可能是 CommunicateImplService? wsdl。另请确保您的项目已添加到服务器。

关于Java WebService - WebSphere 应用程序服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28153099/

相关文章:

java - ANT 构建在 WSDL 生成的文件中抛出错误

java - 同一 Activity 中的两个 DatePicker - Android

java - 在被调用者 docker 容器之外实例化 docker 容器

c# - 将内存中的pdf转换为字节[]

java - 为什么我的网址 localhost :8080////ProjectCtxt/mvc/template works?

c# - 仅从 Dapper connection.Query<T>(sql) 返回某些列/字段

vb.net - 我导入了 WSDL,现在怎么办?

java - MethodInvokingFactoryBean-方法未被调用

java - 使用 For 循环初始化 JTextFields 和 JLabels 并将其添加到 JPanel 使用数组会导致错误

java - WSDL 缺少数据类型定义