【发布时间】:2011-09-19 05:11:15
【问题描述】:
我正在尝试为HR-XML Consortium 提供的Position Opening WSDL 使用Apache Axis2 生成Java Web 服务代理客户端。我正在使用wsdl2java 命令行工具生成代理客户端。
命令:
wsdl2java -uri http://ns.hr-xml.org/schemas/org_hr-xml/3_1_1/Services/Web_Services/WSDL/PositionOpening.wsdl -d adb -o hrxml-positionopening
最后,我尝试通过调用ant jar.all 将生成的类转换为JAR。不幸的是,它无法正确编译并引发一些错误。我不知道是什么原因。有超过 100 个错误,但我在下面显示了顶部出现的前 3 个错误。
E:\axis2-1.5.4\bin\hrxml-positionopening>ant jar.all
Buildfile: build.xml
init:
pre.compile.test:
[echo] Stax Availability= true
[echo] Axis2 Availability= true
compile.src:
[javac] Compiling 3 source files to E:\axis2-1.5.4\bin\hrxml-positionopening\build\classes
[javac] E:\axis2-1.5.4\bin\hrxml-positionopening\src\org\hr_xml\www\_3\ws\PositionOpening_ServiceStub.java:315862: 'else' without 'if'
[javac] else
[javac] ^
[javac] E:\axis2-1.5.4\bin\hrxml-positionopening\src\org\hr_xml\www\_3\ws\PositionOpening_ServiceStub.java:315964: 'else' without 'if'
[javac] } else {
[javac] ^
[javac] E:\axis2-1.5.4\bin\hrxml-positionopening\src\org\hr_xml\www\_3\ws\PositionOpening_ServiceStub.java:315718: 'try' without 'catch' or 'finally'
[javac] try {
[javac] ^
有人可以解释一下吗?我的目的是将这个 Position Opening WSDL 转换为 JAR,以便我可以直接在我的应用程序中使用/调用这些函数。
编辑:
同时,我什至尝试使用 JAX-WS 的 wsimport 工具,但它在命令本身上失败了。
E:\jdk1.6.0\bin>wsimport.exe -d hrxml-positionopening http://ns.hr-xml.org/schemas/org_hr-xml/3_1_1/Services/Web_Services/WSDL/PositionOpening.wsdl
error: Property "Type" is already defined.
line 1473 of http://ns.hr-xml.org/schemas/org_openapplications_platform/1_1/Common/OAGi/Components/Components.xsd
error: The following location is relevant to the above error
line 1480 of http://ns.hr-xml.org/schemas/org_openapplications_platform/1_1/Common/OAGi/Components/Components.xsd
error: com.sun.istack.internal.SAXParseException2: The following location is relevant to the above error
【问题讨论】:
标签: java web-services code-generation jax-ws axis2