Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is there a chance to use both SOAP and Rest webservices in the same project ?

 
sree hareesh
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I am new to webservices. Is there a chance to use both SOAP and Rest webservices in the same project ?
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by "is there a chance"? It's certainly possible.
 
Praful Thakare
Ranch Hand
Posts: 642
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if you can dance then there is a chance ..

As Ulf replied, yes its possible.

-P
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My suggestion, don't get into SOAP unless you absolutely have to. RESTful style services are much easier.

Bill
 
amit punekar
Ranch Hand
Posts: 544
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
SOAP is one of the protocols for messages used to communicate with webservices. By this I meant, the request and response messages shall adhere to SOAP standards.
Whereas REST is a architectural pattern to implement webservices in which you define URIs to access your webservices according to REST standards. For e.g. GET/POST etc. I am sure you must have read what is REST before you encountered this question. There is this Article by Martin Fowler on REST, it will be certainly helpful to you.
As William mentioned RESTful style is much easier as you can employ the webservices request and response in JSON (other formats like XML are also okay) format which I believe is easier to handle than SOAP. This also requires less boilerplate code than SOAP webservices.

Regards,
Amit
 
Hikari Shidou
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have done exactally that today, to develop a SOAP x REST benchmark. I talk about it at RESTlet slower than Axis2.

Jackson + RESTlet + RESTlet built-in HTTP client had really really bad results, both in stability and performance, compared to Axis2 and its built-in XML marshaller and HTTP client. Basically, Axis2 has all we need and can make dozens of thousands of sequential calls with ease and have 3-5 milisecs overhead on each, while Jackson + RESTlet + RESTlet built-in HTTP client timeout hangs after a couple hundred calls and have 4-6 milisecs overhead on each. With stability issues and worse performance, it's hard to advocate for REST, and with a few milisecs of overhead, Axis2 is very lightweigth for the features and flexibility it provides.

To do what you want, using Axis2, RESTlet and a unique Eclipse project, basically:

1) Create Axis2 WebService as normal, using Eclipse for automating it
2) Manually create RESTlet ServerResource, as Eclipse has no automation features (RESTlet seems to have an Eclipse plugin, but I was unable to install it and didn't need at all)
3) When routing URLs in RESTlet Resource, be careful to not use Axis2 paths
4) Together with Axis2 and RESTlet you can also develop traditional Servlets, just when creating them in Eclipse be careful to not conflict their paths with Axis2 and RESTlet ones
5) In WEB-INF/web.xml you'll need to bind RESTlet routes manually, tomorrow I can post an example of it, it's not hard
6) Export war file normally from Eclipse project, it will have (1), (2) and (4) all together
7) Deploy war file in Tomcat and test all URL paths you have created, testing their parameters and responses
8) Run many tests with thousands of calls in your RESTlet client, I had A LOT of issues in it!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic