New to WSO2 EI,
I have built an API that will give a response JSON, i want to parse and save this in Database. How can I do this.
Db is external Oracle, for which I have a JNDI built already.
~Jawa
There are multiple ways of achieving this,either you can perform entire things in ESB or you can use DSS as well.
Once you get JSON response you need to frame a query, you can use DB mediator add insert query which would then insert into DB.
Else you can create a data service in DSS and then pass this JSON, write a insert query in DSS and insert it into DB.
For DB mediator check this link
https://docs.wso2.com/display/ESB490/DB+Report+Mediator
For Data service check below link.
https://docs.wso2.com/display/DSS322/Exposing+Data+as+REST+Resources
Related
Just as the title suggests.
I want to wrap a database call in an API or REST API whichever is easiest preferable API Manager API.
How can i do this and return the data from the database in json?
You can use DSS to access the database, and then a payload factory mediator or Data Mapper to transform the response in a json.
Alternatively, you can use DSS to expose your data as a set of REST style resource.Take a look at this link for an example on how to achieve this.
i have requirement where in i have to insert multiple values from ESB 4.8.1 into Oracle Database table via WSO2 DSS.
Oracle DB table (Student) consists of below fields
1) Id
2) Name
3) Class
4) School Name
ESB will receive a SOAP request which consists of 200 student records with above fields, here range is 200 which may vary.
In ESB i will extract the 200 record values(200 student details), let say 200 insert statements.
From ESB how i can send these 200 record values to DSS in a single SOAP request, so that DSS will take care of inserting 200 records into DB.
Can DSS receive SOAP Request which contains multiple records (200 students details) and insert into DB.?
Looking forward for the necessary help
The batch requests feature allows you to send multiple (IN-Only) requests to a datasource using a single operation (batch operation)in WSO2 DSS(Data Services Server). You can get a clear picture with examples in the following link.
https://docs.wso2.com/display/DSS351/Invoking+an+Operation+with+Multiple+Records
Additionally the request box feature allows you to invoke multiple operations (consecutively) to a datasource using a single operation in WSO2 DSS. See the following link.
https://docs.wso2.com/display/DSS351/Invoking+Multiple+Operations+via+Request+Box
Now you can use these features together (ESB+DSS) in the WSO2 EI (Enterprise Integrator). Check https://docs.wso2.com/display/EI611/Data+Integration and https://docs.wso2.com/display/EI611/Upgrading+from+WSO2+Data+Services+Server
Yes, it´s possible.
In the data service configuration just add: enableBatchRequests="true".
Take a look at https://dzone.com/articles/wso2-dss-batch-insert-sample
Wso2 DSS Fetch Data From Table
Please Help
I have a table named "Address". I want to fetch the all details(all coulmns) from this table using service created through wso2 dss.
I have to get the responce in json format.
I Have tried it ,but not getting the result
pls help
You can check the wso2dss documentation on how to create a DSS and how to return a JSON message. If you face any issue, please post the error stack.
WSO2 DSS distribution comes with default RDBMS sample. you can try that too.
As told by ratha, you can try the sample & understand how it is created. or else you post your table schema and anyone can post xml of that service.
For JSON reponse you need not worry much, you just need to pass one "Accept:application/json" header while calling dss service. first try to get output from dss service.
I have setup WSO2 DSS 3.1.1 and have connected with an Oracle database. The service is setup well and working fine. Now what I want to try out is to see whether I can get the service to send partial json responses i.e. I can specify as a parameter in the service request what are the columns on the response I want and the service would return me those columns.
e.g. If i request for columns a,b,c then then the service would return me a,b,c columns and if I request for d,e,f columns it would send me only those columns.
Is this possible using WSO2 DSS or even ESB?
If yes how can it be established?
Thanks in advance.
You can try number of approaches.
Have two different data services for both cases and at ESB, route the request to correct service. That is, based on request call relavat dataservice.
You can filter out your return results based on the roles.
You can do change at dataservice. That is, define a stored procedure, where identify the input parameters and based on that return specific columns.
I am trying to filter JSON results coming from our main application in our WSO2 API Manager and to filter URL's in the results. I haven't tried anything specific. Any ideas?
In Filter mediator use xpath to identify the certain messages/properties.check the url in the payload and filter..Check the documenation