- 浏览: 101994 次
- 性别:
- 来自: 上海
最新评论
-
u010753172:
fruwei 写道调用闭包的方法等于创建一个闭包实例。对于相同 ...
Groovy基础——Closure(闭包)详解 -
fruwei:
调用闭包的方法等于创建一个闭包实例。对于相同闭包创建出来的不同 ...
Groovy基础——Closure(闭包)详解 -
aplixy:
讲的很详细,谢谢分享
Groovy基础——Closure(闭包)详解 -
truth99:
很详细,谢了
Groovy基础——MetaClass详解 -
wjhdtx:
...
Groovy基础——MetaClass详解
Web services have been around a while now. First there was SOAP. But SOAP only described what the messages looked like. Then there was WSDL. But WSDL didn't tell you how to write web services in Java™. Then along came JAX-RPC 1.0. After a few months of use, the Java Community Process (JCP) folks who wrote that specification realized that it needed a few tweaks, so out came JAX-RPC 1.1. After a year or so of using that specification, the JCP folks wanted to build a better version: JAX-RPC 2.0. A primary goal was to align with industry direction, but the industry was not merely doing RPC web services, they were also doing message-oriented web services. So "RPC" was removed from the name and replaced with "WS" (which stands for web Services, of course). Thus the successor to JAX-RPC 1.1 is JAX-WS 2.0 - the Java API for XML-based web services.
Before we itemize the differences between JAX-RPC 1.1 and JAX-WS 2.0, we should first discuss what is the same.
- JAX-WS still supports SOAP 1.1 over HTTP 1.1, so interoperability will not be affected. The same messages can still flow across the wire.
- JAX-WS still supports WSDL 1.1, so what you've learned about that specification is still useful. A WSDL 2.0 specification is nearing completion, but it was still in the works at the time that JAX-WS 2.0 was finalized.
- SOAP 1.2
JAX-RPC and JAX-WS support SOAP 1.1. JAX-WS also supports SOAP 1.2.
- XML/HTTP
The WSDL 1.1 specification defined an HTTP binding, which is a means by which you can send XML messages over HTTP without SOAP. JAX-RPC ignored the HTTP binding. JAX-WS adds support for it.
- WS-I's Basic Profiles
JAX-RPC supports WS-I's Basic Profile (BP) version 1.0. JAX-WS supports BP 1.1. (WS-I is the web services interoperability organization.)
- New Java features
- JAX-RPC maps to Java 1.4. JAX-WS maps to Java 5.0. JAX-WS relies on many of the features new in Java 5.0.
- Java EE 5, the successor to J2EE 1.4, adds support for JAX-WS, but it also retains support for JAX-RPC, which could be confusing to today's web services novices.
- The data mapping model
- JAX-RPC has its own data mapping model, which covers about 90 percent of all schema types. Those that it does not cover are mapped to
javax.xml.soap.SOAPElement
. - JAX-WS's data mapping model is JAXB. JAXB promises mappings for all XML schemas.
- JAX-RPC has its own data mapping model, which covers about 90 percent of all schema types. Those that it does not cover are mapped to
- The interface mapping model
JAX-WS's basic interface mapping model is not extensively different from JAX-RPC's; however:
- JAX-WS's model makes use of new Java 5.0 features.
- JAX-WS's model introduces asynchronous functionality.
- The dynamic programming model
- JAX-WS's dynamic client model is quite different from JAX-RPC's. Many of the changes acknowledge industry needs:
- It introduces message-oriented functionality.
- It introduces dynamic asynchronous functionality.
- JAX-WS also adds a dynamic server model, which JAX-RPC does not have.
- JAX-WS's dynamic client model is quite different from JAX-RPC's. Many of the changes acknowledge industry needs:
- MTOM (Message Transmission Optimization Mechanism)
JAX-WS, via JAXB, adds support for MTOM, the new attachment specification. Microsoft never bought into the SOAP with Attachments specification; but it appears that everyone supports MTOM, so attachment interoperability should become a reality.
- The handler model
- The handler model has changed quite a bit from JAX-RPC to JAX-WS.
- JAX-RPC handlers rely on SAAJ 1.2. JAX-WS handlers rely on the new SAAJ 1.3 specification.
In the remainder of this tip, we will discuss SOAP 1.2, XML/HTTP, the WS-I Basic Profiles, and Java 5. Each of the remaining five bullets above will be a separate tip in this series.
SOAP encoding
There is really not a lot of difference, from a programming model point of view, between SOAP 1.1 and SOAP 1.2. As a Java programmer, the only place you will encounter these differences is when using the handlers, which we will cover in a future tip. SAAJ 1.3 has been updated to support SOAP 1.2.
Like the changes for SOAP 1.2, there is really not a lot of difference, from a programming model point of view, between SOAP/HTTP and XML/HTTP messages. As a Java programmer, the only place you will encounter these differences is when using the handlers, which we will cover in a future tip. The HTTP binding has its own handler chain and its own set of message context properties.
JAX-RPC 1.1 supports WS-I's Basic Profile (BP) 1.0. Since that time, the WS-I folks have developed BP 1.1 (and the associated AP 1.0 and SSBP 1.0). These new profiles clarify some minor points, and more clearly define attachments. JAX-WS 2.0 supports these newer profiles. For the most part, the differences between them do not affect the Java programming model. The exception is attachments. WS-I not only cleared up some questions about attachments, but they also defined their own XML attachment type: wsi:swaRef.
Many people are confused by all these profiles. You will need a little history to clear up the confusion.
WS-I's first basic profile (BP 1.0) did a good job of clarifying the various specs. But it wasn't perfect. And support for SOAP with Attachments (Sw/A) in particular was still rather fuzzy. In their second iteration, the WS-I folks pulled attachments out of the basic profile - BP 1.1 - and fixed some of the things they missed the first time around. At that point they also added two mutually exclusive supplements to the basic profile: AP 1.0 and SSBP 1.0. AP 1.0 is the Attachment Profile which describes how to use Sw/A. SSBP 1.0 is the Simple SOAP Binding Profile, which describes a web services engine that does not support Sw/A (such as Microsoft's .NET). The remaining profiles that WS-I has and is working on build on top of those basic profiles.
There are a number of changes to the Java language. JAX-WS relies on: annotations, generics, and executors. We will detail exactly how JAX-WS relies on this new functionality in follow-on tips. For information on these new features of Java, see the Java 5 link in Resources.
JAX-WS 2.0 is the successor to JAX-RPC 1.1. There are some things that haven't changed, but most of the programming model is different to a greater or lesser degree. The topics introduced in this tip will be expanded upon in a series of tips which we will publish over the coming months that will compare, in detail, JAX-WS and JAX-RPC. At a high level though, here are a few reasons why you would or would not want to move to JAX-WS from JAX-RPC.
Reasons you may want to stay with JAX-RPC 1.1:
- If you want to stay with something that's been around a while, JAX-RPC will continue to be supported for some time to come.
- If you don't want to step up to Java 5.
- If you want to send SOAP encoded messages or create RPC/encoded style WSDL.
Reasons to step up to JAX-WS 2.0:
- If you want to use the new message-oriented APIs.
- If you want to use MTOM to send attachment data.
- If you want better support for XML schema through JAXB.
- If you want to use an asynchronous programming model in your web service clients.
- If you need to have clients or services that can handle SOAP 1.2 messages.
- If you want to eliminate the need for SOAP in your web services and just use the XML/HTTP binding.
- If you like playing with leading edge technology.
http://hi.baidu.com/wenter126/blog/item/c5d3a754b1772d183a293599.html
发表评论
-
技术扫盲——JDWP
2011-11-09 23:31 4847JDWP 协议介绍: 协议分析 Packet 的结构 ... -
Java应用——Ant Task的自定义实现
2011-11-09 23:25 1037Ant在项目的构建中经常用到,对于我们常用的ant内置的ta ... -
Java基础——序列化(Serializable接口,transient关键字)
2011-11-04 12:37 11922这篇博文主要介绍下Java序列化相关的内容以及如何去理解tr ... -
Java基础——枚举类型(enum)
2011-11-03 23:01 1452这篇文章主要介绍一下 ... -
日志系统解惑
2011-10-20 15:43 10501、 简介 SLF4J不是具体的日志解决方案,它只服 ... -
如何开发jax-ws
2011-10-18 17:36 950http://www.ibm.com/developerwor ... -
java 注解入门
2011-10-12 14:14 4294摘要: 本 文针对java初 ... -
java 注解
2011-10-12 13:44 863注解(Annotation) 为我 ... -
effective java 学习笔记
2011-08-09 10:03 1050最近看了下《effective jav ... -
javassist和asm比较
2011-08-09 10:00 8982Javassist: • Javassist (Java P ... -
Apache开源项目之1[BeanUtils使用]
2011-08-09 09:59 1429最近在研究struts框架的同时,顺便看了看beanutils ... -
ClassLoader.loadClass()与Class.forName()的区别
2011-08-09 09:58 1268一直以来对这个问题比较迷惑,今天找了些资料整理的下,基本搞清楚 ... -
Preparedstatement和Statement的区别
2011-08-09 09:57 10421.PreparedStatement是预编译 ... -
不使用构造方法创建对象 Objenesis
2011-08-09 09:53 1623如果一个类没有参数为空的构造方法时候,那么你直接调用newIn ... -
Java中的getResourceAsStream
2011-08-09 09:35 1237首先,Java中的getResourceAsStream有以下 ...
相关推荐
IDEA 使用 Maven 创建 Web 项目详细教程 本教程将指导您使用 IDEA 创建一个 Maven Web 项目,从安装 Maven 到配置 Maven 环境、创建 Maven 工程、pom.xml 文件配置、依赖管理等。 1. 安装 Maven 在 IDEA 中使用 ...
【IDEA创建Web项目详细过程】 IDEA,全称IntelliJ IDEA,是一款广受欢迎的Java集成开发环境,尤其在Web应用开发中有着强大的支持。本文将详细介绍如何使用IDEA创建一个Web项目,并配置Tomcat服务器。 1. **创建Web...
### Axis开发Web Service实例详解 #### 一、概述 在探讨如何使用Apache Axis来开发Web Service之前,我们首先需要了解一些基本概念。 **Web Service**是一种标准的技术框架,用于实现不同平台之间的应用通信。它...
### NetBeans 开发 Web Service 知识点详解 #### 一、基础知识介绍 **Web Service** 是一种跨编程语言和操作系统平台的网络应用程序调用机制。它通过HTTP协议来发送和接收XML格式的信息,实现不同应用程序之间的...
在本文中,我们将探讨如何在Pocket PC设备上利用Web Service技术连接到数据库,这是一种在Windows Mobile 2003平台上实现跨数据库访问的有效方法。在移动应用系统中,特别是掌上应用系统,需要灵活地访问不同类型的...
- `src/main/java`: 存放源代码,包括Spring配置、业务逻辑、DAO层、Web Service接口和实现。 - `src/main/resources`: 配置文件,如Spring的bean配置、Hibernate的映射文件。 - `pom.xml`: Maven的项目配置文件...
在使用IntelliJ IDEA开发Java程序时,常常需要为main方法传递参数,以便测试不同的运行场景。在本文中,我们将详细讨论如何在IDEA中给main方法附带参数,并将其整理成PDF文档,方便保存和查阅。 首先,了解main方法...
【标题】"用idea创建的maven web项目"是一个基于IntelliJ IDEA(简称idea)开发工具构建的Maven Web应用程序。Maven是Java领域的一个项目管理和构建工具,它通过提供一套规范化的项目结构和自动化的构建流程,帮助...
### 使用Idea14.1.4和Maven创建Java Web项目 #### 一、概述 在本篇文章中,我们将详细介绍如何使用IntelliJ IDEA 14.1.4版本结合Maven来创建一个Java Web项目。这种方法不仅能够提高开发效率,还能确保项目的结构...
在IT行业中,开发Java Web应用时,IntelliJ IDEA(简称Idea)是一款非常流行的集成开发环境,而Maven则是管理项目构建、依赖关系和生命周期的工具。本资源"idea创建maven web项目标准结构源码"提供了一个基础的模板...
在IT领域,尤其是在软件开发与集成的过程中,Java作为一种广泛应用的编程语言,其调用Web Service的能力是连接不同系统和服务的关键技术之一。以下是对“JAVA程序调用Web Service示例过程演示”这一主题的深入解析,...
【标题】基于Axis的Web Service客户端调用 在IT领域,Web Service是一种通过网络进行通信的标准协议,它允许不同系统间的应用程序互相交换数据。而Apache Axis是Java平台上的一个开源工具,专门用于创建和部署Web ...
在IT行业中,Web Service是一种基于网络的、松散耦合的软件组件,它允许不同的应用程序之间进行数据交换和功能调用。本示例是关于如何使用C#和.NET Framework 2.0动态调用Web Service的实践应用。下面将详细阐述相关...
"IDEA WEB项目启动不加载application.properties配置文件" 在本篇文章中,我们将讨论IDEA WEB项目启动不加载application.properties配置文件的问题。这个问题可能是由于项目中使用的SpringBoot版本不一致引起的。...
ASP Web Service是微软.NET框架下的一种技术,用于构建可以跨平台、跨网络的Web服务。在本教程中,我们将深入探讨如何创建和调用ASP Web Service,通过提供的"视频--asp Web Service 创建调用.rar"资源,你可以跟随...
本文将深入探讨“text-generation-webui-main”项目,这是一个集成了多种模型后端的文本生成Web用户界面,它包括transformers、llama.cpp、ExLlama、AutoGPTQ、GPTQ-for-LaMa以及ctransformers等核心组件,旨在为...
一个标准的Java Web项目通常包含以下几个关键部分:`WEB-INF`目录、`src/main/java`源代码目录、`src/main/resources`资源文件目录以及`webapp`目录,后者包含HTML、CSS、JavaScript等静态文件以及`WEB-INF/web.xml`...
4. **配置Web.xml**:在`src/main/webapp/WEB-INF`目录下,IDEA会自动生成`web.xml`文件,这是Web应用的部署描述符,用来配置Servlet、过滤器、监听器等。 5. **Maven或Gradle集成**:IDEA支持通过Maven或Gradle...
### Axis 开发 Web Service 程序详解 #### 一、Web Service 概念与应用场景 Web Service 是一种跨编程语言和操作系统平台的远程调用技术。它允许不同语言编写的程序通过网络进行通信和数据交换。Web Service 的...
标题"JAVA调用.NET Web Service完整代码"表明我们将探讨Java如何通过SOAP(Simple Object Access Protocol)或者RESTful API与.NET Web服务进行交互。 首先,我们要理解.NET Web Service的本质,它是一种基于HTTP...