wwerner's blog

tutorials, tips and trivia on eclipse, osgi, web & xml technologies

Archive for the ‘rest’ tag

RESTful HTTP with JAX-RS

with one comment

In this post, we’ll look into creating a RESTful HTTP interface using JAX-RS. We’ll see that it is pretty easy to expose ordinary java methods through HTTP.

We’ll create a trivial model of a movie database and expose it via RESTful HTTP services as JSON and XML using JAX-RS, a little JAXB, Apache CXF, maven and Spring. We’ll see that we need very little code to achieve that. This post focuses on the service front-end, the data is not persisted. We’ll add JPA based persistence in a later post.


read more ...

Written by Wolfgang Werner

November 13th, 2010 at 11:32 pm

Posted in Uncategorized

Tagged with , ,

Building web services on Equinox and Restlet #3

with 7 comments

After having implemented the server application, we want to prepare ourselves for future changes. We want to be able to add new services to our application without impacting existing ones. We also may want to change the structure of the URIs in case they are not cool.

To do so, we’ll create extension points and the supporting code for the Restlet types used and contribute our implementations and see how that this helps us making our application more flexible and maintainable.

We’ll learn how to define an extension point, how to contribute to it and how to work with the contributions.


read more ...

Written by Wolfgang Werner

May 5th, 2010 at 1:09 am

Building web services on Equinox and Restlet #2

with 6 comments

Now that we’ve implemented our greeting application, it’s time to make it more enterprisey. We can’t have it just echo any greeting, can we? We’ll need to make sure that only greetings from a predefined list can be chosen as current greeting, so we can have committees that can spend time discussing and defining greeting standards.
As we want to make our lives easier (let’s assume the committee will change it’s mind every few days or so), we’ll implement a greeting manager that can be used to edit the list of approved greetings.

Beside rants at software development for The Enterprise™, expect a short introduction of the Restlet base classes that are typically assembled into a server application.


read more ...

Written by Wolfgang Werner

April 11th, 2010 at 10:12 am

Building web services on Equinox and Restlet #1

with 16 comments

In this series, we’ll look at creating modular and flexible server applications based on OSGi/Equinox and Restlet. The first article of this series covers the basics: It will walk you through creating a simple REST style web service using Restlet and show you how to roll it into a standalone application based on the equinox OSGi framework.

The next posts will go into how the different Restlet types can be assembled into bigger applications. We’ll then build extension points to lift the actual plumbing to a declarative level instead of hardcoding it.

We’ll see that the uniform interface proposed in the REST architectural style and the extension/extension point mechanisms in Equinox make quite a good couple.


read more ...

Written by Wolfgang Werner

March 31st, 2010 at 11:46 am

Posted in Uncategorized

Tagged with , , , ,