• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Http Call VS Webservice

 
Dhananjay Maan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic