Web Service Toolkit

From Lazarus wiki
Revision as of 15:51, 3 May 2006 by Inoussa (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

"Web Service Toolkit” is a web services package for FPC and Lazarus; “Web Service Toolkit” is meant to ease web services consumption by FPC and Lazarus users.

Overview

“Web Service Toolkit” is made of two parts, a command line tool “ws_helper” and a collection of support units. Given an interface definition file( describing à web service ), “ws_helper” will create a FPC unit containing a proxy implementing that interface. At runtime when a call targeting the web service is issued, the proxy's role is to :

  • marshall the call paramaters,
  • make the call to the target web service,
  • receive the call return and unmarshall output parameters to the caller.

Behind the scene, the proxy will take care of the SOAP plumbing details.

Example

We will use the “google web api”, freely available for personal use at this adress “http://www.google.com/apis/”.In order to use this service, we have to translate its exposed WSDL interface to Pascal langage. By now “Web Service Toolkit” does not contain a WSDL to pascal compiler, so we will assume this translation available as below ( this is an incomplete translation, but it's enough for the sample ).

 Unit googlewebapi;
 {$mode objfpc}{$H+}
 interface
 uses SysUtils, Classes;
 Type
   IGoogleSearch = Interface
     function doSpellingSuggestion(
       const key:string;
       const phrase:string
     ):string;
   End;
 Implementation
 End.