JavaWebService-WebSphereApplicationServer

JavaWebService-WebSphereApplicationServer,java,web-services,wsdl,websphere,Java,Web Services,Wsdl,Websphere,我需要在WebSphereApplicationServer(Liberty概要文件)上运行一个webservice,以便获得wsdl并使用它在SoapUI上进行测试。 我正在EclipseLuna上使用WebSphere开发人员工具 我有此Web服务的代码,如下所示: Communicate.java package xpto; import javax.jws.WebMethod; import javax.jws.WebService; @WebService public inter

我需要在WebSphereApplicationServer(Liberty概要文件)上运行一个webservice,以便获得wsdl并使用它在SoapUI上进行测试。 我正在EclipseLuna上使用WebSphere开发人员工具

我有此Web服务的代码,如下所示:

Communicate.java

package xpto;

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

@WebService
public interface Communicate {
        @WebMethod String initiate(String var);
}
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";
    }
}
CommunicateImpl.java

package xpto;

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

@WebService
public interface Communicate {
        @WebMethod String initiate(String var);
}
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文件呢?

Daniel

尝试为webmethod注释提供一个action属性


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

创建一个WAR文件。将其部署到WEBSPHERE上。给出上下文路径名,然后访问url中的Web服务
使用Http://ipAddress:port/contextpath/webservice name?wsdl

您是否尝试过类似@vincent的方法?是的,我尝试过。我发现:错误404:java.io.FileNotFoundException:SRVE0190E:File not found:/Communicate用CommunicateImpl代替Communicate怎么样?是的,也试过了。实际上,在前面的评论中,我们会这么说,但是忘记了。您是否运行wsgen来生成webservice工件。您的Websphere开发人员工具可能会提供运行它的选项。