Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

RESTful Architecture vs. servlet Framework

 
Greenhorn
Posts: 15
Oracle VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello world,

i'm just new to webservices (thanks to ivan for your study notes !!!) and have a question regarding application architecture.
e.g. an architect wants to build a resource-oriented application based on RESTful webservices (http-binding). he talks about this
approach with a collegue (which is new to jax-ws) and after some time his collegue states the opinion that its better to do the
job using a plain old servlet framework like struts, turbine or spring.

what is your opinion about this ? which are the strong advantages of the RS approach ?

thanks in advance for your answers.

ulli

 
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think there's some confusion over technologies:

  • JAX-WS is an API for SOAP-based WS, not RESTful WS


  • Struts et al. are web app frameworks - they're used for web pages, not web services


  • So if you're looking to implement a RESTful WS, check out projects like Jersey (the JAX-RS reference implementation).
     
    Ulli Hertlein
    Greenhorn
    Posts: 15
    Oracle VI Editor Windows
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator

    Ulf Dittmer wrote:I think there's some confusion over technologies:

  • JAX-WS is an API for SOAP-based WS, not RESTful WS

  • ....



    hi ulf, my understanding is that RESTful WS is fully supported in JAX-WS via Provider/Dispatcher/HTTP binding lowlevel programming.
    The following article explains this (with examples):

    http://www.oracle.com/technetwork/articles/javase/index-137171.html



     
    Ulf Dittmer
    Rancher
    Posts: 43016
    76
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Yes, but that's a kludge. Using a SOAP framework for REST WS is not the best way to go about things.

    Also note that JAX-WS may support REST, but it does not support JAX-RS - which is the standard Java API for REST WS.
     
    Author and all-around good cowpoke
    Posts: 13078
    6
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator

    Yes, but that's a kludge. Using a SOAP framework for REST WS is not the best way to go about things.



    Agree++

    You lose all the clarity of RESTful style by trying to jam it into a SOAP framework. JAX-WS is too tightly tied to JAXB and XML in general. Remember that a RESTful approach can serve any (repeat any) resource with equal facility.

    Bill
    (repeating myself I know, but read Fielding's Dissertation!)
     
    Ranch Hand
    Posts: 2198
    1
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hi!
    I am going to repeat myself a little too.
    Of course you can use servlets etc to build services, but the interesting question is (in my opinion) what the consequences will be.
    As before, REST is an architectural style which aim is to obtain certain goals as described in the Wikipedia article: http://en.wikipedia.org/wiki/Representational_State_Transfer
    In order to obtain those goals, you have to follow certain principles (also described in the Wikipedia article).
    It is possible to follow those principles when developing servlet-based services. I can also develop Object-Oriented software using assembly language - the question is if it is a convenient and time-efficient approach.
    Also, my experience is that the more clear patterns, for instance for developing a service, there are, the more likely it is that the result created by different developers is more similar. One of the risks is that there is no clear pattern how to develop a service using servlets. Using JAX-RS annotations, it becomes, in my opinion, much more clear.
    Best wishes!
     
    Ranch Hand
    Posts: 1183
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Rob Heittman once spoke to it in the context of Restlets at Differences between Servlet and Restlet.

    Regards,
    Dan

     
    Ranch Hand
    Posts: 75
    Eclipse IDE Chrome Java
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator

    Ivan Krizsan wrote:Hi!
    Using JAX-RS annotations, it becomes, in my opinion, much more clear.



    Agree
     
    Ranch Hand
    Posts: 544
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hello,
    I just came across this post and one article on REST. Just thought of posting it here if it clarifies some of the aspects.

    Here is the link.

    Regds,
    Amit
     
    Do not threaten THIS beaver! Not even with this tiny ad:
    Thread Boost feature
    https://coderanch.com/t/674455/Thread-Boost-feature
      Bookmark Topic Watch Topic
    • New Topic