1

我已经发布了一个 api,然后在它的环境中为该 api 订阅了一个应用程序。我已经生成了访问令牌。

我尝试使用邮递员通过 wso2 api gw 访问我的 api:

GET /api/1/lineas/1234567890/suscripcion/ultima-recarga HTTP/1.1
Host: localhost:8280
Authorization: Bearer a9a9417c18fd86715abba29812c591
Cache-Control: no-cache

并且该请求从未响应,在日志中我可以看到以下异常,您能否给我提示一下此异常的含义以及我应该如何尝试成功调用我的 api?

[2015-02-06 10:51:05,693]  INFO - LogMediator To: /api/1/lineas/1234567890/suscripcion/ultima-recarga, MessageID: urn:uuid:6ab1d8e6-8562-40f9-b09e-b5c760bd0f4a, Direction: request, IN_MESSAGE = IN_MESSAGE, Envelope: <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body/></soapenv:Envelope>
[2015-02-06 10:51:07,244]  INFO - EndpointContext Endpoint : admin--CRM_api_APIsandboxEndpoint_0 currently SUSPENDED will now be marked active since it processed its last message
[2015-02-06 10:51:07,265] ERROR - SequenceMediator Error while building message
org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxParsingException: Unexpected close tag </body>; expected </HR>.
 at [row,col {unknown-source}]: [1,1115]
        at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:296)
        at org.apache.axiom.om.impl.llom.OMSerializableImpl.build(OMSerializableImpl.java:78)
        at org.apache.axiom.om.impl.llom.OMElementImpl.build(OMElementImpl.java:722)
        at org.apache.axiom.om.impl.llom.OMElementImpl.detach(OMElementImpl.java:700)
        at org.apache.axiom.om.impl.llom.OMNodeImpl.setParent(OMNodeImpl.java:105)
        at org.apache.axiom.om.impl.llom.OMElementImpl.addChild(OMElementImpl.java:296)
        at org.apache.axiom.om.impl.llom.OMElementImpl.addChild(OMElementImpl.java:212)
        at org.apache.axiom.soap.impl.llom.SOAPBodyImpl.addChild(SOAPBodyImpl.java:231)
        at org.apache.axis2.transport.TransportUtils.createSOAPEnvelope(TransportUtils.java:161)
        at org.apache.synapse.transport.passthru.util.RelayUtils.builldMessage(RelayUtils.java:114)
        at org.apache.synapse.transport.passthru.util.RelayUtils.buildMessage(RelayUtils.java:82)
        at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:68)
        at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:47)
        at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:131)
        at org.wso2.carbon.apimgt.gateway.handlers.ext.APIManagerExtensionHandler.mediate(APIManagerExtensionHandler.java:65)
        at org.wso2.carbon.apimgt.gateway.handlers.ext.APIManagerExtensionHandler.handleResponse(APIManagerExtensionHandler.java:195)
        at org.apache.synapse.rest.API.process(API.java:282)
        at org.apache.synapse.rest.RESTRequestHandler.dispatchToAPI(RESTRequestHandler.java:83)
        at org.apache.synapse.rest.RESTRequestHandler.process(RESTRequestHandler.java:51)
        at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:220)
        at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:492)
        at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:170)
        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
        at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:228)
        at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)
Caused by: com.ctc.wstx.exc.WstxParsingException: Unexpected close tag </body>; expected </HR>.
 at [row,col {unknown-source}]: [1,1115]
        at com.ctc.wstx.sr.StreamScanner.constructWfcException(StreamScanner.java:606)
        at com.ctc.wstx.sr.StreamScanner.throwParseError(StreamScanner.java:479)
        at com.ctc.wstx.sr.StreamScanner.throwParseError(StreamScanner.java:464)
        at com.ctc.wstx.sr.BasicStreamReader.reportWrongEndElem(BasicStreamReader.java:3283)
        at com.ctc.wstx.sr.BasicStreamReader.readEndElem(BasicStreamReader.java:3210)
        at com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java:2829)
        at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1072)
        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.om.impl.builder.StAXOMBuilder.parserNext(StAXOMBuilder.java:681)
        at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:214)
        ... 27 more
[2015-02-06 10:51:07,475] ERROR - SequenceMediator Error while building message
org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxParsingException: Unexpected close tag </body>; expected </HR>.
 at [row,col {unknown-source}]: [1,1115]
        at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:296)
        at org.apache.axiom.om.impl.llom.OMSerializableImpl.build(OMSerializableImpl.java:78)
        at org.apache.axiom.om.impl.llom.OMElementImpl.build(OMElementImpl.java:722)
        at org.apache.axiom.om.impl.llom.OMElementImpl.detach(OMElementImpl.java:700)
        at org.apache.axiom.om.impl.llom.OMNodeImpl.setParent(OMNodeImpl.java:105)
        at org.apache.axiom.om.impl.llom.OMElementImpl.addChild(OMElementImpl.java:296)
        at org.apache.axiom.om.impl.llom.OMElementImpl.addChild(OMElementImpl.java:212)
        at org.apache.axiom.soap.impl.llom.SOAPBodyImpl.addChild(SOAPBodyImpl.java:231)
        at org.apache.axis2.transport.TransportUtils.createSOAPEnvelope(TransportUtils.java:161)
        at org.apache.synapse.transport.passthru.util.RelayUtils.builldMessage(RelayUtils.java:114)
        at org.apache.synapse.transport.passthru.util.RelayUtils.buildMessage(RelayUtils.java:82)
        at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:68)
        at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:47)
        at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:131)
        at org.apache.synapse.mediators.MediatorFaultHandler.onFault(MediatorFaultHandler.java:85)
        at org.apache.synapse.FaultHandler.handleFault(FaultHandler.java:102)
        at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:497)
        at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:170)
        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
        at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:228)
        at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)
Caused by: com.ctc.wstx.exc.WstxParsingException: Unexpected close tag </body>; expected </HR>.
 at [row,col {unknown-source}]: [1,1115]
        at com.ctc.wstx.sr.StreamScanner.constructWfcException(StreamScanner.java:606)
        at com.ctc.wstx.sr.StreamScanner.throwParseError(StreamScanner.java:479)
        at com.ctc.wstx.sr.StreamScanner.throwParseError(StreamScanner.java:464)
        at com.ctc.wstx.sr.BasicStreamReader.reportWrongEndElem(BasicStreamReader.java:3283)
        at com.ctc.wstx.sr.BasicStreamReader.readEndElem(BasicStreamReader.java:3210)
        at com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java:2829)
        at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1072)
        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.om.impl.builder.StAXOMBuilder.parserNext(StAXOMBuilder.java:681)
        at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:214)
        ... 23 more
[2015-02-06 10:51:07,492] ERROR - NativeWorkerPool Uncaught exception
java.lang.RuntimeException: org.apache.synapse.SynapseException: Error while building message
        at org.apache.synapse.FaultHandler.handleFault(FaultHandler.java:110)
        at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:497)
        at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:170)
        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
        at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:228)
        at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.synapse.SynapseException: Error while building message
        at org.apache.synapse.mediators.AbstractMediator.handleException(AbstractMediator.java:313)
        at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:70)
        at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:47)
        at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:131)
        at org.apache.synapse.mediators.MediatorFaultHandler.onFault(MediatorFaultHandler.java:85)
        at org.apache.synapse.FaultHandler.handleFault(FaultHandler.java:102)
        ... 8 more
Caused by: org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxParsingException: Unexpected close tag </body>; expected </HR>.
 at [row,col {unknown-source}]: [1,1115]
        at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:296)
        at org.apache.axiom.om.impl.llom.OMSerializableImpl.build(OMSerializableImpl.java:78)
        at org.apache.axiom.om.impl.llom.OMElementImpl.build(OMElementImpl.java:722)
        at org.apache.axiom.om.impl.llom.OMElementImpl.detach(OMElementImpl.java:700)
        at org.apache.axiom.om.impl.llom.OMNodeImpl.setParent(OMNodeImpl.java:105)
        at org.apache.axiom.om.impl.llom.OMElementImpl.addChild(OMElementImpl.java:296)
        at org.apache.axiom.om.impl.llom.OMElementImpl.addChild(OMElementImpl.java:212)
        at org.apache.axiom.soap.impl.llom.SOAPBodyImpl.addChild(SOAPBodyImpl.java:231)
        at org.apache.axis2.transport.TransportUtils.createSOAPEnvelope(TransportUtils.java:161)
        at org.apache.synapse.transport.passthru.util.RelayUtils.builldMessage(RelayUtils.java:114)
        at org.apache.synapse.transport.passthru.util.RelayUtils.buildMessage(RelayUtils.java:82)
        at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:68)
        ... 12 more
Caused by: com.ctc.wstx.exc.WstxParsingException: Unexpected close tag </body>; expected </HR>.
 at [row,col {unknown-source}]: [1,1115]
        at com.ctc.wstx.sr.StreamScanner.constructWfcException(StreamScanner.java:606)
        at com.ctc.wstx.sr.StreamScanner.throwParseError(StreamScanner.java:479)
        at com.ctc.wstx.sr.StreamScanner.throwParseError(StreamScanner.java:464)
        at com.ctc.wstx.sr.BasicStreamReader.reportWrongEndElem(BasicStreamReader.java:3283)
        at com.ctc.wstx.sr.BasicStreamReader.readEndElem(BasicStreamReader.java:3210)
        at com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java:2829)
        at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1072)
        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.om.impl.builder.StAXOMBuilder.parserNext(StAXOMBuilder.java:681)
        at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:214)
        ... 23 more

谢谢

4

1 回答 1

0

根据错误消息,您的请求正文似乎已损坏。请检查请求正文中的 <HR> 标签是否关闭(</HR>)。

于 2015-02-09T03:56:15.667 回答