本文介绍了Java Webservice Client(最佳方式)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有第三方WSDL,我需要用Java编写代码,以便Web服务客户端调用第三方WSDL中的操作。现在,我使用Axis的WSDL2JAVA工具生成了客户端存根,并使用XMLbeans进行数据绑定。

I have a third party WSDL, I need to write code in Java for a web service client to invoke the operations in the third party WSDL. Right now, I have generated the client stub using the WSDL2JAVA tool from Axis and used the XMLbeans for data binding.


  1. 执行此JAVA的最佳方法是什么?

  2. 我读过有关SAAJ的内容,看起来像那将是更细粒度的方法?

  3. 除了使用WSDL2Java工具之外,还有其他方法来生成代码。在另一个选项中可能 wsimport 。有什么优点和缺点?

  4. 有人可以发送链接以获得有关这些主题的一些好教程吗?

  5. 我们需要使用哪些选项?使用WSDL2Java生成代码?

  1. What is the best approach to do this JAVA?
  2. I read about SAAJ, looks like that will be more granular level of approach?
  3. Is there any other way than using the WSDL2Java tool, to generate the code. Maybe wsimport in another option. What are the pros and cons?
  4. Can someone send the links for some good tutorials on these topics?
  5. What are the options we need to use while generating the code using the WSDL2Java?

我最初使用了一些基本的东西。现在我有这些选项

I used some of the basic things initially. Now I have these options

C:\axis2-1.5.1\bin>wsdl2java -uri  mywsdlurl  -o client -p somepackage -d xmlbeans -s -t -ssi


推荐答案

我个人使用Axis 2,即使仅用于客户端开发。这就是我远离它的原因:

I would personally NOT use Axis 2, even for client side development only. Here is why I stay away from it:


  1. 我不喜欢它的架构,讨厌它的反生产部署模型。

  2. 我发现它是低质量的项目。

  3. 我不喜欢它的表现(参见)。

  4. 这总是一场噩梦设置依赖项(我使用Maven和我总是必须与大量依赖项斗争)(参见#2)

  5. Axis吸得很大,而Axis2不是更好。不,这不是个人意见,有共识。

  6. 我遭受过一次,再也没有。

  1. I don't like its architecture and hate its counter productive deployment model.
  2. I find it to be low quality project.
  3. I don't like its performances (see this benchmark against JAX-WS RI).
  4. It's always a nightmare to setup dependencies (I use Maven and I always have to fight with the gazillion of dependencies) (see #2)
  5. Axis sucked big time and Axis2 isn't better. No, this is not a personal opinion, there is a consensus.
  6. I suffered once, never again.

Axis仍然存在的唯一原因是IMO,因为它已经在Eclipse中使用了很久。感谢上帝,这已经在Eclipse Helios中得到修复,我希望Axis2最终会死。有更好的堆栈。

The only reason Axis is still around is IMO because it's used in Eclipse since ages. Thanks god, this has been fixed in Eclipse Helios and I hope Axis2 will finally die. There are just much better stacks.

要做什么?

是的!首选JAX-WS堆栈,如或(您可能还会阅读有关Metro, = JAX-WS RI + ),它们更优雅,更简单,更易于使用。在您的情况下,我将使用Java 6中包含的JAX-WS RI,因此 wsimport

Yes! Prefer a JAX-WS stack like CXF or JAX-WS RI (you might also read about Metro, Metro = JAX-WS RI + WSIT), they are just more elegant, simpler, easier to use. In your case, I would just use JAX-WS RI which is included in Java 6 and thus wsimport.

这是另一个专业,有很多(优质)JAX-WS教程,参见例如:

That's another pro, there are plenty of (good quality) tutorials for JAX-WS, see for example:


  • (从这里开始)




  • 在BileBlog上(为胆汁做好准备) - 你必须停止重定向。

  • Elad’s Adventures in Java WebServiceLand
  • Axis2: Why bother? on the BileBlog (be prepared for the bile) - you'll have to stop the redirect.



  • What is the best java webservice framework?
  • Spring-ws or Axis2 or Something else for "Contract-First" approach to WS

这篇关于Java Webservice Client(最佳方式)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-25 00:36