Thursday, November 24 2005

Puakma Web Services: Getting started

Writing and using web services has never been easier. Read this article and get started building today.

Web services is an emerging technology which enables services on a remote computer to be accessed by a client. In the past this has been achieved through DCOM, CORBA and RMI (to name the most popular technologies). In the last couple of years, with the advent of XML, XML and HTTP have been used together to perform this function, in a new technology called SOAP (Simple Object Access Protocol). The main advantage of SOAP is that it is platform neutral, HTTP is a common transport system used for requesting and posting pieces of data across the Internet. When combined with XML, that adds a platform neutral way of representing the objects and requests. SOAP may also work with SMTP mail, or any transport method for that matter. Puakma currently supports only HTTP.

Puakma web services require no knowledge of SOAP. This may well be the easiest SOAP implementation on the planet.

Puakma web services require two tasks to be loaded on the server. WIDGIE and HTTP. All connections are made to the HTTP server and the request data is passed by the internal message passing interface to the Business Widget Server (WIDGIE). WIDGIE then completes the request and passes the data back to the HTTP server to be streamed to the client. Download a simple widget here.

To set up the web service, two components need to be constructed, the client and the service. Creating both is very easy and all can be set up in seconds.

Server side code

Writing your first web service is a snap. If you have written a Puakma action before, then a web service is just as easy. All you need is a simple class that extends the BusinessWidget class, then all methods you make public are automatically exposed as methods within your web service.

import puakma.system.*;
import puakma.addin.widgie.*;
import puakma.addin.http.action.*;
import java.util.*;

* A simple web service
* */

public class SimpleWidget extends BusinessWidget

protected boolean init()
//any specific init routines
//called when the widget is initially started
m_pSystem.doInformation( "Initialised", this);
return true;

protected boolean requestQuit()
//called when this widget is requested to stop
return true;

public String helloWorld()
return "Hello World";


Compile the above code and save it under the "Business Widget" section of your application (using the Puakma web design application). In a few seconds you should see the class automatically loaded by WIDGIE, making it available for access by clients. Really, that’s it, no more to do on the server side!


There are a few URLs which are useful for accessing the web services:


This command will list all the services available in this application. If you wish to return a list of all services available on the server, you can easily write your own Action code to perform this task.


This allows non-Puakma client to see the WSDL required to create a client web service for accessing the named service. Note, programmers may look at this to see the Java method declarations, which often make much more sense to humans than the reams of XML code.


This is the URL you need to POST to, to execute the web service. Puakma does not support "GETs" for accessing web services, because a HTTP GET does not pass enough information to allow the full use of these services. You may, however, write some Action code which calls the service internally.

The client

On the client side, life has never been easier. You can call the web service in two lines of code. You may also use the Puakma SOAP client software to access services on other non-Puakma servers. To access the above Business Widget service:

SOAPClient sc = new SOAPClient("http://your.server/your/app.pma/SimpleWidget?WidgetExecute", "helloWorld");

String sReturn = (String)sc.execute();
System.out.println("SOAP REPLY: " + sReturn);
catch(Exception e)
System.out.println("SOAP ERROR: " + e.toString());

The execute method returns the same object that the remote method returned, so can be easily cast as that type, for example:

byte[] buf = (byte[])sc.execute();

What data types are supported?

Puakma supports all the major primitive data types and multidimensional arrays of those types.

Java Type


















Puakma does not support complex types (eg: a "person" object). After careful investigation, it was decided that complex objects should not be represented by SOAP. To mimic this functionality, pass an XML string parameter to your methods, and have the methods reply with another XML string.

The use of Puakma web services in a production setting requires the purchase of a Puakma Enterprise license.

Recent Comments

Very cheap drugs : [url=]aciphex[/url] aciphex Thanks!
Posted by Alex53 at   on   27.Aug.08 04:36
[url=] [/url] [url=]a.b.hart and ohio [/url] [url=]abram s. hewitt [/url] [url=] text validator [/url] [url= ] super gym's fitness warehouse [/url] He put his hand to his back again. Providence, though. She puts me through my paces, I tell you. He laughed and stretched his arms. If ever I expire in the harem, DeWar, Perrund may be to blame, and yet no blame will attach. rob thomas environmental, chemistry & hazar Li made an exasperated noise. Youre humouring me I thought you at least would argue. Youre just like everybody else. Ah, I said. Jhavins hit the red, but just left it hanging over the pocket.
Posted by Gangster33 at   on   02.Sep.08 01:02
[url=] school uniforms [/url] [url=]buva . [/url] [url=] business visa [/url] su [/url] Ap- pearances can be deceiving, my fuzzy little cousin. She turned to face Jon-Tom as she stood on enormous, power- ful feet. She was as tall as he was. fat rabbit racing. His nails managed to rake the brickwork as he toppled and fell heavily down the steps, hitting the stone floor of the cellar with a lazy thud. There, sprawled, he lay still a painted giant.
Posted by Bob51 at   on   02.Sep.08 02:00
[url=] [/url] [url=] www.crime [/url] [url=]read quot .prj quot files [/url] [url=]dr. beverage plastic surgeon [/url] [url= ] easy wealth today [/url] She was staring at the blankness of the space beyond the asteroid. The asteroid circled the Dust Cloud which surrounded the Slo-Time envelope which enclosed the world on which lived the people of Krikkit, the Masters of Krikkit and their killer robots. www.jewish prayers be quot replacements ltd. quot florida cfo alex sink/department of financial services In the room of meetings she prowled back and forth, back and forth. It was a cage. She halted at the window and stared out through the grille. From there she could look over the walls around the ancient temple of Bel.
Posted by Coder28 at   on   02.Sep.08 11:07
[url=] filters coupon code [/url] [url=] [/url] [url=] [/url] [url=]historyst. packtrics day [/url] [url= ] [/url] Youve heard of it? Vaguely, I said. My mouth had gone quite dry while I wondered whether to say anything about what I had heard from Walens page and Jollisce. roofing permits quot j. quint flloyd quot With Runs to help explain, the encounter went smoothly, except that Chad and Mindy managed very little sleep since the three newcomers kept them awake long into the night with endless questions about everything from human foods to international relations.
Posted by Red43 at   on   02.Sep.08 22:09
Show all comments
Got something to say? Add comment