Creating and using web services with PHP
Thursday, August 06, 2009Basic Implementation of a Web Service client with PHP
A web service is an application that exposes or publish its functionalities or methods through an interface. It works in client-server mode, other applications talk to the web service using messages in a standardized format. Essentially, the communication is the same as a web server returning requested data by a browser such as an HTML page, the only difference is that instead of serving up HTML in response to HTTP requests, it serves up SOAP (XML) responses to SOAP requests.
Four elements make a web service:
- XML
Standard format for exchange data primarily designed to the web. Its principal advantage is that a developer can define his own tags, this fix the way the data are read and validated by the client applications. XML schemas must be public so any change made in the application doesn’t affect communication. An xml file begins with this header:
<?xml version="1.0" encoding="UTF-8"?> (more...)