PHP Web Services Novice

What is the best way to implement web services in PHP?

I heard about libraries like NuSOAP and WSO2 web services platform, but don’t know which is better (or good and easy to learn) for using web service in PHP?

+4
source share
4 answers

SOAP, of course, is NOT the ONLY way to implement web services. If you are open to other paradigms, check out REST .

Unlike SOAP (which has several standards / providers), REST is an agnostic of both the provider and the protocol. Instead, RESTful web services are implemented using these recommendations (from the Wikipedia article):

The RESTful web service (also called the RESTful web API) is a simple network service implemented using HTTP and REST principles. Such a web service can be regarded as a collection of resources. The definition of such a web service can be considered as including three aspects:

 * The base URI for the web service, such as http://example.com/resources/ * The MIME type of the data supported by the web service. This is often JSON, XML or YAML but can be any other valid MIME type. * The set of operations supported by the web service using HTTP methods (eg, POST, GET, PUT or DELETE). 

Back to PHP, here is a reference guide for implementing ZendFramework REST Server functions.

In addition, here is a link to another answer that I gave in this link, useful information about ZendFramework and REST.

+3
source

With PHP 5, PHP has a built-in SOAP library. I usually use built-in libraries, not PHP implementations, as they tend to be faster and more stable.

One library that I used when I don’t use the built-in is Zend_Soap , which is built on top of the built-in SOAP and makes it easier to work with.

+2
source

You can choose WSDL + SOAP to create your web services or implement RESTful web services. In any case, you need to understand what web services and core components are. To me, REST seems more efficient.

Here is an example based on Delicious .

+2
source

Check out the PHP and web services presentation , which covers SOAP, REST, and JSON.

+1
source

All Articles