aspose file tools*
The moose likes Web Services and the fly likes Axis client calling .NET Web service Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Axis client calling .NET Web service" Watch "Axis client calling .NET Web service" New topic
Author

Axis client calling .NET Web service

George Pincharoen
Ranch Hand

Joined: Jul 03, 2001
Posts: 45
Hi,

I am calling a .NET web service from an axis client running on tomcat 5.0.
I got [ns1:VerifyEmailResult: null] as a result while I got the perfect xml response when I run this program as standalone.

Here's what I printed on the screen

Result: [ns1:VerifyEmailResult: null]
[Fatal Error] :1:1: Content is not allowed in prolog.
org.xml.sax.SAXParseException: Content is not allowed in prolog.
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
....

Notice that I also got an error 'Content is not allowed in prolog'. Is it because the program trying to parse illegal xml string?

One more thing, In standalone app, I use crimson as a parser, but tomcat uses xerces. I tested more by adding xerces lib to my standalone app and I got the same error as I got from tomcat.
It seems like xerces is the real problem. How do I solve this problem?
I'm not sure that I can remove xerces lib from my web app.

P.S. I've tried using crimson instead of xerces by setting these system properties

<system-property javax.xml.parsers.DocumentBuilderFactory=
"org.apache.crimson.jaxp.DocumentBuilderFactoryImpl"/>
<system-property javax.xml.parsers.SAXParserFactory=
"org.apache.crimson.jaxp.SAXParserFactoryImpl""/>

but it led me to another error

java.lang.IllegalStateException: can't declare any more prefixes in this context
at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:691)
at org.apache.crimson.parser.Parser2.parse(Parser2.java:337)
at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
at org.apache.crimson.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:185)
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:534)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Axis client calling .NET Web service
 
Similar Threads
Migration issue from Jrun 3.0 to Jrun 4.0
IllegalStateException while parsing xml in WAS6
parser error on WAS6
Exception in thread main
can anyone tell me why this exception occured..