What is webservice?

hi all

what is a web service ? I have heard about REST and SOAP.What is the real use of this in web application.What kind of purpose we use web service in php.What is the advantage ? Can any one give me a real time application example about these topics

How can I add web service to a web page using php ?

I don’t know if you would want to use this service, but they do a good job at making it easy to figure out how to use it. http://www.weather.gov/xml/#use_it

Web service is a way for a program running in one kind of operating system (Windows) to communicate with a progam in the same or another kind of an operating system (such as Linux) by using the World Wide Web’s Hypertext Transfer Protocol (HTTP)and its Extensible Markup Language (XML) as the mechanisms for information exchange. Since Web protocols are installed and available for use by all major operating system platforms, HTTP and XML provide an already at-hand solution to the problem of how programs running under different operating systems in a network can communicate with each other …
There are a variety of specifications associated with web services.

Here are some illustrative examples of what is and how SOAP works:
PHP SOAP Extension
Using SOAP Extension in non-WSDL Mode


Example: You need exchange rates, so you need something to provide them. You can use a web service, aka. a provider whose data is accessible over HTTP.

REST and SOAP are just protocols (on top of HTTP). It is a standard way to exchange data, which makes things easier than having to read specs to see how some provider decided to format his/her output.