[英]WebSphere Application Server 6.1 support for Java 1.6?
[英]Java WebService - WebSphere Application Server
我需要在WebSphere Application Server(Liberty Profile)上运行Web服务,以便获得wsdl并将其用于在SoapUI上进行测试。 我正在Eclipse Luna上使用WebSphere Developer Tools。
我有此Web服务的代码,如下所示:
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
。 还要确保将项目添加到服务器。
创建一个WAR文件。在WEBSPHERE上将其部署。给定上下文路径名,然后使用Http:// ipadress:port / contextpath / webservice name?wsdl访问URL中的Webservice
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.