如何学习 Java Web 服务
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/119838/
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
How to learn Java Webservices
提问by Chaitanya MSV
Please suggest some good resources to start writing Java Web services.
请推荐一些好的资源来开始编写 Java Web 服务。
采纳答案by JeeBee
The standard way in Java to write a web service is to use Apache Axis.
Java 中编写 Web 服务的标准方法是使用 Apache Axis。
If you are generating a web service client, then you need the WSDL (.xsd, .wsdl, etc) of the foreign web service, and then you can use wsdl2java (or preferably, the ANT task provided by axis-ant) to simply generate the code to do the communications and a model.
如果是生成web服务客户端,那么就需要国外web服务的WSDL(.xsd、.wsdl等),然后可以使用wsdl2java(或者最好是axis-ant提供的ANT任务)来简单的生成代码以进行通信和模型。
If you are generating a web service on the server side, then you can use Java2WSDL to turn a Java model into a web service implementation, although you will have to code the server side within the Impl class it generates. You can then easily deploy on Tomcat, etc, using the axis.war and the generated deploy.wsdd script.
如果您在服务器端生成 Web 服务,那么您可以使用 Java2WSDL 将 Java 模型转换为 Web 服务实现,尽管您必须在它生成的 Impl 类中对服务器端进行编码。然后,您可以使用axis.war 和生成的deploy.wsdd 脚本轻松地在Tomcat 等上进行部署。
There's plenty of documentation out there that will help.
有很多文档可以提供帮助。
回答by Chaitanya MSV
If you're using the Spring Framework, I suggest Spring-WS.
如果您使用的是 Spring 框架,我建议您使用Spring-WS。
There is a very helpful reference guidewhich should get you started.
有一个非常有用的参考指南,可以帮助您入门。
回答by Sietse
This is a good starting point for REST and JAX-RS:
这是 REST 和 JAX-RS 的一个很好的起点:
http://www.lunatech-research.com/archives/2008/03/20/restful-web-sevices-resteasy-jax-rs
http://www.lunatech-research.com/archives/2008/03/20/restful-web-sevices-resteasy-jax-rs
回答by anbanm
A great place to start is Sang Shin's online course. There's an active online group as well as good slides, examples and exercises to complete. The great thing about this course is that there are timelines set for each component of the course, to help you figure out how much time to spend on a particular concept.
一个很好的起点是 Sang Shin 的在线课程。有一个活跃的在线小组以及需要完成的优秀幻灯片、示例和练习。这门课程的好处在于,课程的每个组成部分都设置了时间表,以帮助您确定在特定概念上花费多少时间。
回答by Chris Carruthers
Apache Axis (http://ws.apache.org/axis) is easy to use and highly effective for basic web services in my experience.
根据我的经验,Apache Axis ( http://ws.apache.org/axis) 易于使用且对基本 Web 服务非常有效。
The user guide should get you started: http://ws.apache.org/axis/java/user-guide.html
用户指南应该让你开始:http: //ws.apache.org/axis/java/user-guide.html
回答by paulosuzart
I highly recommend you to start by the new specification Jax-WS 2.0. It's a good idea walk on the standards. Sun provides a reference implementation that you can use. Try the JAX-WS web siteand then you can watch the Metro web siteto see all the standard ws-* stack.
我强烈建议您从新规范 Jax-WS 2.0 开始。按照标准走是个好主意。Sun 提供了一个您可以使用的参考实现。尝试JAX-WS 网站,然后您可以观看Metro 网站以查看所有标准 ws-* 堆栈。
I'm using this tool to consume and provide services. It's fast, easy to use, customizable and the standard.
我正在使用这个工具来消费和提供服务。它快速、易于使用、可定制且符合标准。
Enjoy it!
好好享受!
回答by stjohnroe
Check out Java Enterprise in a nutshellit has a good section on web services, describing both the J2EE framework specification and also the Apache Axis implementation. Bear in mind that, while it may be popular, Axis is not the standard method, but something that was developed while standards where being finalised/refined.
简而言之,查看Java Enterprise,它有一个关于 Web 服务的很好的部分,描述了 J2EE 框架规范和 Apache Axis 实现。请记住,虽然它可能很受欢迎,但 Axis 并不是标准方法,而是在最终确定/完善标准时开发的东西。

