Jump to content

Is it Important to Create a Web Service for PHP Based Application


binumathew

Recommended Posts

Ok, so we know what a webservice is. However, I don't see how it relates to better preformance.

 

If you would like your application to provide a web accessible api, then a webservice is likely what you need to create. Otherwise you don't need it.

Link to comment
Share on other sites

Means hacker priventation?? if i access that directly will it cause any problem??

 

No, an API, Application Programming Interface, is for developers to use. It has nothing to do with hackers, but one would obviously not give raw access to the database. That would be incredibly insecure and downright stupid.

Link to comment
Share on other sites

  • 2 weeks later...

Heres the deal if you have an application that you want third parties to integrate with or expose subsets of your applications functions outside of the website itself you develop an API for them to use. When you are talking about HTTP Requests based API's your talkings about Web Services.

 

Example

You have a site that sells widgets

I have a site that sells cogs. I want to sell your widgets on my site.

So you give me a Web Service I can query when I load my store to get inventory from you.

I can make a HTTP Request to http://webservice.yoursite.com with various parameters typically in an XML request.

Your API would process the request and return me a XML response I could parse and display on my site as the page loads.

 

Another Example

I use a CDN for my website. When I publish new content I can log into a web page, click around and issue a purge request OR I can write a script to call their webservices and automate the process as part of my code push scripts.

 

I dont know any better way to explain the concept of a web service. If your application does not require it you do not need it EVER. Has nothing to do with ASP, .NET, Ruby, or PHP. As stated by others its all part of the design / application requirements.

 

There is no added security or less security. If your Web Service has no authentication and the backend processing doesn't escape control characters you can be exposing yourself to XSS explots and other potential security risks (If you dont know what this means I can't help you sorry).

 

As far as performace sure its faster / easier to parse only the data you need vs. me screen scaping your site removing all the data I dont need, formating it, and displaying it. Again though to have Web Services or not is part of your application requirements / design requirements. If you dont need to expose any part of the site outside the site itself you dont need them. You really should stop using the MS IDE's. If your creating a Web Service on your own site to consume it yourself and have no intention of exposing it to anyone else your kind of doing 2x the work. Your developing a Web Services API, a Client, when you could just query the data and do the work in one shot. Not to mention your making a HTTP Request which has a DNS lookup, a SYN, an ACK, now your service is going to do its work and query the DB whatever so add all that over head to it. Now why would you add the overhead of the HTTP requests back and forth to get the data when you have DB access in your application? So the way you describe the use of webservices in the past I would have to say your loosing performance and slowing your application down. Unless its part of a AJAX widget then I can see why you would use it to middle man a request and poll for status updates.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.