• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Http Call VS Webservice

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 43026
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Politics is a circus designed to distract you from what is really going on. So is this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic