WSO2数据服务服务器错误不兼容\u参数\u错误
我正在使用WSO2 ESB和DSS,我已经设置了一个DSS服务,并对此进行了测试,它使用以下URL工作WSO2数据服务服务器错误不兼容\u参数\u错误,wso2,wso2esb,wso2dss,Wso2,Wso2esb,Wso2dss,我正在使用WSO2 ESB和DSS,我已经设置了一个DSS服务,并对此进行了测试,它使用以下URL工作 http://10.248.40.85:9764/services/params/op/{Value goes here} 我的问题是,当从ESB调用它时,它不工作,并抛出不兼容的参数错误。它的调用方式如下 <log level="custom"> <property name="uri.var.ID" expression="$body/int:User/int:
http://10.248.40.85:9764/services/params/op/{Value goes here}
我的问题是,当从ESB调用它时,它不工作,并抛出不兼容的参数错误。它的调用方式如下
<log level="custom">
<property name="uri.var.ID" expression="$body/int:User/int:UserID/text()"/>
</log>
<send>
<endpoint>
<http method="get" uri-template="http://10.248.40.85:9764/services/params/op/{uri.var.ID}"/>
</endpoint>
</send>
当记录uri.var.ID时,它返回预期的数字,但当服务尝试调用端点时,它抛出错误并表示当前参数为空
DSS服务资源是
<resource method="GET" path="op/{ID}">
<call-query href="query2">
<with-param name="ID" query-param="ID"/>
</call-query>
</resource>
由于各种原因,可能会出现此问题。所以清单如下
问题应该是您已经在日志中介中定义了属性
uri.var.ID
。在外部定义并检查。使用以下方法解决了问题
<payloadFactory media-type="xml">
<format>
<p:operation2 xmlns:p="http://ws.wso2.org/dataservice">
<xs:ID xmlns:xs="http://ws.wso2.org/dataservice">$1</xs:ID>
</p:operation2>
</format>
<args>
<arg xmlns:xs="http://ws.wso2.org/dataservice" xmlns:ns="http://org.apache.synapse/xsd" evaluator="xml" expression="get-property('uri.var.ID')"/>
</args>
</payloadFactory>
<call>
<endpoint>
<address uri="http://10.248.40.85:9764/services/params/operation2"/>
</endpoint>
</call>
$1
最新版本的DSS支持查询参数列表中的默认参数值。
请尝试在数据服务(dbs)文件的查询参数列表中添加defaultValue=“#{NULL}”
-------------这里是SQL查询-----
我在日志中介器外部使用属性uri.var.ID尝试了它,但仍然不起作用。
<query id="QUERY-ID" useConfig="DATA-SOURCE-ID">
<sql>-------------SQL QUERY HERE -----</sql>
<result ----------- >
<element ------------ />
</result>
<param defaultValue="#{NULL}" name="PARAM-NAME" ordinal="1" sqlType="INTEGER"/>
</query>