Web Services - WSDL: Creating SOAP Server

PHP Web Services Using WSDL Step By Step Tutorial - Part 8: We have finished talk about WSDL document. Now, we will colaborate with SOAP. This soap is provided at PHP 5 (we ever talk about SOAP use nusoap for PHP 4).

create a file named "hello_server.php" within folder where hello.wsdl has placed (within www/test/wsdl). Enter following code:


$server = new SoapServer("hello.wsdl");

function doHello($yourName){

  return "Hello, ".$yourName;


This service has one method "doHello". And this method need a parameter named $yourName. It will return text such as "Hello, ".$yourName.

Series this article:
Web Services - WSDL: Anatomy of WSDL Document
Web Services - WSDL: Sample WSDL Document
Web Services - WSDL: Types
Web Services - WSDL: Messages
Web Services - WSDL: Port Types
Web Services - WSDL: Bindings
Web Services - WSDL: Service
Web Services - WSDL: Creating SOAP Server
Web Services - WSDL: Testing with SOAP Client

Bookmark and Share Tag: web services, wsdl, soap, server Category: PHP Application Post : April 10th 2008 Read: 146,385


blog comments powered by Disqus