Page 1 of 1

Sample code for super simple PHP based (SOAP) webservice?

Posted: Mon Apr 20, 2009 6:46 am
by pstein
I would appreciate to get super simple PHP code on how a webservice can be implemented with PHP).

Assume a MySQL database is setup and contains a SQL table with the following columns:

ZIPCODE INTEGEER
CITYNAME VARCHAR
NUMCITIZENS numeric
WATERSIDE BOOLEAN

Now lets say a client is sending a SOAP webservice message to the XAMPP based web server with the ZIP code in the request data.

PHP should lookup the record in the MySQL database and return CITYNAME,
NUMCITIZENS and WATERSIDE values to the requesting webservice client.

How would such a PHP code look like (only server side is of interest)?

Thank you
Peter