Byte Order Mark (BOM) .NET/Java problem
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Pedro_Sousa
Posted On:   Tuesday, June 3, 2003 08:03 AM

Hi, I'm using Axis for consuming .Net Web Services. I'm having trouble while invoking a method from the Service. When i invoke this method the .NET gets the request, processes it, and sends a response. This SOAP response is well formed and is coming in a UTF-8 encoding. The exception i'm getting is "Root Element is Missing". I've debug the process and the problem is that the string containing the Soap Response that is being parsed by class Parser2 (crimson parser i believe) is getting the first char of the string (in.peekc(' <')) to look for the <?xml header of the xml response. The problem is that the first char in the string is like ''. I assume this first char is the BOM charact   More>>

Hi,

I'm using Axis for consuming .Net Web Services. I'm having trouble while invoking a method from the Service. When i invoke this method the .NET gets the request, processes it, and sends a response. This SOAP response is well formed and is coming in a UTF-8 encoding.

The exception i'm getting is "Root Element is Missing".

I've debug the process and the problem is that the string containing the Soap Response that is being parsed by class Parser2 (crimson parser i believe) is getting the first char of the string (in.peekc(' <')) to look for the <?xml header of the xml response. The problem is that the first char in the string is like ''. I assume this first char is the BOM character, that is suppose to send in and UTF-8 encoding.

Can someone help me with this ?

If this is a parser error how can i put Axis using another parser that suports this BOM ?



Pedro Sousa

   <<Less

Re: Byte Order Mark (BOM) .NET/Java problem

Posted By:   Stijn_Fonck  
Posted On:   Tuesday, June 3, 2003 01:56 PM

If axis is implemented using JAXP, the only thing you habe to do is remove crimson from your classpath and adding another jar containing another jaxp-compliant parser, maybe try xerces, to your classpath. If you have already more than one xml parser inside your classpath you can indicate the one you want with setting java.xml.parsers.SaxParserFactory and java.xml.parsers.DocumentBuilderFcatory to the rigth values, have a look e.g. inside the xerces jar, you will find inside the META-INF subdirectory of the jar a subdir services were these 2 values are specified!
About | Sitemap | Contact