Web Service概念和术语

来源:互联网 发布:华为云计算岗位 编辑:程序博客网 时间:2024/05/16 09:33

Web Service概念和术语

一. Web Service基本的概念

XML (eXtensible Markup Language)

       XML is used to organize documents and business data. XMLfiles can be stored or transmitted between two applications on anetwork. Basically, they are just plain text documents that containspecial tags that label different parts of a document or fields of data.

       XML是一种由规范定义的元语言。XML标记语言定义了一套用来组织和描述文本的标记(tag)。标记通常成对出现,其中一个标记是开始标记,另一个标记是结束标记。位于这两个标记之间的所有内容均成为元素。

SOAP (Simple Object Access Protocol)

       SOAP defines a standard packaging format for transmitting XMLdata between applications on a network. A SOAP message is just an XMLdocument. SOAP is specially designed, however, to contain and transmitother XML documents as well as information related to routing,processing, security, transactions, and other qualities of service.

       SOAP消息是一种XML文档,它有其自己的XML模式、命名空间和处理规则。目前的版本是SOAP 1.2。

WSDL (Web Services Description Language)

       WSDL is a standard for describing the structure of the XML data exchanged between two systems using SOAP.

       WSDL是一个用于精确描述Web服务的文档格式,它用来指定客户与具体的Web服务通信时必须使用的确切的消息格式、Internet协议以及地址。目前的版本是WSDL 2.0

UDDI (Universal Description, Discovery, and Integration)

       UDDI defines a standard set of Web service operations(methods) that are used to store and look up information about otherWeb service applications. In other words, UDDI defines a standardSOAP-based interface for a Web services registry. You can use a UDDIregistry to find a particular type of Web service, or to find out aboutthe Web services hosted by a specific organization. A UDDI registry isoften referred to as a "Yellow Pages" for Web services. The UDDIspecification is now maintained by the Organization for the Advancement of Structured Information Standards (OASIS)

       UDDI定义了一套标准的Web服务操作方法,用于存储、查找有关其他Web服务应用程序方面的信息。

WS-I BP (Web Services Interoperability Basic Profile)

Web Services Interoperability Organization is an organization of Webservices vendors that are committed to defining a standard for Webservices interoperability. The first deliverable of the WS-I was theBasic Profile 1.0, 第二个是WS-I Basic Profile 2.0

 

   

二. Web Service Advanced概念 

WS-Addressing

     WS-Addressing specification is to provide the means to identify a Web service endpoint and a way to use such identifiers in SOAP messages for the delivery and exchange of messages between Web service providers and Web service requesters.

     WS-Addressing通过对SOAP消息的扩展,为WebServices的寻址问题提供更强大的支持。WS-Addressing规范主要描述了两个概念:EndpointReference以及Message Addressing Properties。在WebServices中代表一类逻辑功能的服务实现可能存在不同的Endpoint,每一个Endpoint可能代表了一种不同的绑定方式,甚至对外表现出不同的接口,比如Endpoint A可能使用TCP协议通讯,而EndpointB则可能使用Http协议。通过EndpointReferrence我们就可以引用到相应的Endpoint上,从而访问该服务。             Message Addressing Properties作为SOAP Head的扩展将包含在每一个SOAP消息中,用于该消息的寻址。 

WS-Policy

      WS-Policy defines a general-purpose framework for representingand combining statements about the quality of service properties.WS-Policy is an extensible framework that can accommodatedomain-specific dialects to represent these assertions and allow theattachment of policies to arbitrary types of subjects though thegeneric attachment mechanisms that WS-Policy Attachments define.

       Web服务策略框架规范(Web Services Policy Framework,WS-Policy)提供了一种灵活、可扩展的语法,用于表示基于XML Webservices的系统中实体的能力、要求和一般特性。WS-Policy定义了一个框架和一个模型,将这些特性表示为策略。策略表示法既支持简单的声明式断言,也支持比较复杂的条件式断言。策略断言是要表示行为的个体要求、能力或其他特性。例如,可以创建一个策略断言,定义这样一个要求:必须使用受信任的X.509证书签名SOAP消息主体。WS-Policy 提供了一个通用模型和语法,用于描述 Web服务的策略及就此进行沟通。WS-Policy 断言说明特定 Web 服务的功能和约束。WS-PolicyAttachments 定义了用于将WS-Policy 表达式与 Web 服务(即 WSDL)关联的若干方法。 

WS-Reliable Messaging

      WS-Reliable Messaging promises to bring the benefits ofreliable messaging to SOA and Web services, enabling enterprises toextend Web services to support reliable business-to-business (B2B)exchanges. 

WS-Coordination (WS-AT and WS-BA)

      WS Atomic Transactions Applicationoperations on Web services occur completely or not at all, and resultsare not available until the transaction is complete.

      WS Business Activity Applicationoperations on Web services exhibit a loose unit of work, in whichresults are shared prior to completion of the overall activity. Eachparticipant undoes the operations it has performed within theconversation.

      WS-Coordination specification provides the generic foundationfor coordinating outcome agreements between interoperating Webservices. WS-Atomic Transaction and WS-Business Activity specificationscontain definitions of atomic and business transaction protocols,respectively, that you can use with WS-Coordination. WS-Coordination isdefined as an extensible framework that can support additionalprotocols for other coordination patterns as required.

      WS-AT and WS-BA用来定义规范WS的事务。 

WS-Security

     WS-Security SOAP Message Security is optimized forexchanging a small number of messages. A requester might engage in aprolonged "conversation" with a Web service. WS-SecureConversation buildson WS-Trust and message security to provide support for multimessage,long-lived conversations. WS-SecureConversation provides a better levelof security and improved efficiency. This chapter also provides anoverview of WS-Secure Conversation. 

WS-Trust

     WS-Security supports security tokens. Collaborationbetween enterprises often requires sharing additional information, suchas customer identity information and preferences. WS-Federation extends WS-Trust to provide these functions, and is discussed later in this chapter. 

WS-Authorization/ WS-Privacy

     WS-Authorization and WS-Privacy are in progress.

WS-BPEL

     Web services Business Process Execution Language is anextensible workflow-based language that aggregates services bychoreographing service interactions. The aggregation is recursive, suchthat the process exposes WSDL interfaces to those that interact withit, and the corresponding services may be used in other choreographies.

    BPEL用来描述和规范WS的业务流程.

 

三. J2EE Web Service APIs基本概念

       用来在J2EE平台实现Web Service。包括JAX-RPC, SAAJ, JAXR, and JAXP

JAX-RPC (Java API for XML-based RPC)

      You can think of JAX-RPC as Java RMI over SOAP. JAX-RPC isdivided into two parts: a set of client-side APIs, and a set ofserver-side components, called endpoints.

      The client-side APIs allow you to communicate with Web serviceendpoints hosted on some other platform. There are three client-sideAPIs: generated stub, dynamic proxy, and DII (Dynamic Invocation Interface).The generated stub is the one you will use the most, and its semanticsclosely resemble those of Java RMI. The dynamic proxy API also followsmany of the Java RMI semantics, but is used less often. The DII is avery low-level API used primarily by vendor tools, but can also beemployed by Web services developers if necessary.

      The server-side components include the JAX-RPC service endpoint (JSE) and the EJB endpoint.The JSE component is actually a type of servlet that has been adaptedfor use as a Web services component. The EJB endpoint is simply a typeof stateless session EJB that has been adapted for use as a Web serviceendpoint. The EJB endpoint provides all the transactional and securityfeatures of a normal stateless session bean, but it's specificallydesigned to process SOAP requests. 

SAAJ (SOAP with Attachments API for Java)

      SAAJ is a low-level SOAP API that complies with SOAP 1.1 andthe SOAP Messages with Attachments specification. SAAJ allows you tobuild SOAP messages from scratch as well as read and manipulate SOAPmessages. You can use it alone to create, transmit, and process SOAPmessages, but you're more likely to use it in conjunction with JAX-RPC.In JAX-RPC, SAAJ is used primarily to process SOAP header blocks (theSOAP message meta-data). 

JAXR (Java API for XML Registries)

      JAXR provides an API for accessing UDDI registries. Itsimplifies the process of publishing and searching for Web serviceendpoints. 

JAXP (Java API for XML Processing)

      JAXP provides a framework for using DOM 2 and SAX2, standard Java APIs that read, write, and modify XML documents.

     DOM 2 (Document Object Model, Level 2) is a Java APIthat models XML documents as trees of objects. It contains objects thatrepresent elements, attributes, values, and so on. DOM 2 is used a lotin situations where speed and memory are not factors, but complexmanipulation of XML documents is required. DOM 2 is also the basis ofSAAJ 1.1.

      DOM 2在处理XML文档的时候会将所有infoset在内存中创建相应的对象,所以比较消耗内存。

     SAX2 (Simple API for XML, version 2) is very differentin functionality from DOM 2. When a SAX parser reads an XML document,it fires events as it encounters start and end tags, attributes,values, etc. You can register listeners for these events, and they willbe notified as the SAX2 parser detects changes in the XML document itis reading.

      SAX2是基于push方式,StAX是pull的方式。

Streaming API for XML (StAX)

      StAX is a streaming Java-based, event-driven,pull-parsing API for reading and writing XML documents. StAX providesis the latest API in the JAXP family, and provides an alternative toSAX, DOM, TrAX, and DOM for developers looking to do high-performancestream filtering, processing, and modification, particularly with lowmemory and limited extensibility requirements.

      StAX is a bidirectional API, meaning that it can both read andwrite XML documents. SAX is read only, so another API is needed if youwant to write XML documents. 

JAX-WS2.0

    JAX-WS2.0即Java API for XML Web Services (JAX-WS) 2.0,JAX-RPC1.1即Java API for XML-Based RPC (JAX-RPC) 1.1。它们都是Sun公司的使用 Java 技术开发 Web服务的规范,前者是后者的升级版本。

JAX-WS2.0的binding层用JAXB(JSR 222),xml解析层用StAX(JSR 173),完全基于标准,性能得到大幅提升;支持Java 5的注释(annotation),容易开发。 

Java™Architecture for XML Binding (JAXB)

     JAXB provides a fast and convenient way to bind between XML schemas and Java representations,making it easy for Java developers to incorporate XML data andprocessing functions in Java applications. JAXB provides methods forunmarshalling XML instance documents into Java content trees, and thenmarshalling Java content trees back into XML instance documents.

原创粉丝点击