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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-02 22:06:23  来源:igfitidea点击:

"Hello World" SOAP Web Service using Spring MVC

javaspringspring-mvcsoap

提问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-drivenWeb services. It aims to facilitate contract-first SOAP service development. Some of its key features are:

Spring Web Services ( Spring-WS) 是 Spring 社区专注于创建document-drivenWeb 服务的产品。它旨在促进契约优先的 SOAP 服务开发。它的一些主要特点是:

  • Powerful mappingsThe incoming XML requests can be distributed to any object, depending on message payload, SOAP Action header, or an XPath expression.
  • XML API supportIncoming XML messages can be handled not only with standard JAXPAPIs such as DOM, SAX, and StAX, but also JDOM, dom4j, XOM, or even marshallingtechnologies.
  • 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, and XStream.
  • Reuses your Spring expertiseSpring-WS uses Spring application contextsfor all configuration, which should help Spring developers get up-to-speed nice and quickly. Also, the architecture of Spring-WSresembles that of Spring-MVC.
  • Supports WS-SecurityWS-Security allows you to signSOAP messages, encrypt and decrypt them, or authenticateagainst 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,例如DOMSAX和StAX的,但也JDOM,dom4j的,XOM,甚至marshalling技术。
  • 灵活的XML编组的Spring Web服务建立在Spring框架,它支持对象/ XML映射模块上 JAXB 1JAXB 2CastorXMLBeansJiBX,和XStream
  • 重用Spring-WSSpring application contexts用于所有配置的 Spring 专业知识,这应该可以帮助 Spring 开发人员快速上手。此外, 的架构Spring-WS类似于的架构Spring-MVC
  • 支持 WS-SecurityWS-Security 允许您signSOAP 消息、加密和解密它们,或者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

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 是一个广泛而复杂的主题。在开始实施之前,您可能希望明确概念。