A web service using another web service

It seems logical for a web service to use another web service.

Are there any problems with this?  Are there any pitfalls I should know about?

newbiewebSr. Software EngineerAsked:
Who is Participating?
yeah there is no technical difficulty in doing it ... as I said it can be done and in a small scale app isnt a problem but its not really a scalable model.


You generally dont want to do this though you can ... preferred is a bus or a hub and spoke model..

The reason for this is if this methodology (ervices calling eb services) is followed you end up with a web of depedencies
anyoneisSoftware DeveloperCommented:
I have seen this used, and the only pitfall was that one of the web service layers was totally unnecessary- it added complexity needlesly. If you have a need for interprocess communications, then think about remoting or web services. However, if you just want a clean layer separation, just define some interfaces and separate the layers in their own DLLs.


On a small scale its not an issue. In an enterprise its considerred an anti-pattern, there are numerous products to avoid it: Biztalk and other products like websphere or Sonic offer solutions to the problems http://en.wikipedia.org/wiki/Enterprise_service_bus descibes a bit about what a service bus is.

Basically the big issue can be easiest seen in deployment. Let's say I have a service which sits in front of a widget repository that the rest of my enterprise uses. There are 90 other services which use my service. I want to make a change to the widget web service to be queued service. I would now need to redeploy all 90 services that had dependencies on it (because they had a dependency on the endpint)

Another example of where it gets to be nasty is that there is no good way of seeing my actual workflow associated with the process. Each service is calling out other services my logic is heavily fragmented throughout my enterprise.

Another major issue is transaction management ..

http://www.infoworld.com/article/05/04/29/HNesb_1.html is a quick discussion DrDobbs had a great article on ESBs in July http://www.ddj.com/java/201200303;jsessionid=0PYMV4CA5XZHSQSNDLRCKHSCJUNN2JVN?pgno=1 definately worth a read through.

newbiewebSr. Software EngineerAuthor Commented:
I can see the disadvantage to this approach.  But if I were to need something quick, and for demo purposes, is it possible?

Could I add a web reference to a web service to point at another web service?  Will it work the way it works for a Windows Forms application?

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.