Getting partial responses through WSO2 DSS - wso2

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.

Related

BigQuery - Apigee Connector

I want to integrate my table request of bigquery in APIGEE API proxy.
I create an integration and a collector for my table in google cloud, I connected the APIGEE proxy to connector.
It works APIGEE response me with data of table, but with a problem, the list have a maxinum of 200 items(are more result).
I tryed to make a multiple pages logic, but I found a problem.
The connector used for bigquery have an output parameter called "listEntitiesNextPageToken" that should contains the token of next page, but effectively remain the default value after run.
I search everywhere but all documentation of this parameter is this ("https://cloud.google.com/apigee/docs/api-platform/integration/connectors-task")
I expectining to found an alternative or a solution for have all the result of the query i tried to make using only google cloud.

WSO2 ApiManager Routing Database

I have a requirement with ApiManager DataService, I need to same request and same response but connect to different database based on a request attribute named year.
Is it possible? or I have to create a dataservice by year?
Thanks
You cannot conditionally change the Datasource based on a parameter.
If you want to use the same Dtaservice, you can have different contexts for the two requests like below. But still, you will have to add new query and the Datasource config.
<WSO2_URL>/Dataservice/getSomething/year1
<WSO2_URL>/Dataservice/getSomething/year2

WSo2 EI - JSON Output from API to Database (External)

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

WSO2 ESB DSS Integration, sending multiple records to DSS

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

Fetch Data From Mysql Table Using WSO2-DSS

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.