Just another Nodetraveller

Icon

Another blog about someone playing about with web development

SynTV - Public Beta

My latest project www.syntv.com is just about finished and is now out on a public beta.

SynTV provides UK TV listings in syndication formats (RSS 2.0 and ATOM) for use with desktop feed aggregators. Users can generate their own specific categories and searches and site developers are also provided for with support for HTML and Javascript. In a couple of weeks, I’ll also publish the XMLRPC web service.

If you’re interested, please check it out and give me some feedback…

UK TV Listings via XMLRPC

The UK TV Guide for Mambo component is basically a XML RPC client thats talks to the XML RPC server here at nodetraveller.com and renders the data it gets back in a nice way. The component has been released for a few weeks now and I’ve actually been using the service for a long time before that too so its probably a good time to let people know how to access it….

Because the UK TV Listings webservice is implemented using XML RPC it means anyone can access it via a XML RPC client. Read the rest of this entry »

UK TV Guide Component

I’ve just completed a component for Mambo. As you can probably guess by the name, it retreives and displays the TV and Radio listings for the UK. At the moment, there is a choice of over 60 channels and two ways of displaying the listings; columns and timeline.

I spent a bit more time on the UI than normal but finally I’m pleased with it. It works using XML RPC, connecting to my service and then displaying the listings. I hope to post more about the XML RPC service soon but I need to finish off a project before I do…

Anyway, click the link in the menu and take a look. You can also download the component here from this site or from mamboforge.

Flash TvGuide App

Okay, heres the flash client (only 47k!) for the TVguide webservice posted recently.

It’s quite a fairly simple movie using flash remoting and amfphp. I used amf to call my tvguide webservice via SOAP. Instead of having your swf call a specifc flash service, you call a special service which acts like a proxy to SOAP webservices. This service looks like this..

< ?php
// AMFPHP uses by default the PEAR::SOAP
// library, so you need to define in the
// gateway not to use that. In this case
// NuSOAP will be used

// change this based on your amfphp installation
include_once($_SERVER['DOCUMENT_ROOT'] . ‘/flashservices/app/Gateway.php’);
$gateway = new Gateway();
$gateway->usePearSOAP(false);
$gateway->service();
?>

You connect to this via NetServices..

this.netConn = NetServices.createGatewayConnection(”http://www.nodetraveller.com/flashservices/services/WSProxy.php”);

Then you specify the webservice you want by providing the endpoint to the getService method..

this.service = this.netConn.getService(”http://www.nodetraveller.com/webservices/tvGuide/tvGuideService.php?wsdl”,this);

and then call the webservice method you want…

this.service.getChannels(paramsObj);

The paramsObj is a value object holding any parameters the webservice method expects. When the data comes back you handle it the normal way..

Oh, and I had lots of fun playing about with the datagrid and creating a custom cell for it for the channel logo graphics.

Based on the Model View Architecture which works basically like this for those of you who don’t know yet:
The Model is an object that handles the remoting stuff and nothing else. It just connects to remote services and handles the data when it comes in. When the data does come in, it fires of an event to the View. The View is a listener of the Model so when the Model shouts, the View jumps. Now when the user interacts with the app, its the Controller that decides what to do; call a method on the Model or the View. Nice and easy…MVC ain’t completely perfect but its very useful…

You can see the actionscript files for the Model, View or Controller or download here

UK TV Guide Webservice

Recently I’ve been working on a webservice using PHP and nusoap. It provides information about 41 UK TV and radio programming schedule for the upcoming week.

The wsdl can be found here and example php client here.

I’m just finishing the final touches to a flash client which I’ll be posting sometime within the next couple days. Hopefully this will show how to use the webservice in your flash apps..

Webservices in Flash 2004

I’ve been playing about with the webservice connector in flash mx 2004. What I’ve discovered is that connecting to a webservice and using the data returned is really easy.

I’m using the tvGuide webservice (http://www.nodetraveller.com/webservices/tvGuide/tvGuideService.php?wsdl here at nodetraveller.com as one of the operations it provides is a list of channels which would look ideal in a listbox.

Here’s a quick guide to using a webservice:

Create a new document from a Query-Error-Response template. (This helps us with our simple example as it already sets up a webservice connector and a submit button in the form.

Click on the Webservice Connector (picture of a globe).

In the Properties panel, paste the url of the webservice WSDL in the WSDLURL parameter,and press return. Flash will now access the wsdl and find out what operations are available.

Click on the operations parameter and use the drop down to view the available operations. There should be two (getChannels and getChannelListings).

Select getChannels. For this simple example, theres no real need to use the other parameters though you can if you want. it won’t make any difference to our example.

Drag a Listbox and a TextInput component into the query Form. Name the Listbox channels_lb. Call the TextInput date. Enter todays date into the TextInput (make sure its in DD/MM/YYYY format). (strictly we should we using the response form as well but this is only an example)

Now select the webservice connector (you may have to select the application form first) and look in the component inspector (bottom right). Select the Binding tab. This is where you tell the webservice connector what to send to the webservice (and from what component) and what component to send the data to when received.

Press the + sign icon to add a binding. In the dialog that opens up, select the
date : String child of the params : Object.

Now we have to tell Flash what value to send. Select the bound to parameter and select the TextInput date in the dialog that appears. Finally change the direction parameter to “in“. What we’ve done is told Flash to get the value of the date TextInput (bound to parameter) and send it as a request to the webservice (direction parameter).

To populate the listbox with our returned data, create another binding and select
the results Array. Bind this to the listbox by configuring the bound to parameter. by selecting ListBox, and dataprovider : Array in the right hand column of the Bound To dialog . Make sure that the direction is set to “out”. We’ve just told Flash to pass the results Array received from the webservice to the dataprovider Array of the listbox. Doing so populates the Listbox.

And that’s it! And without writing any code. Test your movie and press the submit button…

You can download it here (you’ll need flash mx 2004 to view it)

This is a very simple example but I think for more complex ones, you would bind the WSConnector to a DataHolder and use the DataHolder events to notify UI components of the data change…

I feel the need for more experimentation….