java 使用 Spring MVC 的“Hello World”SOAP Web 服务
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/33762027/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
"Hello World" SOAP Web Service using Spring MVC
提问by ct2602
I want to write a hello world Spring MVC web service in Java. I'm really struggling to find a tutorial that goes to the basics to allow me to do this - ie. step by step for hello world.
我想用 Java 编写一个 hello world Spring MVC web 服务。我真的很难找到一个包含基础知识的教程来让我做到这一点 - 即。你好世界的一步一步。
Can anyone please help?
有人可以帮忙吗?
回答by SyntaX
Spring Web Services (Spring-WS
) is a product of the Spring community focused on creating document-driven
Web services. It aims to facilitate contract-first SOAP service development. Some of its key features are:
Spring Web Services ( Spring-WS
) 是 Spring 社区专注于创建document-driven
Web 服务的产品。它旨在促进契约优先的 SOAP 服务开发。它的一些主要特点是:
- Powerful mappingsThe incoming XML requests can be distributed to any
object
, depending onmessage payload
, SOAP Action header, or an XPath expression. - XML API supportIncoming XML messages can be handled not only with standard
JAXP
APIs such asDOM
,SAX
, and StAX, but also JDOM, dom4j, XOM, or evenmarshalling
technologies. - Flexible XML MarshallingSpring Web Services builds on the
Object/XML Mapping module in the Spring Framework, which supports
JAXB 1
,JAXB 2
,Castor
,XMLBeans
,JiBX
, andXStream
. - Reuses your Spring expertiseSpring-WS uses
Spring application contexts
for all configuration, which should help Spring developers get up-to-speed nice and quickly. Also, the architecture ofSpring-WS
resembles that ofSpring-MVC
. - Supports WS-SecurityWS-Security allows you to
sign
SOAP messages, encrypt and decrypt them, orauthenticate
against them. - Integrates with Spring SecurityThe WS-Security implementation of Spring Web Services provides integration with
Spring Security
.
- 强大的映射传入XML请求可以分配给任何
object
,这取决于message payload
,SOAP动作标题或XPath表达式。 - XML API支持传入的XML消息可以被处理,不仅具有标准
JAXP
的API,例如DOM
,SAX
和StAX的,但也JDOM,dom4j的,XOM,甚至marshalling
技术。 - 灵活的XML编组的Spring Web服务建立在Spring框架,它支持对象/ XML映射模块上
JAXB 1
,JAXB 2
,Castor
,XMLBeans
,JiBX
,和XStream
。 - 重用Spring-WS
Spring application contexts
用于所有配置的 Spring 专业知识,这应该可以帮助 Spring 开发人员快速上手。此外, 的架构Spring-WS
类似于的架构Spring-MVC
。 - 支持 WS-SecurityWS-Security 允许您
sign
SOAP 消息、加密和解密它们,或者authenticate
针对它们。 - 与 Spring Security 集成Spring Web 服务的 WS-Security 实现提供了与
Spring Security
.
Here are the List of tutorials and documentations to help to get started with
Spring-ws
:
以下是帮助入门的教程和文档列表
Spring-ws
:
- Youtube - Spring-WS Tutorial
- Spring Web Services Tutorial
- Building a SOAP Webservices Proxy Module
- Official - Spring Web Services Reference Documentation
- Spring 4 + SOAP Web Service Producer and Consumer Example
- Youtube - Spring-WS 教程
- Spring Web 服务教程
- 构建 SOAP Webservices 代理模块
- 官方 - Spring Web 服务参考文档
- Spring 4 + SOAP Web 服务生产者和消费者示例
SOAP is broad and complex topic, unlike REST API. You might want to get the concepts clear before starting with the implementation.
与 REST API 不同,SOAP 是一个广泛而复杂的主题。在开始实施之前,您可能希望明确概念。