I'm trying to generate Java web service proxy client using Apache Axis2 for Position Opening WSDL provided by HR-XML Consortium. I'm using wsdl2java
command-line tool to generate proxy client.
Command:
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
Finally, I then try to convert the generated classes into JAR by calling ant jar.all
. Unfortunately, it is failing to compile properly and throwing some errors. I don't know what the reasons are. There are more than 100 errors, but I have shown below the first 3 errors that appear at the top.
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] ^
Can somebody throw some light on this? My purpose is to convert this Position Opening WSDL into a JAR, so that I can use/call the functions directly from within my application.
EDIT:
Meantime, I even tried with wsimport
tool of JAX-WS, but it is failing at the command itself.
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