org.xml.sax.SAXParseException: Content is not allowed in prolog

前端 未结 30 2346
别那么骄傲
别那么骄傲 2020-11-22 02:54

I have a Java based web service client connected to Java web service (implemented on the Axis1 framework).

I am getting following exception in my log file:

30条回答
  •  野的像风
    2020-11-22 03:45

    As Mike Sokolov has already pointed it out, one of the possible reasons is presence of some character/s (such as a whitespace) before the tag.

    If your input XML is being read as a String (as opposed to byte array) then you can use replace your input string with the below code to make sure that all 'un-necessary' characters before the xml tag are wiped off.

    inputXML=inputXML.substring(inputXML.indexOf("

    You need to be sure that the input xml starts with the xml tag though.

提交回复
热议问题