0

我有一个抛出 com.ctc.wstx.exc.WstxParsingException 的 Metro Web 服务客户端。

如果我没看错,就是说“3”是一个无效的 XML 字符。那是对的吗?什么是“扩展字符”,为什么“3”无效?

完整的堆栈跟踪:

Exception in thread "main" com.sun.xml.ws.encoding.soap.DeserializationException: Failed to read a response: javax.xml.bind.UnmarshalException
- with linked exception:
[com.ctc.wstx.exc.WstxParsingException: Illegal character entity: expansion character (code 0x3) not a valid XML character
at [row,col {unknown-source}]: [2,4154]]
        at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:124)
        at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:89)
        at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:140)
        at $Proxy34.getSubInfoByRel(Unknown Source)
        at com.my.company.client.SOAPClient.getSubscriberInfoByTN(SOAPClient.java:237)
Caused by: javax.xml.bind.UnmarshalException
- with linked exception:
[com.ctc.wstx.exc.WstxParsingException: Illegal character entity: expansion character (code 0x3) not a valid XML character
at [row,col {unknown-source}]: [2,4154]]
        at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.handleStreamException(UnmarshallerImpl.java:426)
        at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:362)
        at com.sun.xml.bind.v2.runtime.BridgeImpl.unmarshal(BridgeImpl.java:120)
        at com.sun.xml.bind.api.Bridge.unmarshal(Bridge.java:233)
        at com.sun.xml.ws.client.sei.ResponseBuilder$DocLit.readResponse(ResponseBuilder.java:547)
        at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:121)
        ... 5 more
Caused by: com.ctc.wstx.exc.WstxParsingException: Illegal character entity: expansion character (code 0x3) not a valid XML character
at [row,col {unknown-source}]: [2,4154]
        at com.ctc.wstx.sr.StreamScanner.constructWfcException(StreamScanner.java:605)
        at com.ctc.wstx.sr.StreamScanner.throwParseError(StreamScanner.java:461)
        at com.ctc.wstx.sr.StreamScanner.reportIllegalChar(StreamScanner.java:2375)
        at com.ctc.wstx.sr.StreamScanner.checkAndExpandChar(StreamScanner.java:2321)
        at com.ctc.wstx.sr.StreamScanner.resolveCharEnt(StreamScanner.java:2277)
        at com.ctc.wstx.sr.StreamScanner.fullyResolveEntity(StreamScanner.java:1468)
        at com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java:2755)
        at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1019)
        at com.sun.xml.ws.util.xml.XMLStreamReaderFilter.next(XMLStreamReaderFilter.java:92)
        at com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXStreamConnector.java:192)
        at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:360)
        ... 9 more
4

1 回答 1

0

问题是这(code 0x3)是一个 Unicode 代码点,因此是一个非法的 XML 字符。已通知数据的所有者。感谢 Woostox 邮件列表中的 Josh 的帮助。

于 2013-06-06T20:52:35.797 回答