I'm using WSO2 Enterprise Integrator 6.5.0 's DataService ,
I want to input nested parameters, i did not find any tutorials about that, it is my input :
{
"getBankCodes": {
"SOURCE" : "12",
"FUNCTION": "james",
"REQUESTER" : "bond",
"SECURITYCODE" : "bond@gmail.com"
}
}
Desired input is :
{
"source" : "123",
"userId" : "test",
"Request": {
"SOURCE" : "12",
"FUNCTION": "james",
"REQUESTER" : "bond",
"SECURITYCODE" : "bond@gmail.com"
}
}
Source code :
<query id="getBankCodes" useConfig="Datasource">
<sql>Select BankCode, BankName From XAC_BANKCODES Where Substr(BankCode, Length(BankCode) - 3) = '0000'</sql>
<result outputType="json"> 
 
 { "Response":
 {"Banks":[
 { 
 "Details": {
 "BankCode":"$BankCode",
 "BankName":"$BankName"
 }
 } 
 ]
 } 
}</result>
<param name="SOURCE" ordinal="1" sqlType="STRING"/>
<param name="FUNCTION" ordinal="1" sqlType="STRING"/>
<param name="REQUESTER" ordinal="1" sqlType="STRING"/>
<param name="SECURITYCODE" ordinal="1" sqlType="STRING"/>
</query>
<operation name="getBankCode">
<call-query href="getBankCodes">
<with-param name="SOURCE" query-param="SOURCE"/>
<with-param name="FUNCTION" query-param="FUNCTION"/>
<with-param name="REQUESTER" query-param="REQUESTER"/>
<with-param name="SECURITYCODE" query-param="SECURITYCODE"/>
</call-query>
</operation>
<resource method="POST" path="/getBankCodes">
<call-query href="getBankCodes">
<with-param name="SOURCE" query-param="SOURCE"/>
<with-param name="FUNCTION" query-param="FUNCTION"/>
<with-param name="REQUESTER" query-param="REQUESTER"/>
<with-param name="SECURITYCODE" query-param="SECURITYCODE"/>
</call-query>
</resource>
Please refer below questions
Regards,
Thanks
How to send grouped complex nested input parameters Extracting the corresponding parameter is a mediation logic. Therefore, you have to write a proxy service/API in EI to extract inner param set from the request and call the dataservice.
How to get input parameters as response(return What i sent as input) on this situation. You can do the same when you are writing a mediation logic.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.