正在加载图片...
MyEclipse6Java开发中文教程 直接内置简化对 Web service的支持,同时 JAX-WS20是 Java eE5平台中用于 Web服务的新APl,保留了自然的RPC编程模型,同时在以下几个方面进行了改进:数 据绑定、协议和传输的独立性、对Web服务的REST样式的支持以及易开发性。下面是 个JDK6中的Web服务端的示例 import javax ws Web/ethod, import javax jws Web Service, import javax ws soap. SOAPBinding, ∥定义Web服务类和方法 @websErvice(targetnAmespace=http:/jdk.studyhermitorg/client) @SoAPBinding(style= SOAPBinding Style RPC) public class Hello f WebMethod public String sayHello(String name)i return " hello: + name ∥启动Web服务 import javax.xm/ ws Endpoint, public cla public static void main(StringI args)v 当前有很多主流IDE对Web服务的开发提供了完美的支持,例如商业软件 JBuilder中 有Web服务的可视化设计器和生成器,开源免费的 Netbeans6中也提供了同样的功能, 而 Eclipse则稍微弱一点,不过在 MyEclipse6中则提供了基于XFre的Web服务的开发支 持。 Spring框架则提供了这些支持:使用 JAX-RPC暴露服务;访问Web服务。一般的开 发过程是 1.开发普通的功能类 2.将其包装成Web服务,发布于服务器并生成WsDL描述 3.调用者根据WSDL生成客户端代码。 1512 XFire Java SOAP框架一览 XFie的官方网站地址是http:/xfire.codehaus.orgl,根据其网站的说 XFire is now CXF User's looking to use XFire on a new project, should use CXF instead. CXF is a continuation of the X Fire project and is considered XFire 2.0. It has many new features,a ton of bug fixes, and is now JAX-Ws compliant! XFire will continue to be maintained 刘长炯著MyEclipse 6 Java 开发中文教程 4 刘长炯著 直接内置/简化对 Web Service 的支持,同时 JAX-WS 2.0 是 Java EE 5 平台中用于 Web 服务的新 API,保留了自然的 RPC 编程模型,同时在以下几个方面进行了改进:数 据绑定、协议和传输的独立性、对 Web 服务的 REST 样式的支持以及易开发性。下面是 一个 JDK 6 中的 Web 服务端的示例: import javax.jws.WebMethod; import javax.jws.WebService; import javax.jws.soap.SOAPBinding; //定义 Web 服务类和方法 @WebService(targetNamespace = "http://jdk.study.hermit.org/client") @SOAPBinding(style = SOAPBinding.Style.RPC) public class Hello { @WebMethod public String sayHello(String name) { return "hello:" + name; } } // 启动 Web 服务 import javax.xml.ws.Endpoint; public class StartService { public static void main(String[] args) { Endpoint.publish("http://localhost:8080/HelloService", new Hello()); } } 。 当前有很多主流 IDE 对 Web 服务的开发提供了完美的支持,例如商业软件 JBuilder 中 有 Web 服务的可视化设计器和生成器,开源免费的 Netbeans 6 中也提供了同样的功能, 而 Eclipse 则稍微弱一点,不过在 MyEclipse 6 中则提供了基于 XFire 的 Web 服务的开发支 持。Spring 框架则提供了这些支持:使用 JAX-RPC 暴露服务;访问 Web 服务。一般的开 发过程是: 1. 开发普通的功能类; 2. 将其包装成 Web 服务,发布于服务器并生成 WSDL 描述; 3. 调用者根据 WSDL 生成客户端代码。 15.1.2 XFire Java SOAP 框架一览 XFire的官方网站地址是 http://xfire.codehaus.org/ ,根据其网站的说法:“ XFire is now CXF User's looking to use XFire on a new project, should use CXF instead. CXF is a continuation of the XFire project and is considered XFire 2.0. It has many new features, a ton of bug fixes, and is now JAX-WS compliant! XFire will continue to be maintained
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有