Thursday, July 31, 2014

Creating webservice server and client using NuSOAP



Brief description of NuSOAP:
NuSOAP is a rewrite of SOAPx4, provided by NuSphere and Dietrich Ayala. It is a set of PHP classes – no PHP extensions required – that allow developers to create and consume web services based on SOAP 1.1, WSDL 1.1 and HTTP 1.0/1.1.
Why using NuSOAP? PHP5 already has soapServer and soapClient implementation
  • it’s easy to implement and fast, no need to create WSDL document by yourself (this is my main reason why I choose NuSOAP)
  • compatibility, no special PHP extension need (I didn’t test it if still works on PHP4, but it does work flawlessly on PHP 5.0)
First, download NuSOAP from here: http://sourceforge.net/projects/nusoap/
The Server
We will create a SOAP server with two entry points (=function). One function take one parameter and output a string while the other one take two parameters and output a complex result (an array/struct). The codes with commentary:

Source1 : http://www.ahowto.net/php/creating-webservice-server-and-client-using-nusoap
Source2: http://www.scottnichol.com/nusoapprog.htm

No comments:

Post a Comment