Code Samples

We provide sample code and ready-to-use client libraries in Java (via SOAP) and PHP (via SOAP) currently.
Samples for JavaScript (via JSON) and Python will follow.

If you did a client for a new platform or platform/protocol combination, let us know. We will be happy to put it up on this page.

Java

In Java 6, you can use our interfaces, JAX-WS and Apache CXF to create dynamic SOAP clients for the individual Reaktor components. It's very convenient, look:



	String SERVICE = "http://txtr.com/WSAuthService/WSAuth";

	JaxWsProxyFactoryBean jwpfb = new JaxWsProxyFactoryBean();
	jwpfb.setAddress(SERVICE);
	jwpfb.setServiceClass(IWSAuth.class);
	IWSAuth service = (IWSAuth)jwpfb.create();
	String token = service.authenticateUserByName("test", SHA1.hash("test"), false);

	// do stuff with other services, to be obtained in the same way

	service.deAuthenticate(token);

Here's what you need:

PHP

We have some PHP demo code, along with a "Reaktor" class that provides the most commonly-used Reaktor API methods. It requires the PHP SOAP extension. (Have a look at phpinfo() to see if it's there when in doubt.)

If someone would be willing to re-implement the Reaktor class with plain REST calls, we'd be happy to assist. Please get in contact.

You can download the demo code here.