Search code examples
phpweb-serviceswsdllocalhost

Create and consume web service on local machine by using WAMP


Is it possible to create an environment on local machine( i.e. localhost) where we can create and consume web service using PHP?

Is there any flow to create a web service like environment on localhost?

I would like to create an environment on localhost for web services where local machines, on intranet, get connected to main server (here again it's local machine) and can consume web services.

Like on internet we have Web Servers from where we can create and consume web services, Can we do the same on localhost?

Edit:

I am using WAMP with

PHP 5.3
Apache 2.*
MySQL 5
Windows 8


Solution

  • It is easy to create a local web service. You will need a local web server (like IIS or xampp) to execute PHP locally.

    Access you PHP application in your browser using http://localhost/<yourApp>.php and provide any webservice at a local URL as well, e.g. http://localhost/<yourService>.php. Your application can then access the webservice using the local URL.

    This works both for REST or SOAP-style services.

    EDIT: Your edit shows that you already set up a local environment to develop and test webservices. You should really be more specific in your question, maybe you are looking for a tutorial to create web services with PHP in genereal. If so, Google will be your best friend: https://www.google.de/#q=create+web+service+using+php+tutorial