WSO2 ESB DSS Integration, sending multiple records to DSS - wso2

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

Related

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 API Manager publishing runtime data to DAS, but No Data Available in UI

I'm using independent wso2 API manager 1.10.0 and wso2 DAS 3.0.0
I have configured REST client for publishing statistics
I published some event and i'm able to see some data in WSO2AM_STATS_DB datasource (api_request_summary,...)
The strange problem is that some statistics are showing in the publisher UI interface (API Subscriptions,API Response Times,API Last Access Times) but in the other pages I'm getting No Data Available message
Any explication to this strange message
I think your setup is working fine. You see data in AM_STATS_DB means published data is being analyzed and stored there. There are some pages in the stats page which will show the message "No data available" if there are no relevant data. For example the "Faulty invocation", "Throttled out requests" pages.
If you invoke an api with wrong token, it will appear in the faulty invocation page. If you send requests to an api until they get throttled out (high TPS), it will appear in the throttled out requests page.

WSO2 API Manager & Web Service composition

Here's the scenario,
WS_A and WS_B are Web Services published in different endpoints.
WS_A receives personId, makes some processing, logs some data, and returns the name and the lastname of the Person with personId.
WS_B receives two Strings name and lastname and saves name+lastname in a database, then returns Ok/Error.
I need to publish an API API_Composition, using WSO2 API Manager, that will call WS_A, and send the result to WS_B, then return the result of WS_B.
Keep in mind that i can't make a new WS_C that has the behaviour of WS_A+WS_B, because i can't access the whole code of any of them.
Is there a way of doing this using only WSO2 API Manager?
Are there any other API Management products that can accomplish this requirement?
Regards
Yes, you can do this with mediator sequence. I have not found a specific tutorial for your scenario, but here's a blog post that has a demo on using mediator sequences and links to detailed documentation.
(Note: the demo and blog post are for WSO2 API Cloud - the hosted version of WSO2 API Manager. But it all works the same for API Manager - it is the same technology.)

Getting partial responses through WSO2 DSS

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.

Concern with the use of dynamic sequences in ESB 4.5.0

In a scenario where I monitoring my proxy services in ESB 4.5.0 using BAM 2.0.1 with WSO2 products, how I can define that the dynamic endpoints and sequences used in this proxy services have their statistic enable?. So I can see their statistics in BAM.
I can anable sequences statistics in the defined sequences in the synapse configuration but I can not use them for example in chaining scenarios, and I can use dynamic sequences in chaining scenarios but I cannot enable their statistics.
This is due to in the Send Mediator I can only specified dynamic endpoints or sequences that exist in the registry, not in the synapse configuration.
What can I do to make my scenario work?
In the same scenario with a proxy service that implement a service chaining I can see the right response when I consume the service using SOAPUI but in BAM 2.0.1 appear as fail all the time.
You can enable statistics for dynamic endpoints and dynamic sequences by this way:
1. Go to the registry resource,
eg:- /_system/config/Hello
2. Content -> Edit as text
3. Add statistics="enable" to address element
Then if you have used that endpoint, statistics will be fired to BAM and you can see those if the Mediation statistics toolbox is installed.
I have carried out a test on a Chaining service in WSO2 ESB and monitored it through the WSO2 BAM 2.0.1. It seems to work fine and did not encounter any statistics mismatch. The statistics matched with esb invocations.
ESB Statistics:
BAM Mediation Stats: