使用JAX-WS时如何使用自己的自定义客户端类?

时间:2022-06-06 20:14:47

I'm using JAX-WS as a client and am generating classes from it. The problem with the generated classes is that they are simple pojos without any convenience methods. Is there a way I can use my own custom classes that I've written myself, instead? They would have the same fields and name as the generated classes would, but they would allow me to create my own convenience methods.

我正在使用JAX-WS作为客户端并从中生成类。生成的类的问题在于它们是简单的pojos而没有任何便利方法。有没有办法可以使用我自己编写的自定义类,而不是?它们将具有与生成的类相同的字段和名称,但它们将允许我创建自己的便捷方法。

1 个解决方案

#1


0  

if you are using JAX-WS you should be able to use the -keep option to keep the java source code when using wsimport. Then you should be able to modify it at your own convenience. E.g.

如果您使用的是JAX-WS,则应该能够使用-keep选项在使用wsimport时保留java源代码。然后你应该能够在自己方便的时候修改它。例如。

wsimport -keep -p stockquote http://stockquote.xyz/quote?wsdl

Reference for wsimport command

wsimport命令的参考

#1


0  

if you are using JAX-WS you should be able to use the -keep option to keep the java source code when using wsimport. Then you should be able to modify it at your own convenience. E.g.

如果您使用的是JAX-WS,则应该能够使用-keep选项在使用wsimport时保留java源代码。然后你应该能够在自己方便的时候修改它。例如。

wsimport -keep -p stockquote http://stockquote.xyz/quote?wsdl

Reference for wsimport command

wsimport命令的参考