我对这个问题做了一些研究,但似乎所有其他答案都包括更改响应发送给您的方式。我正在调用以 xml 字符串返回的第三方 Web 服务。当我在本地 Win7 机器上执行此操作时,效果很好。但是当我把它放到我们的服务器 Win Server 2003 上时,我得到这个错误返回:
Error 500: Executing action [vinlookup] of controller [AutoVehicleController] caused exception: null
Servlet: grails
URI: /NonProfits/grails/autoVehicle/vinlookup.dispatch
Exception Message: An invalid XML character (Unicode: 0x5c) was found in the public identifier.
Caused by: An invalid XML character (Unicode: 0x5c) was found in the public identifier.
Class: AutoVehicleController
At Line: [172]
Code Snippet:
Stack Trace
org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x5c) was found in the public identifier.
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at VinPowerService.decodeVin(VinPowerService.groovy:40)
at VinPowerService$$FastClassByCGLIB$$6f8d198b.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
at VinPowerService$$EnhancerByCGLIB$$f1db38bd.decodeVin(<generated>)
at VinPowerService$decodeVin.call(Unknown Source)
at AutoVehicleController$_closure7.doCall(AutoVehicleController.groovy:172)
at AutoVehicleController$_closure7.doCall(AutoVehicleController.groovy)
at java.lang.Thread.run(Thread.java:619)