About the T utorial
Spring Web Services (Spring-WS) is one of the project developed by the Spring Community. Its prime focus is to create document-driven Web Services. The Spring Web Services project facilitates contract-first SOAP service development, provides multiple ways to create flexible web services, which can manipulate XML payloads in multiple ways. Being Spring based, Spring Web Services uses Spring Concepts like Dependency Injection and Configurations seamlessly. Spring-WS requires Spring 3.0 version.
Spring Framework was initially written by Rod Johnson and was first released under the Apache 2.0 license in June 2003. This tutorial has been written based on the Spring Framework Version 4.1.6 released in March 2015.
Audience
This tutorial is designed for Java Programmers with a need to understand the Spring Web Services Framework in detail along with its architecture and actual usage. This tutorial will bring the readers to the intermediate level of expertise and from there they can take themselves to a higher level of proficiency.
Prerequisites
Before proceeding with this tutorial, you should have a good understanding of Java Programming Language. Additionally, understanding of the Eclipse IDE (Integrated Development Environment) is also required because all the examples have been compiled using the Eclipse IDE.
Copyright and Disclaimer
Copyright 2017 by Tutorials Point (I) Pvt. Ltd.
All the content and graphics published in this e-book are the property of Tutorials Point (I) Pvt. Ltd. The user of this e-book is prohibited to reuse, retain, copy, distribute or republish any contents or a part of contents of this e-book in any manner without written consent of the publisher.
We strive to update the contents of our website and tutorials as timely and as precisely as possible, however, the contents may contain inaccuracies or errors. Tutorials Point (I) Pvt. Ltd. provides no guarantee regarding the accuracy, timeliness or completeness of our website or its contents including this tutorial. If you discover any errors on our website or in this tutorial, please notify us at **************************
T able of Contents
About the Tutorial (i)
Audience (i)
Prerequisites (i)
Copyright and Disclaimer (i)
Table of Contents (ii)
1.Spring WS – Overview (1)
2.Spring WS – Environment Setup (3)
System Requirements (3)
3.Spring WS – First Application (11)
Contract-first Approach (11)
Create the Project (12)
Build the Project (19)
Run the Project (20)
4.Spring WS – Static WSDL (22)
Run the Project (23)
5.Spring WS – Writing Server (25)
Create the Project (26)
Create Domain Classes (28)
Build the Project (32)
Run the Project (34)
6.Spring WS – Unit Test Server (36)
Build the Project (40)
7.Spring Web Services – Writing Client (43)
8.Spring WS – Unit Test Client (45)
Unit Test Web Service Client (46)
spring怎么读中文什么意思Spring Web Services
1.
Spring Web Services (Spring-WS) is one of the projects developed by the Spring Community. Its prime focus is to create document-driven Web Services. The Spring Web Services project facilitates contract-first SOAP Service Development, provides multiple ways to create flexible web services, which can manipulate XML payloads in multiple ways. The Spring web services uses Spring concepts like dependency injection and configurations seamlessly. The Spring-WS requires Spring 3.0 Version. With contract-first development, we start with WSDL Contract and then will use JAVA to implement the required contract. As opposed to the contract-last approach where JAVA interfaces generate WSDL/XSD contract. The WSDL based contract remains independent of JAVA implementation in the c
ontract-first approach. In case we require changing the JAVA interfaces, then there is no need to communicate the changes made in the existing WSDL contract to the web services users. Spring-WS aims to provide loose coupling between the WSDL contract and its JAVA based implementation.
Features
Following are the features of Spring Web Services:
∙XML Mapping to Objects–XML based requests can be mapped to any object using the information stored in the Message Payload, SOAP Action Header or by using an XPath Expression.
∙Multiple API Support to parse XML– Apart from the standard JAXP APIs (DOM, SAX, StAX) to parse the incoming XML requests, other libraries like JDOM, dom4j, XOM are also supported.
∙Multiple API Support to marshal XML – Spring Web Services supports JAXB 1 and 2, Castor, XMLBeans, JiBX, and XStream libraries using its Object/XML Mapping module. The Object/XML Mapping module can also be used in non-web services code as well.
∙Spring based configurations– Spring Web Services uses the Spring Application Contexts for its configurations having a similar architecture as that of the Spring Web MVC.
∙Integrated WS-Security module– Using the WS-Security module, you can Sign, Encrypt, Decrypt SOAP Messages or Authenticate them.
∙Support for Acegi Security –Using the WS-Security implementation of Spring Web Services, Acegi configuration can be used for your SOAP services.
Architecture
The Spring-WS project consists of five major modules, which are explained below.
∙Spring-WS Core– It is the primary module and provides the Central Interfaces like WebServiceMessage and SoapMessage, the server-side framework,
Spring Web Services powerful message dispatching capability and support classes to implement Web service endpoints. It also provides Web Service consumer client as WebServiceTemplate.
∙Spring-WS Support– This module provides supports for JMS, emails, etc.
∙Spring-WS Security–This module is responsible to provide WS-Security implementation integrated with core Web Service Module. Using this module, we can add principal tokens, sign, encrypt and decr
ypt SOAP messages. This module allows using the existing Spring Security Implementation for authentication and authorization.
∙Spring XML– This module provides XML support classes for Spring Web Services.
This module is internally used by Spring-WS framework.
∙Spring OXM– This module provides support classes for XML vs Object Mapping.
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论