I am completing a website that I have developed in object oriented PHP.
It would be great if I could open my Application up to Windows Phone (because I love look and feel of the platform).
I have explored opening my application up by making use of the PHP SoapServer class. I’ve also looked at REST and retrieving data for my application as JSON, but it feels like a bitty solution.
Therefore, I would like to ask for advice on the following:
- Is the SoapServer class the de facto technique for opening a PHP application up so that another platform (Windows Phone) can make use of it’s classes/functions? Or are there other ways that I should consider “opening” my application up?
You can do several things, but the most used are the two you mentioned: SOAP and REST. There is no de facto standard. To be clear, because we are talking API here, there is no real difference between the fact you are using PHP (much less if it is object oriented or not), apart from how easy it is to handle your selected method server side.
I’m not a big fan of SOAP myself, especially in PHP. The support is not very good, but my experience in this is mostly in consuming SOAP, not serving it. Much of the advantages you get from reading your stuff from the .wsdl are gone if you cannot auto-import them // auto-create your classes, and the default SOAP implementation is a little too fond of just saying “segmentation error” in some cases.
That being said, your 2 choices are roughly devided by
Personally I would choose a REST system in this environment. You can make your REST environment serve XML just as wel ofcourse, if you don’t like JSON.