This article describes the new SOAP extension for PHP. It is intended for PHP developers who want to write their own Web Services servers, or use SOAP to access existing ones. It assumes some familiarity with Web Services, SOAP, and WSDL (Web Services Description Language).
To demonstrate how to make a simple SOAP Client, we’ll take the XMethods demo service, “Delayed Stock Quote”, as our target. Before we start to write any PHP code, we’ll need to gather some information about this particular service:
The method name
The endpoint URL where the service is running
The SOAPAction header value for the method
The namespace URI for the method
Input and output parameter names and types
Happily, all this information is available on the XMethods web site at http://www.xmethods.com/ in the form of the service’s RPC profile:
As you can see, this simple task required a lot of work. Fortunately, Web Services can describe themselves to the client using WSDL, and generally they achieve this successfully. The location of the WSDL document for the XMethods “Delayed Stock Quote” service is given on the information page for that service at xmethods.com.