Is there an open source tool for publishing an existing database as a set of WebServices

I have an existing database (PostgreSQL in my case) and I would like to access its data (create, read, update, delete, query) through SOAP web services. What we are doing now has a JPA implementation of each Entity and has an implementation of a common CRUD interface. Then we show these beans as JaxWS web services. The problem with this setting is that JaxWS behaves strangely using common interfaces.

Since this is such a common problem, accessing the database through WS, I would like to know if there is an open source solution that will display all entity tables as web services. Such a tool will require as input a set of JPA classes (or some other description of the data) or even a JDBC connection (to pull out the SQL schema) and create a set of CRUD web services.

Ideally, such a tool would consist mainly of a servlet that can be integrated into any web application.

Please tell us your suggestions for such a tool, and if you have experience using it, please share.

Thank you for your consultation.

+4
source share
2 answers

Sorry I didn’t answer this question and instead said, “You don’t want to do this,” but ...

First, you may not need to do this. Does your database already provide web services directly? For example, DB2 UDB and its tools do the job for you. No need to write Java at all.

Secondly, maybe you shouldn't do this anyway? This is pretty much an architectural anti-pattern to expose your entity level directly as a web service. The degree of detail makes the work inefficient and difficult to maintain in the long run. Web services in general are generally better than fairly large-scale business-relevant services. For example, to create an Insurance Policy, you may need several updates and inserts in several different tables. To expose access to the source table, how web services means that the evey client must know exactly what to do. Instead, you will see the CreatePolicy () web service, and let the implantation be gnarly.

+3
source

In our case, we have a multilayer architecture, and one of its parts is the storage. I do not want to lose transactions, but if I need to insert a new client through a web service, and I have customer service along with its schema definition, which can be generated automatically. It should also be noted that BPEL 2.0, as far as I know, supports transactions, so these data services can be aware of transactions, that is, participate in a distributed transaction.

Creating a new BLOG entry is an operation that MAY be performed in special transactions. There are many other cases in our project (for almost every table), and we need to expose them to external systems. Why write it manually 100 times. As the author of ANTLR says, if you can do something manually in 5 days, why not spend 5 years automating it.

I do not want to spend 5 years and am looking for a turnkey solution. Currently, we have semi-automated a task that involves code generation, and the biggest problem was that JaxWS does not work with universal interfaces.

This architecture has its advantages because you can do many cool things, for example: - You have a set of annotations on top of entity classes to check ROLE permissions. These checks will occur regardless of how you access your entity, web service, or direct java call. You can also define hooks, for example, create an RSS / Atom feed for all operations in a specific table. - There are many GUI tools for entity types described in XSD to automatically create a form. I do not want to create all forms, but at least I have a default implementation that can be replaced.

What I'm looking for is actually a data access abstraction protocol that can be protected by a database or something else, complete the export as a web service (soap / restful / json whatever)

There is an Apache EmpireDB incubation project in which they do not use annotations and javaclasses to define the model, so that metadata could be more easily used to create XSD and forms. I do not like to use a non-standard standard project, so I'm looking for a turnkey solution based on standard technologies: JPA (for example, sleep mode), JaxWS.

+2
source

All Articles