从wso2 esb序列调用wso2数据服务时出错

时间:2013-01-25 11:44:54

标签: wso2esb

我试图通过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“尝试此服务”中测试了该服务,它运行良好。 但是当我试图通过代理运行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}

我无法找出导致此类错误的错误。如果有人对此有所了解。

1 个答案:

答案 0 :(得分:0)

您没有使用XSLT复制soap信封和标题。在<log level="full"/>来电之前和之后进行一次<xslt>,然后您会看到您的XSLT也会获得<soap:envelope><soap:body>...

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

伪代码:

<xsl:template match="envelope|body">
    <xsl:copy>
        <xsl:apply-templates/>
    </xsl:copy/>
</xsl:template>