From: ses on
Yes, sorry I wasn't very clear, I was meaning to use Java's HTTP
server. A servlet is something I hadn't considered but seems like a
good solution too.

I've already experimented with writing HTTP clients for RESTful web
services using the Java Socket implementation, which seems to work
well. I know it is a little odd but I somehow prefer the feeling of
knowing what's going on a bit more when it comes to working with HTTP
which is a relatively low-level thing to do anyway.

Thanks for the input though, RESTful web services is fairly new to me
and I wanted to check there wasn't any one 'right' way to do it that I
was missing.

On 29 Apr, 23:33, Tom Anderson <t...(a)urchin.earth.li> wrote:
> On Thu, 29 Apr 2010, ses wrote:
> > Just a general open ended question - I quite familiar with SOAP / WSDL
> > based web services and implementing them in Java (JAX-WS), but I've not
> > much experience of RESTful web services. As it is basically just a
> > design rather than a standard, are there any issues in terms of how you
> > implement them (for consumption by your own applications)?
>
> > Currently I'm considering just implementing them by simply writing a
> > simple HTTP server, and consuming them using a HTTP request which are
> > both very easy to do in java
>
> I'd usually be thinking in terms of writing a servlet (or even a JSP)
> rather than a server, and running it inside a servlet container.
>
> If you don't want the overhead of a servlet container, you should look
> into embedding Jetty:
>
> http://wiki.eclipse.org/Jetty/Tutorial/Embedding_Jetty
>
> If you want even more lightweight (but not very scalable, AFAIK), Sun's
> super-secret embedded webserver is already in your JDK (as long as you
> have a Sun 1.6 JDK):
>
> http://java.sun.com/javase/6/docs/jre/api/net/httpserver/spec/index.html
>
> Either way, writing an HTTP server from scratch is a mad idea. Perhaps
> that's not what you meant.
>
> On the client side, writing your own HTTP client is marginally less
> unreasonable, but still pretty silly given the existence of the JDK;s
> HttpURLConnection and Apache's HttpClient:
>
> http://hc.apache.org/
>
> tom
>
> --
> Formal logical proofs, and therefore programs - formal logical proofs
> that particular computations are possible, expressed in a formal system
> called a programming language - are utterly meaningless. To write a
> computer program you have to come to terms with this, to accept that
> whatever you might want the program to mean, the machine will blindly
> follow its meaningless rules and come to some meaningless conclusion. --
> Dehnadi and Bornat

From: Lew on
ses wrote:
> Yes, sorry I wasn't very clear, I was meaning to use Java's HTTP
> server. A servlet is something I hadn't considered but seems like a
> good solution too.

Please do not top-post.

--
Lew