Reputation: 988
I am curious to know about different ways of implementing web services in PHP? Is there other ways except cURL and SOAP? How SOAP is different than cURL? Is there any similarities also between them? Thanks, ursitesion
Upvotes: 3
Views: 9936
Reputation: 6896
REST or SOAP reading that might help.
Probably best to think of cURL as just a way to send a request (eg GET,POST) to another server.
There are alternatives to cURL, including just straight file_get_contents()
Edit : replaced a rotted link. Also, having used SOAP quite a lot since this first reply, I'd add that another main reason you'd prefer SOAP to REST would be if you have to absolutely, positively double check that every transaction was received, else have the opportunity to resend it. No doubt you can do this with a suitably designed REST webservice, but that would need careful design and testing.
Upvotes: 1
Reputation: 1772
You can implement a web service in PHP with SoapServer or with PHP - return JSON creating a REST interface. There are other ways, such as XML-RPC, but I usually end using either SOAP or REST, I prefer REST whenever possible.
Curl is a tool that you can use to consume a web service, it's not used to create a web service.
Upvotes: 2