gpt4 book ai didi

wso2 - RelayUtils 在 wso2esb 中构建 Passthrough 流时出错

转载 作者:行者123 更新时间:2023-12-02 18:24:19 26 4
gpt4 key购买 nike

我正在使用 wso2esb 4.7.0 和 wso2dss 3.0.0..我在 wso2dss 中编写了一个查询。它在 dss 中工作正常。另外,当我希望在序列中介器中使用 wso2esb 时,它会显示错误,如上所述

 ERROR - RelayUtils Error while building Passthrough stream
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.om.impl.AbstractOMMetaFactory.createStAXSOAPModelBuilder(AbstractOMMetaFactory.java:73)
at org.apache.axiom.om.impl.AbstractOMMetaFactory.createSOAPModelBuilder(AbstractOMMetaFactory.java:79)
at org.apache.axiom.om.OMXMLBuilderFactory.createSOAPModelBuilder(OMXMLBuilderFactory.java:196)
at org.apache.axis2.builder.SOAPBuilder.processDocument(SOAPBuilder.java:55)
at org.apache.synapse.transport.passthru.util.DeferredMessageBuilder.getDocument(DeferredMessageBuilder.java:118)
at org.apache.synapse.transport.passthru.util.RelayUtils.builldMessage(RelayUtils.java:116)
at org.apache.synapse.transport.passthru.util.RelayUtils.buildMessage(RelayUtils.java:91)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:62)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:114)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:232)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:443)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:166)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:222)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:679)
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:677)
at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2116)
at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2022)
at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1114)
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.om.impl.builder.StAXOMBuilder.parserNext(StAXOMBuilder.java:681)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:214)
... 20 more

.
.

我的代理服务是:

<inSequence>
<property name="messageType" value="application/json" scope="axis2"/>
<property name="username"
expression="//username/text()"
scope="default"
type="STRING"/>
<property name="userid"
expression="//userid/text()"
scope="default"
type="STRING"/>
<log>
<property name="username" expression="get-property('username')"/>
<property name="userid" expression="get-property('userid')"/>
</log>
<payloadFactory media-type="xml">
<format>
<p:trail_op xmlns:p="http://ws.wso2.org/dataservice">
<p:username>$1</p:username>
<p:userid>$2</p:userid>
</p:trail_op>
</format>
<args>
<arg evaluator="xml" expression="get-property('username')"/>
<arg evaluator="xml" expression="get-property('userid')"/>
</args>
</payloadFactory>
<header name="Action" value=""/>
<property name="SOAPAction" value="" scope="transport"/>
<send receive="Capp_Login_seq1">
<endpoint>
<address uri="http://192.168.1.23:9764/services/Capp_muser_dataservice/"
format="soap12"/>
</endpoint>
</send>
<log level="full"/>
</inSequence>
<outSequence>
<send/>
</outSequence>

顺序是:

 <sequence xmlns="http://ws.apache.org/ns/synapse" name="Capp_Login_seq1">
<property name="messageType" value="application/json" scope="axis2"/>
<property xmlns:ns="http://org.apache.synapse/xsd" xmlns:s="http://ws.wso2.org/dataservice" name="userid" expression="get-property('userid')" scope="default" type="STRING"/>
<log>
<property xmlns:ns="http://org.apache.synapse/xsd" name="userid" expression="get-property('userid')"/>
</log>
<send/>
</sequence>

我发送的请求如下:

curl -v -H "Accept:application/json" -H "Content-Type:application/json"  -d '{"username":"Harry","userid":"347367127872701992"}' http://youtility-desktop:8282/services/Capp_LoginProxy

我应该如何修复这个错误?请告诉我..

最佳答案

我在 ESB 5 和 DAS 3 中遇到了同样的问题。可以通过在位于 esb/repository/conf/axis2.xml 的 axis2.xml 中添加相关的 messageFormatters 和 messageBuilders 来解决该问题

在我的场景中,这两个条目已添加到 axis2.xml

messageFormatter contentType="text/html" 类=“org.wso2.carbon.relay.ExpandingMessageFormatter”/>

messageBuilder contentType="text/html"class="org.wso2.carbon.relay.BinaryRelayBuilder"/>

 

关于wso2 - RelayUtils 在 wso2esb 中构建 Passthrough 流时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23009792/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com