I want to load some data into mysql from a restful web services.
The API accepts http requests and returns xml output.
I want to load the xml output into mysql.
How can I do this ?
as I see you would like to do two steps in one ;) First that you should do, creating a Java object from XML (unmarshalling) and 2nd, save the object to DB.
For 1st, you can use JAXB or other free tool. For 2nd, use Hibernate ;)
Related
I am using Contentful CMS - when my JavaScript app loads, I retrieve all the articles/entries during app initialization. I then want to query this local json object without doing futher Http calls to Contentful
Each entry of the 'items' array will have 'id' links to categories/authors/assets etc which will be in the returned Json.
Is there a JavaScript library or API I can use to query this Contentful json data locally on the client side?
You probably want to look at normalizr for that. The idea is to transform JSON into something that you can access by entity type + entity id, so it 'feels' more like querying a relational database.
What is the difference between Couchbase java-client and couchbase-client?
I can see bulk get operation in java-client but not in couchbase-client
Is it possible to do bulk get operation in if we use couchbase-client?
For couchbase-client you refer to REST API Couchbase?
if this its true SDK java client create connection with database directly and there are many functions to get, create and update documents
you can map document in java class and even if you want put your Example.java class directly in document in spring there are documentarion for implement this.
In other way with API you can send n1ql query the response contain the document in json format.
Depends on the implementation you want.
I recomended that you will use SDK JAVA
Good luck.
We need a JSON mapper from Type-A to Type-B ( i.e. JSON to JSON string). I'm aware of ESB tools which has mapping for XML to XML like IBM ESB.
So do we have any open source tool or paid application
Which has an editor to do mapping of JSON to other JSON , with capability to do some basic operations like formatting, etc
Can this transformation be exposed as REST service
If needed be, extract this transformation logic as JAR file and other team can use it
Thanks.
Manjesh,
I have good news for you. There is indeed an open source program that will accomplish this for you. Talend Open Studio (TOS) ESB (not to be confused with their TOS for Data Integration). Any ESB tool should do this quite easily. See below:
Image 1 shows in SoapUI where I am calling a REST service, passing the JSON prefix: team1, team: Giants is sent in. I return: Prefix: Cowboys are better than, Team: Giants. I could have done other manipulations (including changing the json structure) but put together a simple example.
The next image shows the Talend REST service implementation within Talend:
finally, I show the internals of the component (tXMLMap_2) where I manipulate the json data.
I'm new to OData so I'm sorry if this is a bad question, but I fail to find an answer.
I have a bunch of OData tables, and I would like to provide an option for the user to get the data as a CSV-file.
Now I know OData only supports Atom and JSON, but is there any way to make it return a filestream, or a URL?
I was thinking a URL could direct to a REST-service (not OData) that simply returns a filestream, if filestream directly from OData is impossible.
Any thoughts or ideas are appreciated!
I'm not totaly sure why you want to use oData. But oData essentially means to publish any kind of data in JSON/atom standard format - not CSV.
If you have controll over your oData source you could modify an oData Producer to output CSV filestreams instead of JSON/atom files.(But you wouldn't have a real oData feed anymore)
You could also set up any oData Consumer (you can find those at odata.org) to read your oData source and display it as CSV.
If you choose a server side solution(PHP/JSP/ASP etc.) it should be rather simple to loop through the results of a request and add seperators inbetween.
Let's say I have a northwind database and I use ADO.NET Entity Data Model which I automatically generate from the tables in database. Then I add a new WCF data service that inherits from DataService. When I start the web application, that runs the service I can request data like this:
http://machine/Northwind.svc/Orders
This will return all orders from order table in atom/xml format. The problem is I do not want XML. I want JSON. I think I tried all kinds of settings (web.config) and attributes in my application, but I still get XML. No matter what. I can only get JSON, when I use fiddler and change the request header to accept JSON.
I do not like the concept of content negotiation. I want always to return data in JSON format. How can I achieve that?
Keep in mind that I did not create any model objects, they are automatically created based on database tables and relationships.
Well - content negotiation comes with HTTP. In any case, you could intercept the incoming request and add/overwrite the Accept header to always specify the JSON. There's a sample how to support JSONP which uses a similar trick, I think you should be able to modify it to always return JSON as well. http://archive.msdn.microsoft.com/DataServicesJSONP.
The behavior you criticize is defined by specification of OData protocol. OData defaults to Atom and client can control media type of the representation either by Accept HTTP header or by $format parameter in query string (but I'm not sure if WCF Data services already support this).