aspose file tools*
The moose likes Web Services and the fly likes Http Call VS Webservice Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Http Call VS Webservice" Watch "Http Call VS Webservice" New topic
Author

Http Call VS Webservice

Dhananjay Maan
Greenhorn

Joined: Aug 03, 2007
Posts: 4
What is the difference between Http post vs webservice call

Http Post

HttpClient client = new HttpClient();
PostMethod method = new PostMethod(_url);
method.setRequestEntity(new MultipartRequestEntity(_data, method.getParams()));
int statusCode = client.executeMethod(method);


We are currently using Http post for communicating third party, they have developed web service as new interface, so just want to know why we should use WS.

Thanks,

Dhananjay
sangram mhatre
Greenhorn

Joined: Apr 02, 2005
Posts: 15
Posting a message over http is what you already know .

Webservice is, createing a message in a specific protocol(SOAP envelope which defines an xml format) and then post
it over the http . On the serverside the soap envelope recieved is decoded and then call the corresponding service (maybe
anything not only java) and then again send the response in the xml format to the client .

The advantage is since you are using a predefined xml format , you can communicate between different platforms i.e. a java
program can communicate to a c# program whithout even needing to know that it is talking to a c# program.
Cheers,
Sangram
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39575
    
  27
WS also use HTTP (and HTTP POST), so that is not a distinguishing characteristic. Furthermore, SOAP is just one form of WS; another major variant is REST, which is gaining much momentum of late.

SOAP is complex, but it has the advantage of providing other services and functionalities that a generic XML-over-HTTP POST does not provide, like WSDLs and WS-Security.


Ping & DNS - updated with new look and Ping home screen widget
 
Consider Paul's rocket mass heater.
 
subject: Http Call VS Webservice
 
Similar Threads
Calling webservice: works from standalone app but not from weblogic
SSL implementation for HTTPClient
Can we pass XML file as an HttpServletRequest?
Apache HttpClient posing trouble
Using PostMethod to post from a servlet without capturing the response body