How to Create a Web Service: Start to Finish – New on Premium
plus

How to Create a Web Service: Start to Finish – New on Premium

Download Source Files

There’s no two ways about it; putting together a website is hard! You need to know a myriad of programming languages (HTML, PHP, CSS, AJAX, Javascript, MySQL, just to name a few). You also must understand how to combine these tools into one cohesive whole, which is hopefully more than the sum of its parts. These days, we use frameworks, boilerplates and generators, but do you actually – when you get right down to it – know how to build a website from scratch?

Become a Premium member to read this tutorial/screencast, as well as hundreds of other advanced tutorials and screencasts from the Tuts+ network.

This tutorial is meant for those who can write a PHP function, know what jQuery is, can handle their CSS well, but would like some insider info on how a web service is built from scratch. How should I organize my files, where should I keep my functions, how should I start planning the thing, how should I connect to the database, how should I handle AJAX calls and how should I manage my 404 pages are just some of the questions I try to shed some light on here.


Introduction

The service we will be creating is called Bonsai Writer, a tool which will convert plain text into HTML. It is aimed mostly at writers but it can also be used as a note stash for more general use.

Wireframe

Become a Premium member to continue reading this tutorial, as well as hundreds of other advanced tutorials and screencasts from the Tuts+ network.

Add Comment

Discussion 28 Comments

  1. irfan says:

    is there any demo

  2. chieftrain says:

    demo for what? its a tutorial is about learning the basics for planing a web service. Take it or leave it ;)

  3. Nick says:

    that’s not a web service!

  4. Drew says:

    Awesome! Is there supposed to be a .htaccess file in the source?

    • Brad says:

      I was wondering the same, if I use the htaccess file made up of only whats in the tut I get a page full of errors. If I dont I only get one error from the index page

  5. Aslam Doctor says:

    Is this available on tutsplus marketplace ? I would like to purchase it from there :)

  6. ingo fahrentholz says:

    demo?

  7. Y8 says:

    I was also having problem on how to interpret my designs to designer cause I’ve been planning on having my own design but don’t know if they can understand what I will be dictating to them.

  8. HeatoN says:

    Sounds charming…It seems like it’s exactly what I was looking for…

  9. eratox says:

    Awesome! Just what i needed. +1 for the Pulp Fiction quote.

  10. Shane O'neil says:

    None of the “programming languages” you mentioned are even programming languages. HTML is a markup language, PHP is a scripting language, CSS is a style sheet language, AJAX isn’t even a language at all, Javascript is a scripting language, and MySQL is a relational database utilizing a superset of SQL — a query language.

  11. Ravi says:

    Good One. But Web Services are old now. WCF Services are new. I saw an example of creating a WCF Service to query database from silverlight. Here is the video
    http://www.msguy.com/2011/10/silverlight-calling-wcf-service-to.html?utm_source=BP_recent

  12. mxl says:

    Screencast…where? Maybe I’m blind or something but I was only able to download the html page.

  13. Daniel says:

    Hi Guys,

    Daniel (the author) here. Sorry about the htaccess file, it doesn’t carry through well with zip files. Take a look at the htaccess file at http://bonsaiwriter.com/htaccess.zip

  14. Gold_Dust says:

    Man make a vide tutorial out of this

  15. eek says:

    I’m not quiet sure if that what I think it is.
    I’m developing a new web-service firm, is that article is for the steps for creating a good web-site, a good online service, not quiet sure?

  16. Christian says:

    Hey guys whats up with you?
    Has anybody of you looked at the source code?
    Have you ever heard of OOP, Design-Pattern, MVC or something like Global State.
    Whats up with all the things we use for years in professional PHP development.

    I am sorry to say this, but its a total mess.
    You should never ever use something like this in a pruduction environment.

    Just me two cents.

    • Daniel says:

      Hi Christian,

      It’s Daniel, the author here. I completely agree with you, it is not intended to be used as a fully functioning web service. The easiest way to learn OOP is to learn procedural first. Also as I said in the article, this is basically an advanced wireframe.

      Whenever I start a project I create a site like this. Doing this full on with OOP takes much more time and planning but I can band something like this out in a day or so.

      As I said in the article its not just the lack of OOP that’s the problem but security and many other things are not properly implemented. This was not the point however.

      I found that when I started out in programmin that making the jump from being able to work with preset functions in WordPress and being able to actually create something on your own is the hardest. This is meant as kind of the first step in that direction.

  17. Koka Koala says:

    i can’t find it on tuts+ marktplace :(

  18. sushi says:

    where is the tuts?

Add a Comment

To add a code snippet to your comment, please wrap your code like so: <pre name="code" class="html">YOUR CODE</pre>. You can replace the class name with "js," "css," "sql," or "php." If there are any "<" or ">" within your code, please search and replace them with: &lt; and &gt; respectively.