`
hillmover
  • 浏览: 34014 次
  • 性别: Icon_minigender_2
  • 来自: 上海
社区版块
存档分类
最新评论

web services

    博客分类:
  • Java
阅读更多

Java API for XML Web Services (JAX-WS)

Java API for RESTful Web Services (JAX-RS)

 

JAX-WS supports the Web Services Interoperability (WS-I) Basic Profile Version 1.1. The WS-I Basic Profile is a document that clarifies the SOAP 1.1 and WSDL 1.1 specifications to promote SOAP interoperability.

 

Creating a SimpleWeb Service and Clients with JAX-WS

The basic steps for creating a web service and client are as follows:

  1. Code the implementation class.
  2. Compile the implementation class.
  3. Package the files into aWARfile.
  4. Deploy theWARfile. The web service artifacts (wsdl, xsd), which are used to communicate with clients, are generated by the Application Server during deployment.
  5. Code the client class.
  6. Use a wsimport Ant task to generate and compile the web service artifacts (wsdl, xsd) needed to connect to the service. (Results of wsimport are auto-gen java classes)
  7. Compile the client class.
  8. Run the client.

Requirements of a JAX-WS Endpoint

  1. The implementing class must be annotated with either the javax.jws.WebService or the
    javax.jws.WebServiceProvider annotation.
  2. The implementing class may explicitly reference an SEI through the endpointInterface
    element of the @WebService annotation but is not required to do so. If no endpointInterface is specified in @WebService, an SEI is implicitly defined for the implementing class.
  3. The business methods of the implementing class must be public and must not be declared
    static or final.
  4. Business methods that are exposed to web service clients must be annotated with
    javax.jws.WebMethod.
  5. Business methods that are exposed to web service clients must have JAXB-compatible
    parameters and return types
    . See the list of JAXB default data type bindings at
    http://download.oracle.com/javaee/5/tutorial/doc/bnazq.html#bnazs.
  6. The implementing class must not be declared final and must not be abstract.
  7. The implementing class must have a default public constructor.
  8. The implementing class must not define the finalize method.
  9. The implementing class may use the javax.annotation.PostConstruct or the
    javax.annotation.PreDestroy annotations on its methods for lifecycle event callbacks. The @PostConstruct method is called by the container before the implementing class begins responding to web service clients. The @PreDestroy method is called by the container before the endpoint is removed from operation.
分享到:
评论

相关推荐

    Web Services 教程Web Services 教程

    Web Services 是一种技术,它允许不同的应用程序通过互联网相互通信,从而实现数据交换和服务共享。在继续深入理解Web Services之前,需要对HTML和XML有一定的基础知识。HTML是超文本标记语言,用于创建网页结构,而...

    Web Services平台架构

    Web Services平台架构是构建分布式应用程序的一种重要方法,它允许不同系统和平台之间的应用程序通过网络进行交互。在Java平台上开发Web Services,我们可以利用一系列的技术和标准,以实现跨平台的互操作性。 首先...

    java webservices.jar

    在java开发services中,会用到: 1.webservices-api.jar 2.webservices-extra.jar 3.webservices-rt.jar 4.webservices-tools.jar 5.webservices-extra-api.jar 此压缩文件里就是这五个jar文件。

    webServices 天气预报

    WebServices是一种基于互联网的、用于应用程序之间交互的技术。在本项目"WebServices 天气预报"中,开发者提供了一个简单的天气预报应用,旨在帮助初学者理解WebServices的工作原理及其在C# WinForm环境中的实现。这...

    WEB SERVICES原理与研发实践

    WEB SERVICES原理与研发实践

    Web Services 技术架构

    Web Services技术架构是一种基于互联网的、开放的、标准的接口技术,它允许不同的应用程序之间进行交互和数据交换。这一概念由微软的MCT(Microsoft Certified Trainer)和MVP(Microsoft Most Valuable ...

    Exchange Web Services 2.2

    Exchange Web Services 2.2

    webservices-jar包

    例如,你可以使用`webservices-api`和`webservices-extra-api`来定义服务接口和数据模型,`webservices-rt`来处理服务的运行时逻辑,而`webservices-tools`则帮助你在开发过程中进行验证和调试。 总的来说,"web...

    传智播客WebServices全部ppt

    【Web Services概述】 Web Services是一种计算分布式问题的技术,它允许不同系统间的应用程序通过网络进行通信,从而实现数据的共享和程序的互操作性。Web Services的核心目标是促进系统的整合、标准化,并提供一种...

    web services学习基础

    ### Web Services 学习基础 #### 一、Web Services 概述 Web Services 是一种用于在不同平台上交换数据和服务的标准方式。它允许不同系统之间进行通信,并且可以在各种不同的编程语言和技术栈中运行。Web Services...

    c#通过https方式WebServices例子

    首先,我们需要理解“Java端写的https webservices”。在Java中,可以使用JAX-WS或JAX-RS等标准来创建Web Services。这些服务可以通过HTTPS协议对外提供,从而允许远程客户端通过安全连接进行调用。在Java端,设置...

    webServices 用法 。net

    Web Services是一种基于网络的、平台无关的交互方式,它允许不同系统之间交换数据和服务。在.NET框架下,创建和使用Web Services相对简单,这得益于微软提供的强大支持。本篇文章将深入探讨.NET环境下Web Services的...

    基于Web Services的旅游系统设计与实现.doc

    ### 基于Web Services的旅游系统设计与实现 #### 概述 本文探讨了基于Web Services技术构建的旅游系统的设计与实现方案。随着信息技术的进步和互联网的普及,特别是Web Services技术的成熟,旅游行业的信息化水平...

    MyEclipse+XFire开发Web Services

    ### MyEclipse+XFire开发Web Services #### 实验背景与目标 随着互联网技术的发展,Web Services作为一种重要的软件架构模式,在分布式系统中的应用越来越广泛。它允许不同平台、语言的应用程序通过标准协议(如...

    Web Services技术、架构和应用

    本书的内容涵盖了Web Services的各种关键技术、Web Services的整体体系架构和应用体系架构,以及Web Services应用的设计和开发。本书以Web Services技术系列为主线,逐一详细分析解释包括Web Services的各种核心技术...

    webservices相关jar包.rar

    1. `webservices-api.jar`: 这个jar包包含了JAX-WS(Java API for XML Web Services)的核心API,它是Java平台上的标准Web服务规范。JAX-WS提供了创建、部署和消费Web服务的全面支持。它定义了诸如`javax.xml.ws`...

    Web Services资料大全

    而“Web Services资料”这个文件可能包含了关于Web服务的广泛知识,包括基本概念、设计模式、最佳实践以及相关的技术文档和教程。 总的来说,Web服务是一种强大的工具,它促进了系统的互操作性和可重用性。通过掌握...

    RESTful Web Services中文高清版.pdf.zip

    RESTful Web Services是一种广泛应用于现代Web开发中的设计模式,它基于Representational State Transfer(表述性状态转移)原则,旨在创建高效、分布式的网络应用程序。本资料《RESTful Web Services中文高清版.pdf...

Global site tag (gtag.js) - Google Analytics