我们可以从.JWS文件返回自定义对象类型吗?

时间:2021-07-15 16:28:25

Here is my situation: I'm using Apache Axis 1.1. I'm trying to set up a custom web service as a .jws file that is simply dropped onto the axis web app folder. So I'll have /axis/MyWebService.jws

这是我的情况:我正在使用Apache Axis 1.1。我正在尝试将自定义Web服务设置为.jws文件,该文件只是放在轴web应用程序文件夹中。所以我将有/axis/MyWebService.jws

This all works well and good, the WSDL file is automatically generated etc. However, I want to be able to return more than just String of Integer etc. I want to be able to return simple Java Bean type objects as well.

这一切都运行良好,WSDL文件是自动生成的等等。但是,我希望能够返回的不仅仅是String of Integer等。我希望能够返回简单的Java Bean类型对象。

Given that I'm stuck to the technology that I'm using, is there any way for me to accomplish this? My tomcat environment is java 1.5.XX, but it looks like the .jws files are compiled using 1.4 or so, b/c they cannot contain Generics etc.

鉴于我坚持使用我正在使用的技术,我有什么方法可以实现这一目标吗?我的tomcat环境是java 1.5.XX,但看起来.jws文件是用1.4左右编译的,b / c它们不能包含泛型等。

I'm open to suggestions, as long as I don't have to overhaul the structure, or change the environment etc.

我愿意接受建议,只要我不需要对结构进行大修,或改变环境等。

1 个解决方案

#1


0  

Turns out it;s just a matter of having a Java Bean type class put into the class path accessible by the JWS file. Once it's there, the automatic conversion to XML takes care of creating a Complex SOAP type etc... so Easy as pie, just need to have your code in the right place! Hope this helps someone else

事实证明,这只是将Java Bean类型类放入JWS文件可访问的类路径中。一旦它在那里,自动转换为XML负责创建一个复杂的SOAP类型等...所以像馅饼一样简单,只需要将代码放在正确的位置!希望这有助于其他人

#1


0  

Turns out it;s just a matter of having a Java Bean type class put into the class path accessible by the JWS file. Once it's there, the automatic conversion to XML takes care of creating a Complex SOAP type etc... so Easy as pie, just need to have your code in the right place! Hope this helps someone else

事实证明,这只是将Java Bean类型类放入JWS文件可访问的类路径中。一旦它在那里,自动转换为XML负责创建一个复杂的SOAP类型等...所以像馅饼一样简单,只需要将代码放在正确的位置!希望这有助于其他人