Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar Mark Forums Read
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 02-15-2011, 08:47 AM   #1
qw12er
Confirmed User
 
Join Date: Apr 2004
Location: Montreal
Posts: 799
PHP gurus -

What is the best way to develop webservices in PHP ?

What do you use to create your WSDL ?
__________________
I have nothing to advertise ... yet.
qw12er is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-15-2011, 09:24 AM   #2
BestXXXPorn
Confirmed User
 
BestXXXPorn's Avatar
 
Join Date: Jun 2009
Location: Asheville, NC
Posts: 2,277
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?
__________________
ICQ: 258-202-811 | Email: eric{at}bestxxxporn.com

Last edited by BestXXXPorn; 02-15-2011 at 09:27 AM..
BestXXXPorn is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-15-2011, 09:41 AM   #3
qw12er
Confirmed User
 
Join Date: Apr 2004
Location: Montreal
Posts: 799
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 ?
__________________
I have nothing to advertise ... yet.
qw12er is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-15-2011, 09:54 AM   #4
BestXXXPorn
Confirmed User
 
BestXXXPorn's Avatar
 
Join Date: Jun 2009
Location: Asheville, NC
Posts: 2,277
Quote:
Originally Posted by qw12er View Post
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 ?
For one, you could trim down that XML and return it as JSON, haaha. XML adds about 30% more data than JSON just because of all the nasty ass tags...

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
__________________
ICQ: 258-202-811 | Email: eric{at}bestxxxporn.com

Last edited by BestXXXPorn; 02-15-2011 at 09:59 AM..
BestXXXPorn is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-15-2011, 10:12 AM   #5
Alky
Confirmed User
 
Alky's Avatar
 
Join Date: Apr 2002
Location: Houston
Posts: 5,651
+1 for json
Alky is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-15-2011, 10:18 AM   #6
Kiopa_Matt
Confirmed User
 
Industry Role:
Join Date: Oct 2007
Posts: 1,448
Quote:
Originally Posted by qw12er View Post
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 ?
The 2MB restriction is just a default PHP configuration setting, and can be easily changed. If you're going to be distributing the software, then it's a hurdle you need to solve.

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.
__________________
xMarkPro -- Ultimate Blog Network Management
Streamline your marketing operations. Centralize management of domains, pages, Wordpress blogs, sponsors, link codes, media items, sales and traffic statistics, plus more!
Kiopa_Matt is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-15-2011, 10:35 AM   #7
qw12er
Confirmed User
 
Join Date: Apr 2004
Location: Montreal
Posts: 799
Thanks guys.
Really appreciated.
__________________
I have nothing to advertise ... yet.
qw12er is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks
Thread Tools



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.