Win a copy of Head First Android this week in the Android 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Exposing a service as both Restful and Soap

 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need to expose a functionality as a restful service as well as provide a SOAP interface.
I have implemented rest using JBOSS resteasy .
The rest service exposed is test which was implemented as below to support form and xml requests.


What is the best way to expose the test method as a SOAP service? I have implemented this as an Axis service by defining a method as below but is this the best approach?
Is there some functionality of rest easy that I can leverage to get this working?



Thanks in advance!
 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
The simplest way is to use a Java-first approach according to, for instance, the following tutorial: http://www.netbeans.org/kb/docs/websvc/jax-ws.html
You should pay attention to separate things related to the different services in one layer, the service layer, and common request processing code in another layer, the processing layer.
I suspect it will mean more work to reuse part(s) from the REST service in the SOAP service. The only candidate(s) I can think of would be JAXB bean classes.
When doing Java-first SOAP web service development, artifacts will be generated at deploy time, so you may never see them. The container will take care of these things for you, so I don't think there is anything to gain from writing it yourself, and thus no need to try to use RESTEasy when implementing the SOAP web service.
Hope this helps and best wishes!
 
Cindy Jones
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How about using Apache CXF? Someone recommended this as an alternate solution.
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi again!
Yes, Apache CXF can do both REST and SOAP web services. I have used it to write REST web services and liked it.
Best wishes!
 
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
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic