Register / Login
Win a copy of
this week in the
this forum made possible by our volunteer staff, including ...
Stephan van Hulst
WSDL2Java : Premature end of file
posted 3 years ago
I am unable use apache axis 2 to generate client side classes from the endpoint
using apache axis 2. I have tried the following without any success
Downloading the wsdl file and using a local copy instead of accessing it via the web.
Downloading the schema files separately and including them in the wsdl
Using wsimport instead of apache axis 2
Below is the error that i am getting
C:\axis2-1.5.4\axis2-1.5.4\bin>WSDL2Java -uri https://app.secure-booker.com/WebService4/soap/CustomerService.svc?wsdl Using AXIS2_HOME: C:\axis2-1.5.4\axis2-1.5.4 Using JAVA_HOME: C:\Program Files\Java\jdk1.6.0_24 Retrieving document at 'https://app.secure-booker.com/WebService4/soap/CustomerService.svc?wsdl'. [Fatal Error] :-1:-1: Premature end of file. Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing WSDL at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.java:156) at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35) at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24) Caused by: javax.wsdl.WSDLException: WSDLException (at /wsdl:definitions/wsdl:import): faultCode=PARSER_ERROR: Problem parsing 'http://app.secure-booker.com/WebService4/soap/CustomerService.svc?wsdl=wsdl0'.: org.xml.sax.SAXParseException remature end of file. at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source) at com.ibm.wsdl.xml.WSDLReaderImpl.parseImport(Unknown Source) at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source) at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.readInTheWSDLFile(CodeGenerationEngine.java:288) at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.java:111) ... 2 more Caused by: org.xml.sax.SAXParseException: Premature end of file. at org.apache.xerces.parsers.DOMParser.parse(Unknown Source) at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source) ... 12 more
I will appreciate any help that I can get.
Author and all-around good cowpoke
posted 3 years ago
If this was my problem the first thing I would do is look at the WSDL file with an XML compatible editor - perhaps there is an obvious problem.
Note that there are plenty of things that will throw off parsing an XML document such as a WSDL file :
1. any character before the first "<?xml" - which MUST start the first line of the document
2. any MS
3. any control code except cr lf (and tab I think...(
Personally I use UltraEdit-32 but there are plenty of XML compatible editors.
Note that if you can catch the
you can usually get a line and column number. Unfortunately it looks like the axis library is swallowing that exception
Hey, sticks and stones baby. And maybe a wee mention of my stuff:
the new thread boost feature brings a LOT of attention to your favorite threads
Boost this thread!
ConnectionException and few Doubts
Axis2 1.4 Problem in generating code
reading soap-envelop messages
The entity "nbsp" was referenced, but not declared.