Home > Articles > Programming > PHP

Working with SOAP Messages in PHP

  • Print
  • + Share This
Octavia Anghel shows you how to write a PHP web service using the NuSOAP library, as well as a JavaScript client to consume it using the AJAX technology and the SOAP protocol.
Like this article? We recommend

This article discusses how to write a PHP web service using the NuSOAP library as well as a JavaScript client to consume it using the AJAX technology and the SOAP protocol.

But first you need a small dollop of web services terminology.

Short Overview of SOAP and Web Services

Simple Object Access Protocol (SOAP) is an XML-based request/response messaging protocol. One important characteristic of SOAP is that it's independent of any transport protocol (HTTP is the most frequently used, but you can use SMTP, MIME, and so on), operating system, or programming language. This makes it very flexible over different software architectures—and also very easy to use.

A web service is a generic description of a software system designed to be called remotely over a network. The services offered can cover many tasks, and the implementation may vary, but the basic idea of a typical web service presumes the following:

  • A web service is exposed as a server that can be interrogated based on a set of operations.
  • It "publishes" available operations using an XML document known as a Web Services Description Language (WSDL) document. Normally, this document is both generated and parsed (interpreted) by machines, not by humans.
  • Entities that access the web services are known as web service clients.
  • The communications protocol between clients and servers is SOAP.
  • + Share This
  • 🔖 Save To Your Account