aspose file tools*
The moose likes Web Services and the fly likes How restful webservice communicate to another webservice? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "How restful webservice communicate to another webservice?" Watch "How restful webservice communicate to another webservice?" New topic
Author

How restful webservice communicate to another webservice?

Nakataa Kokuyo
Ranch Hand

Joined: Jul 24, 2011
Posts: 189
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

Joined: Mar 22, 2000
Posts: 12825
    
    5
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

Joined: Jul 24, 2011
Posts: 189
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

Joined: Mar 22, 2000
Posts: 12825
    
    5
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

Joined: Jul 24, 2011
Posts: 189
Thanks William !!
Monica. Shiralkar
Ranch Hand

Joined: Jul 07, 2012
Posts: 663
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

Joined: Mar 22, 2000
Posts: 12825
    
    5
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

Joined: Jul 07, 2012
Posts: 663
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?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How restful webservice communicate to another webservice?