This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Web Services and the fly likes SAXException while generating stubs for a WSDL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "SAXException while generating stubs for a WSDL" Watch "SAXException while generating stubs for a WSDL" New topic
Author

SAXException while generating stubs for a WSDL

vikram karne
Ranch Hand

Joined: Jun 05, 2007
Posts: 34
Hi Friends

i am stuck in a problem for which i need your help.
i am using the Axis wsdl2java tool to generate the client side stub classes.
the wsdl which i was using was referring to the port http://localhost/hth/services/Client?wsdl
i was running the wsdl2java tool on this wsdl to generate stubs. it was working fine.

Now i have removed the client.wsdl from the default localhost port and
want to keep it in some location like D:\wsdl\Client.wsdl so that i don't have to depend on the Application server which needs to be up everytime for the wsdl to be used.
when i run the wsdl2java command on this location i get the following error.
org.xml.sax.SAXException: Fatal Error: URI=file:///D:/wsdl/Client.wsdl Line=1: The processing instruction target matching "[xX][mM][lL]" is not allowed.
at org.apache.axis.utils.XMLUtils$ParserErrorHandler.fatalError(XMLUtils.java:723)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:218)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:386)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:316)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1438)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanPIData(XMLScanner.java:689)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanPIData(XMLDocumentFragmentScannerImpl.java:750)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanPI(XMLScanner.java:664)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch(XMLDocumentScannerImpl.java:845)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:250)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:292)
at org.apache.axis.utils.XMLUtils.newDocument(XMLUtils.java:369)
at org.apache.axis.utils.XMLUtils.newDocument(XMLUtils.java:420)
at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:482)
at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:361)
at java.lang.Thread.run(Thread.java:595)

Please let me know what is the problem here and how can i resolve this issue.
here is bit of the sample client.wsdl

<?xml version="1.0" encoding="UTF-8" ?>
- <wsdl efinitions targetNamespace="D:\wsdl\Client.wsdl" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="D:\wsdl\Client.wsdl" xmlns:intf="D:\wsdl\Client.wsdl" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns1="D:\wsdl\Client.wsdl" xmlns:tns2="http://client.hth.march.com" xmlns:tns3="http://exception.hth.march.com" xmlns:tns4="http://equipment.hth.march.com" xmlns:tns5="http://equipment.ws.hth.march.com" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <!--
WSDL created by Apache Axis version: 1.3
Built on Oct 05, 2005 (05:23:37 EDT)

-->
- <wsdl:types>
- <schema targetNamespace="D:\wsdl\Client.wsdl" xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://equipment.ws.hth.march.com" />
<import namespace="http://xml.apache.org/xml-soap" />
<import namespace="http://exception.hth.march.com" />
<import namespace="http://client.hth.march.com" />
<import namespace="http://equipment.hth.march.com" />
<import namespace="http://localhost/hth/services/Client" />
<import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
- <complexType name="HTHBaseDTO">
- <sequence>
<element name="md5Sum" nillable="true" type="xsd:string" />
<element name="primaryKey" nillable="true" type="xsd:integer" />
</sequence>
</complexType>
- <complexType name="VitalThresholdEnum">
- <sequence>
<element name="labelKey" nillable="true" type="xsd:string" />
<element name="pk" nillable="true" type="xsd:short" />
</sequence>
</complexType>
- <complexType name="VitalThresholdDTO">
- <complexContent>
- <extension base="tns1:HTHBaseDTO">
- <sequence>
<element name="categoryPk" nillable="true" type="xsd:short" />
<element name="clientCarePlanPk" nillable="true" type="xsd:long" />
<element name="clientPk" nillable="true" type="xsd:integer" />
<element name="clientVitalPrescriptionPk" nillable="true" type="xsd:integer" />
<element name="statusPk" nillable="true" type="xsd:short" />
<element name="syncStatusPk" nillable="true" type="xsd:short" />
<element name="thresholdType" nillable="true" type="tns1:VitalThresholdEnum" />
<element name="thresholdValue" nillable="true" type="xsd ouble" />
<element name="unitTy


hoping for positive replies from your side.

Thanks & regards
Vikram K
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SAXException while generating stubs for a WSDL
 
Similar Threads
XML Schema Problem
java.io.IOException: Type {http://lang.java}Exception is referenced but not defined.
XML Schema Problem
why Axis doesn't preserve Inheritance ?
WSDL2Java Error