2

我正在向代理服务发送一个发布请求,但它给出了错误......我该如何解决这个问题

[2012-06-15 12:24:27,656]  INFO - BuilderUtil OMException in getSOAPBuilder
org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
 at [row,col {unknown-source}]: [1,0]
    at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:296)
    at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:204)
    at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:154)
    at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:140)
    at org.apache.axis2.builder.BuilderUtil.getSOAPBuilder(BuilderUtil.java:688)
    at org.apache.axis2.transport.TransportUtils.createDocumentElement(TransportUtils.java:197)
    at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:145)
    at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:167)
    at org.apache.synapse.transport.nhttp.ServerWorker.processEntityEnclosingMethod(ServerWorker.java:409)
    at org.apache.synapse.transport.nhttp.ServerWorker.run(ServerWorker.java:261)
    at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:173)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
 at [row,col {unknown-source}]: [1,0]
    at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:686)
    at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2134)
    at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2040)
    at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)
    at org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.next(XMLStreamReaderWrapper.java:225)
    at org.apache.axiom.om.impl.builder.StAXOMBuilder.parserNext(StAXOMBuilder.java:681)
    at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:214)
    ... 13 more
[2012-06-15 12:24:27,675]  INFO - BuilderUtil Remaining input stream :[]
[2012-06-15 12:24:27,675] ERROR - ServerWorker Error processing POST request 
org.apache.axis2.AxisFault: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
 at [row,col {unknown-source}]: [1,0]
    at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
    at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:180)
    at org.apache.synapse.transport.nhttp.ServerWorker.processEntityEnclosingMethod(ServerWorker.java:409)
    at org.apache.synapse.transport.nhttp.ServerWorker.run(ServerWorker.java:261)
    at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:173)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
Caused by: org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
 at [row,col {unknown-source}]: [1,0]
    at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:296)
    at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:204)
    at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:154)
    at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:140)
    at org.apache.axis2.builder.BuilderUtil.getSOAPBuilder(BuilderUtil.java:688)
    at org.apache.axis2.transport.TransportUtils.createDocumentElement(TransportUtils.java:197)
    at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:145)
    at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:167)
    ... 6 more
Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
 at [row,col {unknown-source}]: [1,0]
    at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:686)
    at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2134)
    at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2040)
    at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)
    at org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.next(XMLStreamReaderWrapper.java:225)
    at org.apache.axiom.om.impl.builder.StAXOMBuilder.parserNext(StAXOMBuilder.java:681)
    at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:214)
    ... 13 more

我的代理形象是:

<proxy name="stripe" transports="https http" startOnLoad="true" trace="disable">
        <target>
            <endpoint>
                <address uri="https://api.stripe.com/v1"/>
            </endpoint>
            <inSequence>
                <log level="full" separator="SSSSSSSSSSSSSSSSSs">
                    <property name="HTTP_METHOD" value="post"/>
                </log>
                <send/>
            </inSequence>
            <outSequence>
                <log level="full" separator=", ooooooooooo"/>
                <send/>
            </outSequence>
        </target>
    </proxy>

curl命令执行请求:

curl https://localhost:8243/services/stripe/charges/ch_iQs4noWTm7J5Kk/refund  -u Ixj3FHIiQSFWrzb4VNSxoThKVk3IXpBF --insecure -X POST

我没有得到 dis 错误的确切原因

4

2 回答 2

0

POST 请求的内容类型是什么。当您没有使用的内容类型的消息格式器和构建器时,会发生此错误。

于 2012-06-15T14:52:40.140 回答
0

我在这个错误上花了 7 天时间。这个错误有很多不同的答案。

当您的 Web 服务返回到 wso 代理空正文或不正确的内容长度或其他东西(有很多事情)时,就会发生这种情况。

但在我的情况下,问题是如果内容长度等于 0,我的路由“/”(POST 方法)上的 web 服务返回 400 代码。我认为 wso2 代理首先会向我的 web 服务发送一些内容长度为零的数据或没有这个标头和我的网络服务只是“阻止”它并返回 400 代码。

于 2020-09-02T06:38:27.493 回答