【发布时间】:2012-09-10 00:14:00
【问题描述】:
开发了一个网络服务,步骤如下
1) 创建 Web 服务端点接口..
import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.Style;
//Service Endpoint Interface
@WebService
@SOAPBinding(style = Style.RPC)
public interface HelloWorld{
@WebMethod String getHelloWorldAsString(String name);
}
2。创建一个 Web 服务端点实现 ..
import javax.jws.WebService;
//Service Implementation
@WebService(endpointInterface = "com.abc.ws.HelloWorld")
public class HelloWorldImpl implements HelloWorld{
@Override
public String getHelloWorldAsString(String name) {
return "Hello World JAX-WS " + name;
}
}
- 创建端点发布者...
导入 javax.xml.ws.Endpoint; 导入 com.abc.ws.HelloWorldImpl;
//Endpoint publisher
public class HelloWorldPublisher{
public static void main(String[] args) {
Endpoint.publish("http://localhost:9999/ws/hello", new HelloWorldImpl());
}
}
现在,我还通过 URL“http://localhost:9999/ws/hello?wsdl”访问生成的 WSDL(Web 服务定义语言)文档来测试部署的 Web 服务。
但是我的疑问是,当我刚接触云世界时,我想将我的网络服务部署到像亚马逊这样的云上,这样如果我向世界上的任何人提供 wsdl,他就可以通过他的浏览器访问我的 wsdl 作为我的网络服务部署在云端。
请告诉我如何实现这一目标..!!
【问题讨论】:
-
我正在寻找这个...任何可以帮助我们吗?
标签: java web-services jax-ws amazon