简体   繁体   English

如何使用Java创建SOAP Web服务

[英]How to go about creating SOAP webservice in Java

I did some Core Java programming a decade back. 十年前,我做了一些Core Java编程。 Now I've got a project to create SOAP website. 现在,我有一个创建SOAP网站的项目。

I've a Windows machine setup on Amazon with Eclipse installed on it. 我在Amazon上安装了Windows计算机,并安装了Eclipse。

I thought of buying this book: http://shop.oreilly.com/product/9780596001759.do but it was released in 2002 and it's contents may be obsolete. 我曾想买这本书: http : //shop.oreilly.com/product/9780596001759.do,但它于2002年发行,其内容可能已过时。

I could not find any other stuff about how to go about creating SOAP webservice in Java. 我找不到有关如何在Java中创建SOAP Web服务的其他信息。

Please HELP! 请帮忙!

So I want to know step by step procedure, setting up the IDE + libraries etc. 因此,我想逐步了解程序,设置IDE +库等。

You can use axis2 for creating your webservices. 您可以使用axis2创建您的Web服务。 Axis2 Web Service using Eclipse will give you some help about creating one. 使用Eclipse的Axis2 Web服务将为您提供一些帮助。

The standard way is to use JaxWS, which is a part of Java 6 and later. 标准方法是使用JaxWS,它是Java 6及更高版本的一部分。 The approach varies depending if you use the "Java classes first" or "Contract first" approach. 该方法会有所不同,具体取决于您使用的是“ Java类优先”还是“合同优先”方法。

I always use contract first: 我总是首先使用合同:

  • Write the WSDL and any supporting XSDs that might be required 编写WSDL以及可能需要的所有支持XSD
  • Create the Java classes using wsimport (command line or as a Maven plugin) 使用wsimport创建Java类(命令行或作为Maven插件)
  • Add the business logic to the generated class 将业务逻辑添加到生成的类

There are multiple tutorials on the web. 网上有多个教程。 Search on JaxWS and wsimport. 在JaxWS和wsimport上搜索。

The integration with Java even allows you to publish a web service from a triial command line program. 与Java的集成甚至允许您从试用命令行程序发布Web服务。

Read some tutorial from internet for creating jax-ws webservice. 从Internet阅读一些有关创建jax-ws Web服务的教程。

If you want to read some books I would recommend these two books : 如果您想阅读一些书籍,我会推荐这两本书:

1.Java Web Services: Up and Running 1.Java Web服务:启动并运行

2.Apache CXF Web Service Development 2.Apache CXF Web服务开发

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM