• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

How does the browser and web service communicate using SOAP?

 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is mentioned that web services communicate through SOAP. If I am going to call a web service through a browser (HTTP Get), then the browser must send a SOAP message to the web service. On which point does this message was converted to SOAP? Who is the one responsible for converting it to a SOAP message? If it is the browser, how did the browser knew that it must send its message as a SOAP message?

If it is okay, can you also provide me a detailed process on how the browser and the web service communicate. Thank you!
 
Rancher
Posts: 43081
77
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your JavaScript code needs to create valid SOAP; that's not something that happens automatically. While there are probably libraries that help with that, nobody really uses SOAP from within a browser. Libraries such as Prototype and jQuery make it trivially easy to send REST requests that retrieve data via the JSON notation, so that's what's being used for browser-to-web service communication.

For Prototype, see http://www.prototypejs.org/learn/introduction-to-ajax and http://www.prototypejs.org/learn/json

(Also note that SOAP's popularity in general has taken a big hit in favor of REST in the last couple of years.)
 
Kelly Powell
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@Ulf Dittmer: Thanks for your clarification! I thought requests are converted to SOAP automatically before sending it to a web service.

So if I am using http ://address/webServiceName/method?var1=value to call a web service, does it mean that I am not using any SOAP to tranport my request? If yes, then how does the web service handle my request? What protocol/ format am I using? Am I using plain HTTP get to transport my request to the web service? I thought the request should be in SOAP format to be understood by the web service?
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First off, web services can take different forms. SOAP is a popular one, as is REST. Both use HTTP as the transport protocol. The WebServicesFaq points to several articles that contrast these two styles.

So if I am using http ://address/webServiceName/method?var1=value to call a web service, does it mean that I am not using any SOAP to tranport my request?


If that's all you're sending, then yes - there's no SOAP. SOAP would be sent in the body of an HTTP request, and would typically not have parameters in the URL.

If yes, then how does the web service handle my request? What protocol/ format am I using? Am I using plain HTTP get to transport my request to the web service?


What you're using is closer to REST-type web services, where all parameters are transported as part of the URL (though, confusingly, not necessarily as URL parameters).
 
Kelly Powell
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

First off, web services can take different forms. SOAP is a popular one, as is REST. Both use HTTP as the transport protocol. The WebServicesFaq points to several articles that contrast these two styles.


I see.

If that's all you're sending, then yes - there's no SOAP. SOAP would be sent in the body of an HTTP request, and would typically not have parameters in the URL.


So, since there is no SOAP, the body of my HTTP request does not contain anything?

@Ulf Dittmer: Thank you very much for answering my questions!
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

So, since there is no SOAP, the body of my HTTP request does not contain anything?


That depends on the HTTP method being used. If it's a GET, then the body is empty (the parameters would be part of the URL, as in the example you posted earlier). If it's a POST, then the parameters and/or other data would be in the body.
 
Kelly Powell
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@Ulf Dittmer: Thanks! I got it now.
 
What's wrong? Where are you going? Stop! Read this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic