Special

Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 14 in printed book and digital formats -- plus a one-year subscription so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview


Buy Now

PDF:

Web Applications

Easy Web Services

Creating a Web API

Issue: 10.1 (November/December 2011)
Article Description: No description available.
Article Length (in bytes): 5,099
Starting Page Number: 81
RBD Number: 10012
Resource File(s):

Download Icon 10012.zip Updated: Tuesday, November 1, 2011 at 12:44 PM

Related Web Link(s):

http://en.wikipedia.org/wiki/Representational_state_transfer
http://www.twilio.com

Known Limitations: None

Excerpt of article text...

In issue 9.4, I commented that it would be really useful if Real Studio Web Edition could return simple data back to the client without embedding its JavaScript framework. It turns out this capability was added in Real Studio 2011 Release 2 with the App.HandleSpecialURL event.

App.SpecialHandleURL

This event allows your web application to handle specific URLs differently. These URL are ones that are within the path "/special". For example, when running locally, URLs that look like this would be handled by SpecialHandleURL:

http://127.0.0.1:8080/special/123

There is only a single parameter to this event: Request As WebRequest which will contain everything you need to process the request.

This event is incredibly useful because it essentially allows you to use Real Studio Web Edition to make web services.

Simple Web Service

We will create a simple web service that will add two numbers and return the result as XML.

First, create a web application project. In App.SpecialhandleURL add this code:

...End of Excerpt. Please purchase the magazine to read the full article.

Article copyrighted by REALbasic Developer magazine. All rights reserved.


 


|

 


Weblog Commenting and Trackback by HaloScan.com