0

我正在尝试通过 wso2 esb 序列从 wso2 数据服务中获取一些数据,如下所示

<sequence xmlns="http://ws.apache.org/ns/synapse" name="ConcurGetSAEExtractFlow">
   <log level="custom">
      <property name="Debugging" value="ConcurGetSAEExtractFlow" />
   </log>
   <xslt key="GetConcurSAE_Extract_Transformation" />
   <property name="post-data-service-sequence" value="ConcurTransformSAEExtractFlow" />
   <property name="OUT_ONLY" value="false" />
   <send receive="DataServiceInvocationErrorFlow">
      <endpoint key="ConcurDataServiceEndpoint" />
   </send>
   <description />
</sequence>

xslt 转换 GetConcurSAE_Extract_Transformation 如下

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dat="http://ws.wso2.org/dataservice" xmlns:fn="http://www.w3.org/2005/02/xpath-functions" version="1.0">
    <xsl:template match="/">
        <xsl:element name="dat:GetConcurSAEExtract">            
        </xsl:element>
    </xsl:template>
</xsl:stylesheet>

正如所见,没有提供服务的输入映射,并且提供了输出映射。我已经在 wso2 dss "try this service" 中测试了该服务,它运行良好。但是,当我尝试通过代理通过 wso2 esb 运行它时,我收到以下错误块

TID: [] [WSO2 ESB] [2013-01-25 01:26:24,244]  INFO {org.apache.synapse.mediators.builtin.LogMediator} -  Debugging = ConcurGetSAEExtractFlow {org.apache.synapse.mediators.builtin.LogMediator}
TID: [] [WSO2 ESB] [2013-01-25 01:26:24,252]  WARN {org.apache.synapse.transport.nhttp.ClientHandler} -  Received an internal server error : Internal Server Error For : 10.12.46.5:9764 For Request : Axis2Request [Message ID : urn:uuid:2b34a4c3-796e-410b-aa62-47f28f88f8b7] [Status Completed : true] [Status SendingCompleted : true] {org.apache.synapse.transport.nhttp.ClientHandler}
TID: [] [WSO2 ESB] [2013-01-25 01:26:24,253]  INFO {org.apache.axis2.builder.BuilderUtil} -  OMException in getSOAPBuilder {org.apache.axis2.builder.BuilderUtil}
org.apache.axiom.soap.SOAPProcessingException: First Element must contain the local name, Envelope , but found html
        at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.constructNode(StAXSOAPModelBuilder.java:305)
        at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createOMElement(StAXSOAPModelBuilder.java:252)
        at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createNextOMElement(StAXSOAPModelBuilder.java:234)
        at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:249)
        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:728)
        at org.apache.axis2.transport.TransportUtils.createDocumentElement(TransportUtils.java:197)
        at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:145)
        at org.apache.synapse.transport.nhttp.ClientWorker.run(ClientWorker.java:223)
        at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
        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)
TID: [] [WSO2 ESB] [2013-01-25 01:26:24,254]  INFO {org.apache.axis2.builder.BuilderUtil} -  Remaining input stream :[] {org.apache.axis2.builder.BuilderUtil}
TID: [] [WSO2 ESB] [2013-01-25 01:26:24,254]  WARN {org.apache.synapse.transport.nhttp.ClientWorker} -  Unexpected response received. HTTP response code : 500 HTTP status : Internal Server Error exception : First Element must contain the local name, Envelope , but found html {org.apache.synapse.transport.nhttp.ClientWorker}
TID: [] [WSO2 ESB] [2013-01-25 01:26:24,273]  INFO {org.apache.synapse.mediators.builtin.LogMediator} -  status = success response from DSS {org.apache.synapse.mediators.builtin.LogMediator}

我无法找出导致这种错误的问题所在。请如果有人对此有任何想法。

4

1 回答 1

0

您没有使用 XSLT 复制肥皂信封和标题。<log level="full"/>在你的调用之前和之后做一次<xslt>,然后你会看到你的 XSLT 也会得到一个<soap:envelope><soap:body>...

所以你也必须把它放在输出中。

伪代码:

<xsl:template match="envelope|body">
    <xsl:copy>
        <xsl:apply-templates/>
    </xsl:copy/>
</xsl:template>
于 2013-01-28T20:50:31.850 回答