![]() |
PHP gurus -
What is the best way to develop webservices in PHP ?
What do you use to create your WSDL ? |
I'm going to assume by webservice you're referring to some sort of API.
RESTful interface all the way... WSDL wise... I've always created a custom API docs layout that gets updated. I hate trying to conform to some theoretical industry standard that not too many people actually follow. I feel like too much time is wasted trying to conform rather than creating a usable product that's customized to your target audience ;) JSON all the way for transport format... Every language has a JSON lib / function collection these days. It's much less verbose, allows much more logical data structuring, and is super easy to implement. As far as the best "way" to develop the service it really depends on the requirements. One common problem I see with startups and smaller companies is the scalability factor with blocking code paths. If you have complex jobs that require a lot of processing power you should not return the results of the query but instead return a token/hash/id for the job so that subsequent requests can be made to check/retrieve the result. Does that answer your question / point you in the right direction? |
Yes it does. Thanks.
I still have a question. I need to pass large amount of XML data between my flash app and my php server. For what I know of RESTful rellys on post/push http methods which have a limit of 2megs (if I'm correct). So how do you pass large amount of data with the RESTful approach ? |
Quote:
There is no limit, as far as I know, to the amount of data you can return however you may run into some usability problems. I wouldn't recommend returning an XML file that large at all. Not only is the wait time pretty obscene but that's a lot to parse at once for any client... particularly one that depends on a client machine (flash). I would probably break the request into smaller requests... Let's say you were returning some data to populate a year long chart. You could make a request per month and parse/populate that data while retrieving the next set... It's really hard to say without knowing the specifics though, everything is so situational dependent ;) Edit: On the limits... that can be adjusted via your PHP conf... I think you may be referring to the 2MB default configuration for max post size. Really, that's for the amount of data aloud to be posted TO the server though, not sent from the server on a post request; and it's configurable so you should be good :) |
+1 for json
|
Quote:
Depends, is the server uploading / sending 2MB+ of data, or is the client application downloading it? If it's the latter, than no worries, and that restriction doesn't apply. If it's the former, then best I can suggest is develop your service to send a download token to the client, triggering the client to send a request and download / process whatever needed data. And yep, I'll second REST. Stay away from WSDL / SOAP. Although, will disagree with XML not being useful though. I think it's excellent, especially with large data sets. |
Thanks guys.
Really appreciated. |
All times are GMT -7. The time now is 10:16 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc