File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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
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: 42929
    
  68
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Http Call VS Webservice