Fetch Data From Mysql Table Using WSO2-DSS - wso2

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.

Related

Get sales orders from Amazon MWS scratchpad via API

My mission is to get Amazon sales orders out for a given time period and post these into a SAP ECC back end via SAP PI. I've managed to get the MWS scratchpad working and am a bit stuck as to how i would put the data from the scratch pad into postman or SOAPUI.
I don't know the endpoint for Amazon MWS to find the API or WSDL structure - where to send the call. How can I find out?
how do i know what information to pass into what areas of the SOAPUI or postman tools?
How do i get the WSDL for the MWS response call so i can export it and import that structure into sap to save me building a massive response structure?
This is my mws scratchpad:
Everything you need is right here: Orders API
It tells you your endpoint, your operations, and your request and response parameters. What language do you use? If you use PHP, C#, or Java, there are client libraries that do all this for you, just plug in your account info.
For the ListOrders operation specifically, it's right here - ListOrders.
The response format is explained here.
You also need to calculate a signature, something that scratchpad and the MWS client libraries will do for you. Not sure how you can do that from Postman.
thanks for your assistance again . The scratchapd works a dream. Yes, i am not sure how postman will do this either. I am calling from SAP PI, presumably some code will have to be written in java to handle the calculation of the signature and timestamp - i get the current error when posting in postman:

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

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.

WSO2 API Manager filter JSON result

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