XmlStreamException - 得到的字符[0]是一个有效的XML字符

时间:2014-08-07 23:41:59

标签: web-services rest soap axis2 axiom

我在调用Web服务时看到一种奇怪的行为。执行此行后,我成功获得了响应 -

 OMElement result = client.sendReceive(payload);

现在如果我将鼠标悬停并检查结果是一个OMElement,那么一切顺利,以下代码成功执行 -

System.out.println(result.toString);

但是,如果不检查OMElement结果变量,我会得到以下异常 -

Caused by: javax.xml.stream.XMLStreamException: Error at line:2 col:4000  Got character[0] expected a valid XML character
    at weblogic.xml.stax.XMLStreamReaderBase.advance(XMLStreamReaderBase.java:206)
    at weblogic.xml.stax.XMLStreamReaderBase.next(XMLStreamReaderBase.java:237)
    at org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.next(XMLStreamReaderWrapper.java:225)
    at org.apache.axiom.util.stax.dialect.DisallowDoctypeDeclStreamReaderWrapper.next(DisallowDoctypeDeclStreamReaderWrapper.java:34)
    at org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.next(XMLStreamReaderWrapper.java:225)
    at org.apache.axiom.util.stax.dialect.BEAStreamReaderWrapper.next(BEAStreamReaderWrapper.java:80)
    at org.apache.axiom.om.impl.builder.StAXOMBuilder.parserNext(StAXOMBuilder.java:668)
    at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:214)
    at org.apache.axiom.om.impl.llom.OMElementImpl.buildNext(OMElementImpl.java:709)
    at org.apache.axiom.om.impl.llom.OMNodeImpl.getNextOMSibling(OMNodeImpl.java:121)
    at org.apache.axiom.om.impl.traverse.OMChildrenIterator.getNextNode(OMChildrenIterator.java:36)
    at org.apache.axiom.om.impl.traverse.OMAbstractIterator.hasNext(OMAbstractIterator.java:69)
    at org.apache.axiom.om.impl.util.OMSerializerUtil.serializeChildren(OMSerializerUtil.java:555)
    at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:846)
    at org.apache.axiom.om.impl.util.OMSerializerUtil.serializeChildren(OMSerializerUtil.java:556)
    at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:846)
    at org.apache.axiom.om.impl.util.OMSerializerUtil.serializeChildren(OMSerializerUtil.java:556)
    at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:846)
    at org.apache.axiom.om.impl.util.OMSerializerUtil.serializeChildren(OMSerializerUtil.java:556)
    at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:846)
    at org.apache.axiom.om.impl.llom.OMSerializableImpl.serialize(OMSerializableImpl.java:120)
    at org.apache.axiom.om.impl.llom.OMSerializableImpl.serialize(OMSerializableImpl.java:108)
    at org.apache.axiom.om.impl.llom.OMElementImpl.toString(OMElementImpl.java:957)
    at com.thehartford.pi.opc.serviceproxy.policyinquiry.impl.PolicyInquiryServiceProxyImpl.parseResponse(PolicyInquiryServiceProxyImpl.java:134)
    ... 76 more
Caused by: Error at line:2 col:4000  Got character[0] expected a valid XML character
    at weblogic.xml.babel.scanner.ScannerState.checkedRead(ScannerState.java:628)
    at weblogic.xml.babel.scanner.CharData.read(CharData.java:65)
    at weblogic.xml.babel.scanner.Scanner.startState(Scanner.java:296)
    at weblogic.xml.babel.scanner.Scanner.scan(Scanner.java:178)
    at weblogic.xml.babel.baseparser.BaseParser.accept(BaseParser.java:533)
    at weblogic.xml.babel.baseparser.BaseParser.accept(BaseParser.java:510)
    at weblogic.xml.babel.baseparser.EndElement.parse(EndElement.java:34)
    at weblogic.xml.babel.baseparser.BaseParser.parseElement(BaseParser.java:457)
    at weblogic.xml.babel.baseparser.BaseParser.parseSome(BaseParser.java:326)
    at weblogic.xml.stax.XMLStreamReaderBase.advance(XMLStreamReaderBase.java:195)

有人可以给我一些关于问题所在的领导吗?

0 个答案:

没有答案