使用spring-ws客户端是否需要生成java类
我想使用 spring ws 创建 webservice 客户端。我看过一些文档。 全部使用 jaxb 编组和解组。但首先需要从 xsd 创建 java 类。我尝试为此下载 elcipse 插件。 java.net 中的位置未显示任何要下载的内容。 Sourceforce net 显示下载链接。但该插件无法正常工作。我已经尝试过 wsimport
,但它只生成 .classes?
我的问题是如果我想使用spring ws,是否需要生成.java类?如果是这样,我在哪里可以找到 elipse 插件或如何生成类?有没有其他方法可以在不生成这些类的情况下完成?
如果您使用jboss,请使用wsconsume.bat
生成这些类
I want to use spring ws to create the webservice client. I have seen some documentation.
In all using jaxb marshalling and unmarshalling. But to start of need to create java classes from xsd. I tried to download the elcipse plugin for this. The location in java.net is not showing any thing to download. Sourceforce net showing the link to download. But that plugin is not working. I have tried wsimport
, but it is generating only .classes?
My question is if i want to use spring ws, is it required to generate .java classes? If so where can i find the elipse plugin or how to generate the classes? Is there any other way we can do without generating these classes?
If you use jboss, use wsconsume.bat
to generate these classes
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Spring-WS 允许您使用消息有效负载的几种不同表示形式,JAXB 只是其中之一。您还可以使用(例如)原始 DOM 对象(如果您选择)或其他一些选项。
如果您已经有 WSDL,那么
wsimport
应该可以很好地完成工作,它会为您的架构生成.class
文件。您也不需要.java
文件,严格来说,没有它们您也可以进行良好的开发,而 Spring-WS 对它们没有任何用处。不过,如果您拥有它们,那就更容易了,并且wsimport
有-keep generated
标志(或类似的东西),可以阻止它删除.java
文件一旦完成。Spring-WS lets you work with several different representations of the message payloads, JAXB is just one of them. You can also use (for example) raw DOM objects if you choose, or a few other options.
If you already have a WSDL, then
wsimport
should so the job nicely, it generates.class
files for your schema. You don't need the.java
files also, strictly speaking, you can develop just fine without them, and Spring-WS has no use for them. It is easier if you have them, though, andwsimport
has-keepgenerated
flag (or something like that) that stops it deleting the.java
files once it's finished.