DEPRECATION WARNING

This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.

XMLRPC Server

Created:2003-10-10T15:22:51
Changed:2004-05-20T11:19:04
Info 1:raul@bgta.net
Info 2:Raúl Romero
Info 3:
Info 4:

XMLRPC Server

Extension Key: xmlrpc_server

Copyright 2000-2002, Raúl Romero, <raul@bgta.net>

This document is published under the Open Content License

available from http://www.opencontent.org/opl.shtml

The content of this document is related to TYPO3

- a GNU/GPL CMS/Framework available from www.typo3.com

Table of Contents

XMLRPC Server 1

Introduction 2

What does it do? 2

How does it work? 2

Developer Manual 3

Introduction 3

Make your XMLRPC Server Page. 3

Implementations 6

Services 6

Authentification 6

Known problems 7

To-Do list 7

Changelog 7

Introduction

What does it do?

It's a spec and a set of implementations that allow software running on disparate operating systems, running in different environments to make procedure calls over the Internet.

XML-RPC diagram by JY Stervinou:

It's remote procedure calling using HTTP as the transport and XML as the encoding. XML-RPC is designed to be as simple as possible, while allowing complex data structures to be transmitted, processed and returned.

This extension is an implementation of Server side of XMLRPC.

How does it work?

It uses xmlrpc_lib , and load all methods to serve defined on the constant xmlrpc_server.services. This constant, contains a list separated extension keys.

Developer Manual

Introduction

This extension is a PAGE cObject. You can load it with TypoScript.

Make your XMLRPC Server Page.

First of all, create a new page.To create a new page use the Page module in Columns view to start the "New page" wizard - that will help you to find the right spot to insert the page:

|img-2|

Then a position selector will appear. By this you can click the right position for the page visually:

img-2

Finally a form for a new page is shown and you can enter a title of the page:

img-2

Save document and close.

Now the page tree should be updated:

img-2

Now, you would create a new Template for this page.

So what we will do now is to create a template record on the page "Root page" (or Topscorer page, or XMLRPC Server Page.....etc....). The most easy way is to use the "Template" module:

|img-2|

The next screen will show you this view from the "Template" module. You will use this for editing the template record later:

img-2

For now, look at the "Root page" with the "List" module instead:

|img-2|

As you can see there is a "Template" record located on the page "Root page".

This template record will contain the basic instructions to the frontend engine about how the website beginning from this point should be rendered, which features it has, how it is configured, etc. A template record is always needed to start any new website in TYPO3 (using the default frontend engine). However you can personally balance how much of your website design the template record will control directly; you can program a whole website directly inside a template record. You could also instruct the template record to immediately call a PHP function you have created which will render and return all the page content (based on XML, XSLT or other databases - whatever you fancy). You can also choose a middleway mixing the best of both worlds. This is what we do in this tutorial.

Looking at the content you will see these fields of specific interest:

img-2

The "Template title" is just the title of your template record - not displayed anywhere.

The "Website title" will be a prefix of the page title as found between the <title> tags of any page.

The "Setup" field is where you enter the instructions that make the frontend engine react in a certain way. These instructions are contained in a hierarchical information structure defined by the TypoScript syntax. Since the instructions from the "Setup" field is defined by the TypoScript syntax you will often find template records referred to as "TypoScript templates".

Is on this “Setup” extension, when we should escribir only this:

config.no_cache=1
# Default PAGE object:
page < xmlrpc_server

Implementations

Services

Implement a Service is to easy. Create a new empty extension. With the extension kickstarter wizard the framework for the extension can be built very easily. With the kickstarter no frontend output will be possible some further coding will be necessary.

First of all login to the backend and click on Extension Manager in the Tools module. Choose Make new extension from the drop-down menu and enter a good extension key .

Enter some general information img-2 about the extension like Title (XMLRPC > MyService), description (Description of service), category (Frontend), State (alpha), Dependencies (cms,xmlrpc_server), Author Name, Author email.

img-2

a

img-2

b

img-2

NO FILL ANY MORE! Save de extension now, Press View result

  • after the page has reloaded select Local from the Writeto locationdrop-down menu and press OK on the dialog box.
  • The page will refresh again and a statement will be shown that the Extension got copied successfully to the server.
img-2

a

img-2

b

img-2

Now, install your extension. The framework with the kickstarter is finished now, so the extension XMLRPC > MyServicecan be installed img-2

Make the updates and everything is set - so far .

img-2

a

img-2

b

img-2

Now go to your extension path (/server_root_dir/typo3_dir/typo3conf/ext/myservice/), and make a services.php file, that contains some similar to this (this is a basic Service on xmlrpc_server extension):

<?PHP
# XMLRPC Server.
#
# Default Web Services
#
if(!isset($GLOBALS{XMLRPCS})) header('Location: /index.php');

# Define the services
$GLOBALS{XMLRPCS}['methods']['Server.Status'] = "xmlrpc_server_status";



# Services Implementations

# Server Status
function xmlrpc_server_status ($params) {
        $response = $_SERVER;

        XMLRPC_response(XMLRPC_prepare($response));
}
?>

For more information, please, referer to xmlrpc_lib documentation.

Authentification

For restrinctions on XMLRPC service, we recomend to use .htaccess Basic Authentification on Apache Web Server (Sorry, I don't use IIS). If you would use FE Users of Typo3 tu Authentification, you should use mod_auth_mysql module of apache.

Known problems

To-Do list

Changelog

img-3 XMLRPC Server - 8