I'm refactoring the way the client code for a bottom-up web service is built. The existing build creates the Java client code by using a deployment of the web service on JBoss 4.2 and executing the Axis 2 AntCodegenTask against http://devserver.url?wsdl. This method fails if the development server is down or has outdated wsdl. (Crusie Control fails whenever the wsdl changes.)
我正在重构自下而上的Web服务的客户端代码的构建方式。现有的构建通过在JBoss 4.2上部署Web服务并对http://devserver.url?wsdl执行Axis 2 AntCodegenTask来创建Java客户端代码。如果开发服务器已关闭或已过时wsdl,则此方法将失败。 (只要wsdl发生变化,Crusie Control就会失败。)
I need to build the client code against the web service class itself instead of having to point to a deployment of the web service. I use java2wsdl to generate wsdl from the web service class and then use the same AntCodegenTask to generate the client classes.
我需要针对Web服务类本身构建客户端代码,而不必指向Web服务的部署。我使用java2wsdl从Web服务类生成wsdl,然后使用相同的AntCodegenTask生成客户端类。
The problem is that wsdl created by java2wsdl is different than what JBoss displays in http://devserver.url?wsdl. Among other things, some of the namespaces are different and the AntCodegenTask step doesn't convert these namespaces into the correct package structure.
问题是java2wsdl创建的wsdl与JBoss在http://devserver.url?wsdl中显示的不同。除其他外,一些命名空间是不同的,AntCodegenTask步骤不会将这些命名空间转换为正确的包结构。
I've got to get the final package structure to be what the client code expects. The existing AntCodegenTask uses namespacetopackages="..." to accomplish that, but when I execute the same AntCodegenTask to the wsdl generated by java2wsdl it doesn't convert the namespaces to the package name.
我必须让最终的包结构成为客户端代码所期望的。现有的AntCodegenTask使用namespacetopackages =“...”来实现这一点,但是当我对java2wsdl生成的wsdl执行相同的AntCodegenTask时,它不会将名称空间转换为包名。
Why would Axis show different wsdl when the web service is deployed in JBoss than it generates from java2wsdl?
为什么Axis在JBoss中部署Web服务时显示的不同于从java2wsdl生成的wsdl?
Is there a way to use Axis to create the client code from the web service class without generating the intermediate wsdl?
有没有办法使用Axis从Web服务类创建客户端代码而不生成中间wsdl?
The documentation for the java2wsdl and wsdl2java Ant tasks is a little bit spotty. Axis 2 v 1.4.1 gives Ant tasks for AntCodegenTask and 2 Java2WSDLTasks in different packages. The Axis 2 installation includes binaries for wsdl2java and java2wsdl, but no codegen binary. Maybe AntCodegenTask is the same as wsdl2java.
java2wsdl和wsdl2java Ant任务的文档有点不稳定。 Axis 2 v 1.4.1为不同的包中的AntCodegenTask和2个Java2WSDLTasks提供了Ant任务。 Axis 2安装包括wsdl2java和java2wsdl的二进制文件,但没有codegen二进制文件。也许AntCodegenTask与wsdl2java相同。
Has anyone got something like this to work with Axis 2?
有没有人有这样的东西与Axis 2合作?
1 个解决方案
#1
Deploy webservice on JBoss server. Save locally WSDL file and pass it as a parameter to Ant task. Hopefully generated classes would be correct, however it may happen that Axis 2 would not like to work with JBoss generated WSDL.
在JBoss服务器上部署webservice。保存本地WSDL文件并将其作为参数传递给Ant任务。希望生成的类是正确的,但是Axis 2可能不喜欢使用JBoss生成的WSDL。
In that case use wsconsume.bat provided with JBoss instead of AXIS ant task.
在这种情况下,使用JBoss提供的wsconsume.bat而不是AXIS ant任务。
Always use that once generated WSDL file, package it with application, etc, since even different versions of JBoss produce different WSDL files.
始终使用一次生成的WSDL文件,将其与应用程序打包等,因为即使不同版本的JBoss也会生成不同的WSDL文件。
Axis always sort of sucked, if you can (I now it is not so obvious...) use Apache CXF or native JBoss implementation.
Axis总是很糟糕,如果可以的话(我现在不是那么明显......)使用Apache CXF或本机JBoss实现。
#1
Deploy webservice on JBoss server. Save locally WSDL file and pass it as a parameter to Ant task. Hopefully generated classes would be correct, however it may happen that Axis 2 would not like to work with JBoss generated WSDL.
在JBoss服务器上部署webservice。保存本地WSDL文件并将其作为参数传递给Ant任务。希望生成的类是正确的,但是Axis 2可能不喜欢使用JBoss生成的WSDL。
In that case use wsconsume.bat provided with JBoss instead of AXIS ant task.
在这种情况下,使用JBoss提供的wsconsume.bat而不是AXIS ant任务。
Always use that once generated WSDL file, package it with application, etc, since even different versions of JBoss produce different WSDL files.
始终使用一次生成的WSDL文件,将其与应用程序打包等,因为即使不同版本的JBoss也会生成不同的WSDL文件。
Axis always sort of sucked, if you can (I now it is not so obvious...) use Apache CXF or native JBoss implementation.
Axis总是很糟糕,如果可以的话(我现在不是那么明显......)使用Apache CXF或本机JBoss实现。