【问题标题】:While i am inserting some records in mongodb proper response is not coming from wso2esb当我在 mongodb 中插入一些记录时,正确的响应不是来自 wso2esb
【发布时间】:2013-10-24 18:25:21
【问题描述】:

没有来自 wso2esb 的正确响应 下面是我的代理服务。

<?xml version="1.0" encoding="UTF-8"?>
    <proxy xmlns="http://ws.apache.org/ns/synapse"
           name="Gettreadings"
           transports="https http"
           startOnLoad="true"
           trace="disable">
       <description/>
       <target>
          <inSequence onError="fault">
             <property name="CONTENT_TYPE"
                       value="application/json"
                       scope="axis2"
                       type="STRING"/>
             <property name="HTTP_METHOD" value="POST" scope="axis2" type="STRING"/>
             <payloadFactory>
                <format>
                   <body:mongo_find xmlns:body="http://ws.wso2.org/dataservice"/>
                </format>
             </payloadFactory>
             <send>
                <endpoint>
                   <address uri="http://localhost:9764/services/Mongotreadings/" format="soap11"/>
                </endpoint>
             </send>
             <property name="ERROR_MESSAGE"
                       expression="get-property('ERROR_MESSAGE')"
                       scope="axis2"
                       type="STRING"/>
             <property name="ERROR_CODE"
                       expression="get-property('ERROR_CODE')"
                       scope="axis2"
                       type="STRING"/>
             <property name="FORCE_ERROR_ON_SOAP_FAULT"
                       value="true"
                       scope="default"
                       type="STRING"/>
             <log level="full"/>
          </inSequence>
          <outSequence>
             <property name="CONTENT_TYPE"
                       value="application/json"
                       scope="axis2"
                       type="STRING"/>
             <log level="full"/>
             <send/>
          </outSequence>
       </target>
    </proxy>

我的 mongodb 中有两条记录。你能指导我它是否支持 mongodb。为什么它在输出中给出反斜杠,我没有得到任何东西。 当我运行 curl 命令时,响应看起来像这样

{"Body":{"Datalist":["{ \"_id\" : { \"$oid\" : \"51cad951949c798d7d84de49\"} , \"readingsid\" : -1.0 , \"actiondetailid\" : -1.0 , \"slno\" : 1.0 , \"parameterid\" : -1.0 , \"inputvalue\" : 1.0 , \"inputtext\" : \"NONE\" , \"finalvalue\" : 1.0}","{ \"_id\" : { \"$oid\" : \"51cbcba2998f11db765f3960\"} , \"readingsid\" : -2.14748362E9 , \"actiondetailid\" : -2.14748362E9 , \"slno\" : \"1\" , \"parameterid\" : -1.0 , \"inputvalue\" : 10.0 , \"inputtext\" : \"Test Value\" , \"finalvalue\" : 5.0}"]}}

【问题讨论】:

    标签: mongodb wso2 wso2esb wso2dss


    【解决方案1】:

    在 outsequence 中使用 &lt;property name="messageType" value="application/json" scope="axis2"/&gt;,因此,它将选择正确的 messageFormatter。

    【讨论】:

    • hai ratha,我按照您的指导按顺序应用 然后它也显示与上述相同的输出没有变化。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-03-05
    • 1970-01-01
    • 1970-01-01
    • 2021-09-03
    • 1970-01-01
    • 1970-01-01
    • 2015-03-20
    相关资源
    最近更新 更多