Tags:
create new tag
view all tags
Just thinking. If we make TWiki a WebServices client, we could have an industry standard way of invoking the APIs in TWiki.

  1. For example, adding attachments to a page. (Though this could also be done with WebDAV)
  2. Causing a background task to be invoked (such as statistics)
  3. Getting a web (GetAWebAddOn)

Further, SoapLite can export a whole OO-perl class as a WebService. See the examples on http://guide.soaplite.com, or the following, completely fictional and not-tested example:

Now, you could use your industry standard WebServices client or even TWiki, if we implemented TWikiAsWebServicesClient. Alternatively you can roll your own client:

For (2) getting background tasks invoked:


  #!perl -w
  use SOAP::Lite;
  print SOAP::Lite
    -> uri('http://www.soaplite.com/Demo')
    -> proxy('http://services.soaplite.com/hibye.cgi')
    -> mailUpdatesAndRemoveObsoleteTopicLocks()

Now, assume for a minute that the call to &main() doesn't exist in this: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/twiki/twiki/bin/mailnotify?rev=1.14&content-type=text/vnd.viewcvs-markup

We'd have the following as the server (bits in bold are WebServices specific, the rest is out of the mailnotify script.)



#!perl -w
  use SOAP::Transport::HTTP;
  SOAP::Transport::HTTP::CGI   
    -> dispatch_to('Scheduler')     
    -> handle;

  package Demo;
  require 'mailnotify.pl';

  sub mailUpdatesAndRemoveObsoleteTopicLocks {                     
    my $dataDir = &TWiki::getDataDir();
    opendir( DIR, "$dataDir" ) or die "could not open $dataDir";
    @weblist = grep !/^\.\.?$/, readdir DIR;
    closedir DIR;
    foreach $web ( @weblist ) {
        if( -d "$dataDir/$web" ) {
             processWeb( $web ); # calls mailnotify.pl/processWeb

             # remove obsolete .lock files
             &TWiki::Store::removeObsoleteTopicLocks( $web );

        }
    }

  }


Now any client using UDDI could see that TWiki had appeared in the list of all services available on the network. And you could see that one service was available, to mailUpdatesAndRemoveObsoleteTopicLocks().

-- MartinCleaver - 11 Jun 2001

Edit | Attach | Watch | Print version | History: r8 < r7 < r6 < r5 < r4 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r8 - 2004-10-12 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.