I am trying to create server/client on mobile for providing and consuming web services.
AH that is quite a challenge - taking a quick look at some of the APIs, I see the classes for Sockets normally found in the java.net package are in a javax.microedition.io package.
Whichever open source server code, such a Jersey, you work with will probably have to be rewritten for ME.
Come to think of it, Jersey and all other web service toolkits use lots of other classes not in J2ME. Your best bet will be to start with a bare-bone server and just add the specific functions needed for your service.
A google search for "minimal java web server" found some compact servers.
If this was my problem I would start by trying to get a minimal HTTP server running in the J2ME environment.
From there you need to define which REST methods and response MIME types you want to support. Create examples of requests you want the service to respond to using something like HttpClient on a desktop system.
It will also be a LOT simpler if you do not attempt to do dynamic deployment of new functions while the server is running.
I don't think you will find any of the toolkits useful (except as inspiration) because they are being designed for the full server environment.
Thank you. I have created small server on the mobile that is listening to incomming requests but my question is how RESTful web services are implemented and deployed on J2ME . What will be the style of it suppose I want to implement small web service that performd the addition of two integers. with RESTlet it is easy how about J2ME. I am little confused.
There is nothing magic about a RESTful web service, it is just a service that responds to HTTP requests by following the REST design philosopy. Many many thousands of words have been expended in trying to explain this philosophy - way too much to summarize here. I have written several articles on the subject which you can get to from my home page. Alternately google for "RESTful design."
Implementation will involve code that looks at an incoming HTTP request - both URL and request headers - and decides which class or method should handle creating the response. Pretty much what standard servlets do but with a more strict design philosophy.
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop