WSO2 ESB - 使用Script mediator的XML到JSON

时间:2016-08-22 02:36:07

标签: javascript json xml wso2

我使用WSO2 ESB和DDS制作API并最终获得此响应。如何通过使用脚本介体进行一些编辑来处理从XML到JSON的响应?

MainActivity.mDashboardFragment.setTopSellersListView(mProductAdapter);

我想要像这样的结果

<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelopexmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body> <employeeCollection xmlns="http://employee.us.wso2.com"> <employee> <EmployeeID>17</EmployeeID> <FirstName>jak</FirstName> <LastName>123</LastName> <Team>ok</Team> </employee> <employee> <EmployeeID>18</EmployeeID> <FirstName>jak</FirstName> <LastName>123</LastName> <Team>ok</Team> </employee> <employee> <EmployeeID>19</EmployeeID> <FirstName>jak</FirstName> <LastName>123</LastName> <Team>ok</Team> </employee> </employeeCollection>