Java Web服务:构建与运行(影印版)
基本信息
- 原书名: Java Web Services: Up and Running
- 原出版社: O'Reilly Media
- 作者: Martin Kalin [作译者介绍]
- 丛书名: 南京东南大学出版社O'Reilly系列
- 出版社:东南大学出版社
- ISBN:9787564119270
- 上架时间:2010-3-12
- 出版日期:2010 年1月
- 开本:16开
- 页码:297
- 版次:1-1
- 所属分类:
计算机 > 软件与程序设计 > JAVA(J#) > 综合
编辑推荐
《Java Web服务:构建与运行》通过提供混合架构概述、完整的工作代码示例以及短而精确的编译、部署和执行应用程序的指示,采用明确实用的方法来处理这些技术。你将学习如何从头开始编写Web服务以及集成现有服务到你的Java应用程序中。
内容简介回到顶部↑
这本实例众多的书提供了对java的api的一个全面介绍,包括针对xml web服务的jax-ws和针对restful web服务的jax-rs。
《java web服务:构建与运行》通过提供混合架构概述、完整的工作代码示例以及短而精确的编译、部署和执行应用程序的指示,采用明确实用的方法来处理这些技术。你将学习如何从头开始编写web服务以及集成现有服务到你的java应用程序中。有了这本书,你将:
· 理解基于soap的和rest样式的服务的区别
· 编写、部署和使用基于soap的核心java服务
· 理解web服务描述语言(wsdl)服务契约
· 认识soap消息的结构
· 学习如何交付基于java的restful web服务和消耗商业restful服务
· 了解对基于soap和基于rest的web服务的安全要求
· 学习如何在各种环境下部署jax-ws服务
不管是学生还是有经验的程序员,当你需要立即运用这些技术展开工作时,《java web服务:构建与运行》都是你需要的一本理想的简明指南。
《java web服务:构建与运行》通过提供混合架构概述、完整的工作代码示例以及短而精确的编译、部署和执行应用程序的指示,采用明确实用的方法来处理这些技术。你将学习如何从头开始编写web服务以及集成现有服务到你的java应用程序中。有了这本书,你将:
· 理解基于soap的和rest样式的服务的区别
· 编写、部署和使用基于soap的核心java服务
· 理解web服务描述语言(wsdl)服务契约
· 认识soap消息的结构
· 学习如何交付基于java的restful web服务和消耗商业restful服务
· 了解对基于soap和基于rest的web服务的安全要求
· 学习如何在各种环境下部署jax-ws服务
不管是学生还是有经验的程序员,当你需要立即运用这些技术展开工作时,《java web服务:构建与运行》都是你需要的一本理想的简明指南。
作译者回到顶部↑
本书提供作译者介绍
Martin Kalin, 德保罗大学计算机和数字媒体学院教授,拥有西北大学的博士学位。他撰写过关于C语言、C++和Java的书,并参与开发过大型分布式系统中的进程调度和产品配置。
.. << 查看详细
.. << 查看详细
目录回到顶部↑
preface
1. java web services quickstart
what are web services?
what good are web services?
a first example
the service endpoint interface and service implementation bean
a java application to publish the web service
testing the web service with a browser
a perl and a ruby requester of the web service
the hidden soap
a java requester of the web service
wire-level tracking of http and soap messages
what’s clear so far?
key features of the first code example
java’s soap api
an example with richer data types
publishing the service and writing a client
multithreading the endpoint publisher
what’s next?
2. all about wsdls
1. java web services quickstart
what are web services?
what good are web services?
a first example
the service endpoint interface and service implementation bean
a java application to publish the web service
testing the web service with a browser
a perl and a ruby requester of the web service
the hidden soap
a java requester of the web service
wire-level tracking of http and soap messages
what’s clear so far?
key features of the first code example
java’s soap api
an example with richer data types
publishing the service and writing a client
multithreading the endpoint publisher
what’s next?
2. all about wsdls
前言回到顶部↑
This is a book for programmers interested in developing Java web services and Java clients against web services, whatever the implementation language. The book is a code- driven introduction to JAX-WS (Java APl for XML-Web Services), the framework of choice for Java web services, whether SOAP-based or REST-style. My approach is to interpret JAX-WS broadly and, therefore, to include leading-edge developments such as the Jersey project for REST-style web services, officially known as JAX-RS (Java APl for XML-RESTful Web Services).
JAX-WS is bundled into the Metro Web Services Stack, or Metro for short. Metro is part of core Java, starting with Standard Edition 6 (hereafter, core Java 6). However, the Metro releases outpace the core Java releases. The current Metro release can be down- loaded separately from https://wsit, dev.java.net. Metro is also integrated into the Sun application server, GlassFish. Given these options, this book's examples are deployed in four different ways:
Core Java only
This is the low-fuss approach that makes it easy to get web services and their clients up and running. The only required software is the Java software development kit (SDK), core Java 6 or later. Web services can be deployed easily using the Endpoint, HttpServer, and HttpsServer classes. The early examples take this approach.
Core Java with the current Metro release
This approach takes advantage of Metro features not yet available in the core Java bundle. In general, each Metro release makes it easier to write web services and clients. The current Metro release also indicates where JAX-WS is moving. The Metro release also can be used with core Java 5 if core Java 6 is not an option.
Standalone Tomcat
This approach builds on the familiarity among Java programmers with standalone web containers such as Apache Tomcat, which is the reference implementation. Web services can be deployed using a web container in essentially the same way as are servlets, JavaServer Pages (JSP) scripts, and JavaServer Faces (JSF) scripts. A standalone web container such as Tomcat is also a good way to introduce container-managed security for web services.
GlassFish
This approach allows deployed web services to interact naturally with other enterprise components such as Java Message Service topics and queues, a JNDI (Java Naming and Directory Interface) provider, a backend database system and the @Entity instances that mediate between an application and the database sys- tem, and an EJB (Enterprise Java Bean) container. The EJB container is important because a web service can be deployed as a stateless Session EJB, which brings advantages such as container-managed thread safety. GlassFish works seamlessly with Metro, including its advanced features, and with popular IDEs (Integrated Development Environment) such as NetBeans and Eclipse.
An appealing feature of JAX-WS is that the API can be separated cleanly from deploy- ment options. One and the same web service can be deployed in different ways to suit different needs. Core Java alone is good for learning, development, and even lightweight deployment. A standalone web container such as Tomcat provides additional support. A Java application server such as GlassFish promotes easy integration of web services with other enterprise technologies.
Code-Driven Approach
My code examples are short enough to highlight key features of JAX-WS but also re- alistic enough to show off the production-level capabilities that come with the JAX-WS framework. Each code example is given in full, including all of the import statements. My approach is to begin with a relatively sparse example and then to add and modify features. The code samples vary in length from a few statements to several pages of source. The code is deliberately modular. Whenever there is a choice between con- ciseness and clarity in coding, I try to opt for clarity.
The examples come with instructions for compiling and deploying the web services and for testing the service against sample clients. This approach presents the choices that JAX-WS makes available to the programmer but also encourages a clear and thor- ough analysis of the JAX-WS libraries and utilities. My goal is to furnish code samples that can serve as templates for commercial applications.
JAX-WS is a rich API that is explored best in a mix of overview and examples. My aim is to explain key features about the architecture of web services but, above all, to illus- trate each major feature with code examples that perform as advertised: Architecture without code is empty; code without architecture is blind. My approach is to integrate the two throughout the book.
Web services are a modern, lightweight approach to distributed software systems, that is, systems such as email or the World Wide Web that require different software com- ponents to execute on physically distinct devices. The devices can range from large servers through personal desktop machines to handhelds of various types. Distributed systems are complicated because they are made up of networked components. There is nothing more frustrating than a distributed systems example that does not work as claimed because the debugging is tedious. My approach is thus to provide full, working examples together with short but precise instructions for getting the sample application up and running. All of the source code for examples is available from the book's com- panion site, at http://uavw, oreilly, com/catalog/9780596521127. My email address is kalin@cdm.depaul, edu. Please let me know if you find any code errors.
Chapter-by-Chapter Overview
The book has seven chapters, the last of which is quite short. Here is a preview of each chapter:
Chapter 1, Java Web Services Quickstart
This chapter begins with a working definition of web services, including the dis- tinction between SOAP-based and REST-style services. This chapter then focuses on the basics of writing, deploying, and consuming SOAP-based services in core Java. There are web service clients written in Peri, Ruby, and Java to underscore the language neutrality of web services. This chapter also introduces Java's SOAP APl and covers various ways to inspect web service traffic at the wire level. The chapter elaborates on the relationship between core Java and Metro.
JAX-WS is bundled into the Metro Web Services Stack, or Metro for short. Metro is part of core Java, starting with Standard Edition 6 (hereafter, core Java 6). However, the Metro releases outpace the core Java releases. The current Metro release can be down- loaded separately from https://wsit, dev.java.net. Metro is also integrated into the Sun application server, GlassFish. Given these options, this book's examples are deployed in four different ways:
Core Java only
This is the low-fuss approach that makes it easy to get web services and their clients up and running. The only required software is the Java software development kit (SDK), core Java 6 or later. Web services can be deployed easily using the Endpoint, HttpServer, and HttpsServer classes. The early examples take this approach.
Core Java with the current Metro release
This approach takes advantage of Metro features not yet available in the core Java bundle. In general, each Metro release makes it easier to write web services and clients. The current Metro release also indicates where JAX-WS is moving. The Metro release also can be used with core Java 5 if core Java 6 is not an option.
Standalone Tomcat
This approach builds on the familiarity among Java programmers with standalone web containers such as Apache Tomcat, which is the reference implementation. Web services can be deployed using a web container in essentially the same way as are servlets, JavaServer Pages (JSP) scripts, and JavaServer Faces (JSF) scripts. A standalone web container such as Tomcat is also a good way to introduce container-managed security for web services.
GlassFish
This approach allows deployed web services to interact naturally with other enterprise components such as Java Message Service topics and queues, a JNDI (Java Naming and Directory Interface) provider, a backend database system and the @Entity instances that mediate between an application and the database sys- tem, and an EJB (Enterprise Java Bean) container. The EJB container is important because a web service can be deployed as a stateless Session EJB, which brings advantages such as container-managed thread safety. GlassFish works seamlessly with Metro, including its advanced features, and with popular IDEs (Integrated Development Environment) such as NetBeans and Eclipse.
An appealing feature of JAX-WS is that the API can be separated cleanly from deploy- ment options. One and the same web service can be deployed in different ways to suit different needs. Core Java alone is good for learning, development, and even lightweight deployment. A standalone web container such as Tomcat provides additional support. A Java application server such as GlassFish promotes easy integration of web services with other enterprise technologies.
Code-Driven Approach
My code examples are short enough to highlight key features of JAX-WS but also re- alistic enough to show off the production-level capabilities that come with the JAX-WS framework. Each code example is given in full, including all of the import statements. My approach is to begin with a relatively sparse example and then to add and modify features. The code samples vary in length from a few statements to several pages of source. The code is deliberately modular. Whenever there is a choice between con- ciseness and clarity in coding, I try to opt for clarity.
The examples come with instructions for compiling and deploying the web services and for testing the service against sample clients. This approach presents the choices that JAX-WS makes available to the programmer but also encourages a clear and thor- ough analysis of the JAX-WS libraries and utilities. My goal is to furnish code samples that can serve as templates for commercial applications.
JAX-WS is a rich API that is explored best in a mix of overview and examples. My aim is to explain key features about the architecture of web services but, above all, to illus- trate each major feature with code examples that perform as advertised: Architecture without code is empty; code without architecture is blind. My approach is to integrate the two throughout the book.
Web services are a modern, lightweight approach to distributed software systems, that is, systems such as email or the World Wide Web that require different software com- ponents to execute on physically distinct devices. The devices can range from large servers through personal desktop machines to handhelds of various types. Distributed systems are complicated because they are made up of networked components. There is nothing more frustrating than a distributed systems example that does not work as claimed because the debugging is tedious. My approach is thus to provide full, working examples together with short but precise instructions for getting the sample application up and running. All of the source code for examples is available from the book's com- panion site, at http://uavw, oreilly, com/catalog/9780596521127. My email address is kalin@cdm.depaul, edu. Please let me know if you find any code errors.
Chapter-by-Chapter Overview
The book has seven chapters, the last of which is quite short. Here is a preview of each chapter:
Chapter 1, Java Web Services Quickstart
This chapter begins with a working definition of web services, including the dis- tinction between SOAP-based and REST-style services. This chapter then focuses on the basics of writing, deploying, and consuming SOAP-based services in core Java. There are web service clients written in Peri, Ruby, and Java to underscore the language neutrality of web services. This chapter also introduces Java's SOAP APl and covers various ways to inspect web service traffic at the wire level. The chapter elaborates on the relationship between core Java and Metro.
媒体评论回到顶部↑
“《Java Web服务:构建与运行》有很多我发现非常实用的实例,从使用Amazon Associates Web服务到有很好的图解和安全说明以及加密密码的关于安全的一章,还包括使用证书的示例,这部分内容我还没在其他书中见过。”
——Greg Ostravich,Denver Java用户组主席
——Greg Ostravich,Denver Java用户组主席








点击看大图


加载中...

