Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How restful webservice communicate to another webservice?

 
Nakataa Kokuyo
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good day,

Could someone please enlighten me how one webservice communicate to another webservice directly? if we need bi-directional communication does it means both side will required HttpClient to do so?

Thanks
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13071
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The basic java.net library has all you need to create HttpURLConnections.

Do you want both "web services" to be able to initiate a request?

Bill
 
Nakataa Kokuyo
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks William for the answer! May i know what are the basic java.net library that you mentioning? we using java, is that means of HttpComponent?

Our application will required bi-direction communication, what could be the best way to do that? Do i need to make client available on both side for communication?
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13071
6
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The java.net package is part of the basic Java library and has been since version 1. The reason being that SUN's motto "the Network is the Computer" shows how much SUN emphasized communicating computers. The number of different ways two Java programs can communicate is rather large, selecting one will depend on your other requirements.

If you do not have a copy of the complete standard library JavaDocs on your work computer, get one and study the HttpURLConnection and URLConnection APIs.

Bill
 
Nakataa Kokuyo
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks William !!
 
Monica Shiralkar
Ranch Hand
Posts: 855
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As far as I understand webservices mean application functionality exposes on internet or network and available through XML. E.g a web service to fetch some Data .now in this context what does communicaiton of 2 web services mean?
thanks
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13071
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Monica. Shiralkar wrote:As far as I understand webservices mean application functionality exposes on internet or network and available through XML. E.g a web service to fetch some Data .now in this context what does communicaiton of 2 web services mean?
thanks


Creating a web service by aggregating input from other services (ie communication) seems to be a pretty common idea.

Note that XML is not required for RESTful web service architectures.

Bill
 
Monica Shiralkar
Ranch Hand
Posts: 855
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks..

Note that XML is not required for RESTful web service architectures.


thanks.but in restful web service response dont we also send XML as the return type from web service method with response type text/xml?It can also return other like JSON but is that impossible in SOAP?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic