Transcript
8/12/2019 Quick Start Guide Web 2.0 Edition
1/51
Kap
owMashupSe
rver6.3
Quick Start GuideWeb 2.0 Edition
8/12/2019 Quick Start Guide Web 2.0 Edition
2/51
8/12/2019 Quick Start Guide Web 2.0 Edition
3/51
Quick Start GuideWeb 2.0 Edition
1999-2007 Kapow Technologies
Version: 6.3 Revision 1
8/12/2019 Quick Start Guide Web 2.0 Edition
4/51
Copyright 1999-2007 Kapow Technologies
http://www.kapowtech.com
All rights reserved.
8/12/2019 Quick Start Guide Web 2.0 Edition
5/51
CONTENTS iii
Contents
WELCOME TO KAPOW MASHUP SERVER WEB 2.0EDITION ................................. 1Installation ........................................................................................1About the Guide .................................................................................1Contact Information............................................................................1
Support ..........................................................................................1Kapow Developer Connection.............................................................1
OVERVIEW OF KAPOW MASHUP SERVER WEB 2.0EDITION ................................ 2Introduction to REST...........................................................................2
Example .........................................................................................3Mashups............................................................................................3Enter Kapow Mashup Server Web 2.0 Edition ..........................................4
KAPOW MASHUP SERVER WEB 2.0EDITION COMPONENTS AND ARCHITECTURE....... 5Robots ..............................................................................................6RoboServer........................................................................................6
Scheduler and Content Cache ............................................................6Robot Repository .............................................................................7Web server .....................................................................................7/adminweb interface........................................................................7
RoboMaker ........................................................................................7Control Center....................................................................................7Modes of Deployment..........................................................................8
DOCUMENTATION OVERVIEW....................................................................... 9User Guides .......................................................................................9Recommended Reading .......................................................................9
CREATING AN RSSFEED .......................................................................... 10Step 1 Start RoboMaker..................................................................11Step 2 Create New RSS Robot..........................................................11Step 3 Enter URL to Start From........................................................ 12Step 4 Enter Name and Description ..................................................12Step 5 Complete the Wizard ............................................................ 14Step 6 Load the page .....................................................................15Step 7 Loop over the table rows.......................................................16Step 8 Extract Title ........................................................................ 18Step 9 Extract URL.........................................................................19Step 10 Publish the robot ................................................................20Step 11 Test the robot....................................................................22Step 12 Enhance the robot ..............................................................24
8/12/2019 Quick Start Guide Web 2.0 Edition
6/51
iv CONTENTS
Step 13 Load Tip Page ....................................................................25Step 14 Extract the Description........................................................ 27Step 15 Publish your Robot ............................................................. 28
CREATING A RESTWEB SERVICE ............................................................... 29Step 1 Start RoboMaker..................................................................30Step 2 Create a New REST Robot .....................................................31Step 3 Enter URL to Start From........................................................ 32Step 4 Select Input Values ..............................................................33Step 5 Select Output Values ............................................................ 35Step 6 Enter Input Values ...............................................................36Step 7 Click Calculate.....................................................................38Step 8 Extract the Calculated Value ..................................................39Step 9 Publish the Web Service ........................................................ 40Step 10 Try out the Robot ...............................................................42
INDEX.................................................................................................. 44
8/12/2019 Quick Start Guide Web 2.0 Edition
7/51
WELCOME TO KAPOW MASHUP SERVER WEB 2.0EDITION 1
Welcome to Kapow Mashup Server Web2.0 EditionWelcome to the Kapow Mashup Server Web 2.0 Edition product suite. In thisguide you will get a brief overview of the entire product and its manuals.
Installation
Read the Installation Guide for a description of how to install the product. Thisis not covered in this overview.
About the Guide
This guide is intended as a quick and not too technical introduction to KapowMashup Server Web 2.0 Edition. It contains a short introduction to the KapowMashup Server Web 2.0 Edition product, a description of the applications inthe suite, and an overview of the available manuals. We also present a list of
recommended reading necessary to get you started with the product. Finallythe guide contains two simple tutorials, one describing RSS feeds and onedescribing REST web services. The tutorials will step by step guide youthrough the two simple cases, introducing you to the applications of KapowMashup Server Web 2.0 Edition and how they are interconnected. A very briefintroduction to REST web services is given, however it is assumed that thereader is already familiar with the basic concepts of RSS. This guide assumesthat you are running on Microsoft Windows.
Contact Information
Support
Support information is available at this page:
http://support.kapowtech.com
Kapow Developer Connection
The Kapow Developer Connectionprovides access to many resources fordevelopers. It contains the latest downloads, as well as a problem trackingsystem, and a discussion forum. It is located at this URL:
http://kdc.kapowtech.com/
http://support.kapowtech.com/http://kdc.kapowtech.com/http://kdc.kapowtech.com/http://support.kapowtech.com/8/12/2019 Quick Start Guide Web 2.0 Edition
8/51
2 OVERVIEW OF KAPOW MASHUP SERVER WEB 2.0EDITION
Overview of Kapow Mashup Server Web2.0 EditionKapow Mashup Server Web 2.0 Edition is a platform for creating mashups. Inthis chapter we will describe the meaning of that term and how Kapow MashupServer Web 2.0 Edition facilitates mashups.
Introduction to REST
REST is a concept for very simple interfaces to web services.
Some of the characteristics of REST are:
Requests are HTTP GETs All input parameters are encoded in the URL. Examples of calls to web
services that query the status of order number 117:
http://example.com/orderstatus/117http://example.com/orderstatus?orderno=117
The two calling conventions above are not synonymous - you need to knowthe convention and parameter names of the service you are calling.
The response from the web service may be in a variety of formats.Commonly used formats are: HTML, XML, CSV and JSON. And manydifferent character encodings may be supported. If the web servicesupports multiple output formats and encodings then input parameters willbe provided to select these.
Each of the output formats is suited to different needs:HTML:Easily readable by humans. HTML output is very useful for
debugging.
XML: General purpose application integration format.
CSV: Not as flexible as XML but very easy to parse. Very useful for callinga web service from Microsoft Excel.
JSON: JSON or JavaScript Object Notation is a text based representation ofJavaScript objects. Using JSON you can call a REST service from
JavaScript, for example from an Ajax application.
8/12/2019 Quick Start Guide Web 2.0 Edition
9/51
OVERVIEW OF KAPOW MASHUP SERVER WEB 2.0EDITION 3
Example
Imagine you work in an international company. One of your colleagues is ameeting organizer. He has to plan a meeting with 20 attendees from differentmajor cities. Five different cities and four different dates have been suggestedfor the meeting. One of his problems is to find the combination of venue anddate that will result in the lowest total cost of air travel.
Fortunately your company uses Kapow Mashup Server Web 2.0 Edition. Ittherefore easy for you to implement a REST web service robot that given twocities and a date as input will navigate your travel agents website and lookup
the airfare.
Your colleague can then quickly write a small Excel macro that calls this RESTservice and produce a spreadsheet that calculates the total airfare cost andfinds the optimal venue and date.
Mashups
Mashup is the process of leveraging the informational and functional resources
of the Web in an application of your choice.
There are a number of compelling reasons why such an approach would beinteresting. The first and most obvious is the sheer quantity of resources.Second, the mashup approach allows you to take advantage of existingenterprise information systems (EIS) that provide Web interfaces.
The building blocks used in mashups can be categorized as:
Widgets: Widgets are small web applications and tools designed
specifically for inclusion in mashups. Widgets provide their ownfunctionality or they provide easy access to data and functionalitythat is accessible using RSS/Atom or other lightweight integrationprotocols.
Web services: Many internet applications (like Amazon and Google)provide web service APIs (using SOAP or REST) to their corefunctionality.
Traditional web applications: The majority of all data and functionality,
especially on intranets, are not made available for immediateinclusion in mashups but can only be accessed using traditional webapplications. To include data and functionality from traditional webapplications in your mashups you would normally need to do a lot ofprogramming.
The challenges of including functionality and data from traditional webapplications in mashups from scratch should be obvious. The resources arethere, but they are notoriously heterogeneous and are often dispersed among
several pages. Another complication is the language in which the resources
8/12/2019 Quick Start Guide Web 2.0 Edition
10/51
8/12/2019 Quick Start Guide Web 2.0 Edition
11/51
KAPOW MASHUP SERVER WEB 2.0EDITION COMPONENTS AND ARCHITECTURE 5
Kapow Mashup Server Web 2.0 EditionComponents and ArchitectureThis next figure goes into more detail on the architecture and components ofthe Kapow Mashup Server Web 2.0 Edition based solution. The centralapplication in executing the mashup is called RoboServer. RoboServercontains a scheduler that executes what is called robots. We will give a moredetailed description of what a robot is shortly. For now it is sufficient to know
that to integrate with a web site you write a robot that when executedinteracts with that web site. This is illustrated in Figure 2below.
Figure 2: Kapow Mashup Server Web 2.0 Edition Architecture
RoboServer
Scheduler
Content Cache
RobotRepository
Webserver
/admin
Website
RSS
Client
REST
Client
Web browser
/admin
ControlCenter
RoboMaker
Website Website Website
RSS
Robot
RSS
Robot
RSS
Robot
REST
Robot
8/12/2019 Quick Start Guide Web 2.0 Edition
12/51
6 KAPOW MASHUP SERVER WEB 2.0EDITION COMPONENTS AND ARCHITECTURE
Robots
Robots are the fundamental concept in Kapow Mashup Server Web 2.0 Edition.A robot can be thought of as a small program that performs some sort ofinteraction or data-extraction from the Web.
The programming analogy is not wholly accurate, however. Robots can bewritten and maintained by non-programmers using an intuitive visual buildertool. By navigating the target web pages in a built-in browser the user definesthe actions that the robot will take. In this regard robots have much incommon with macros and can also be described as macros for the Web.
Robots are designed (and debugged) using the graphical applicationRoboMaker. When a robot is ready to be executed it is published to aRoboServer where it is stored in the robot repository.
RoboServer
The RoboServer contains a number of subcomponents:
Scheduler and Content Cache
The scheduler controls the execution of RSS robots according to theconfigured scheduling intervals (configured when the robots are published).After starting RoboServer RSS robots are run once their service is called andfrom then on according to the individual robot scheduling interval.
The RSS (and Atom) feeds that your robots generate are stored in the contentcache. When an RSS service is invoked by a RSS client the web server will
retrieve the RSS feed from the cache. This enables each robot to support alarge number of simultaneous RSS clients.
When an RSS client reads from the RSS feed it will read from the cache. If therobot has not run since the last time the client checked the feed then theclient will not see any new items regardless of whether the website has newcontents or not.
Thus you need to set the scheduling interval taking both the polling interval ofthe RSS client and website update frequency into account when determiningthe optimal robot scheduling interval.
The scheduling interval is set on a per robot basis when publishing the robot -i.e. when you upload the robot from RoboMaker to RoboServer for execution.
No caching is used with REST robots. REST robots are executed on demandeach time the REST service is invoked by a client application.
8/12/2019 Quick Start Guide Web 2.0 Edition
13/51
KAPOW MASHUP SERVER WEB 2.0EDITION COMPONENTS AND ARCHITECTURE 7
Robot Repository
The Robot Repository holds the published robots. Once a robot is published itsexecution is controlled by RoboServer. REST robots are executed when thecorresponding service is called.
If you want to change a published robot you make the changes in RoboMakerand re-publish the robot.
If you want to delete a robot from the repository you can use the /adminwebinterface to RoboServer.
The repository can be accesses through WebDAV athttp://localhost:50080/admin . By default no login is required for localaccess. Access from remote hosts can be enabled (setting a user name andpassword) in the Settingsapplication. This is useful for example for bulkcopying of robots between servers.
Web server
RoboServer contains its own web server. The RSS and REST clients access the
services through this web server on port 50080.
You can see the services currently available (i.e. the robots you havepublished) using a web browser at http://localhost:50080 .
dminweb interfaceUsing a web browser you can access an administrative interface to RoboServerat http://localhost:50080/admin. By default no user name or password is
required for local access. Access from remote hosts can be enabled (setting auser name and password) in the Settings application.
This interface provides statistics and log files for each robot. And you candelete a robot if required.
RoboMaker
RoboMaker is the graphical application that is used to design and debug
robots. When a robot is ready to be executed it is published to a RoboServerwhere it is stored in the robot repository.
Control Center
Control Center is an application for administering RoboServers. You can readmore about Control Center in the Control Center Users Guide. You do notneed Control Center for any of the steps in this Quick Start Guide.
8/12/2019 Quick Start Guide Web 2.0 Edition
14/51
8 KAPOW MASHUP SERVER WEB 2.0EDITION COMPONENTS AND ARCHITECTURE
Modes of Deployment
If you have not already done so, you should install Kapow Mashup Server Web2.0 Edition on your personal workstation (PC). This will install all of the abovementioned components including both RoboMaker and RoboServer. For robotdesign and debugging it is practical to have RoboServer running on your localworkstation. Hence the above references to http://localhost.
However when deploying Kapow Mashup Server Web 2.0 Edition intoproduction you will probably want to run RoboServer on a server. Fordesigning and debugging robots it is still practical to use a local RoboServer.
When the robot is ready you can publish it to the production server using thePublish on remote server function.
8/12/2019 Quick Start Guide Web 2.0 Edition
15/51
DOCUMENTATION OVERVIEW 9
Documentation OverviewThis section describes each manual in turn and finally provides a list ofrecommended reading.
User Guides
The users guides describe the applications that make up the product, one byone.
RoboMaker User's Guide: A comprehensive guide to writing robots inRoboMaker and debugging robots in the integrated debugging toolRoboDebugger.
RoboServer User's Guide: Describes RoboServer and the parameters ituses. The guide also describes the Robot Query Language (RQL) thatadvanced applications can use to communicate with RoboServer.However, it is unlikely that users of the Web 2.0 Edition will need touse RQL.
Control Center User's Guide: Describes how to monitor RoboServersand their robots using the Control Center.
Installation Guide:Describes how to install Kapow Mashup Server, howto install database connections and how to install certificates. It alsodetails the Settings application. It does not go into detail on how toset up Kapow Mashup Server for particular needs such as datacollection or mashup.
Recommended ReadingThis is the required reading for developing robots. It describes the basicworking of RoboMaker and is basic knowledge every user of the productshould be familiar with.
RoboMaker User's Guide:Introduction
RoboMaker Basics
Getting Started
Tutorial Case 1: Essentials
Tutorial Case 2: Form Submission
This should be enough to help you get started.
8/12/2019 Quick Start Guide Web 2.0 Edition
16/51
10 CREATING AN RSSFEED
Creating an RSS FeedIn the following we will assume that you already familiar with the basicconcepts of RSS. However, if you do need an introduction to RSS we suggestusing Google to find information. Try searching using the search words RSSand introduction.
To properly view the RSS feed that you will create in the following you willneed an RSS Client. Most modern web browsers can display an RSS feed so inthe following we will be displaying the feed using Mozilla Firefox to verify that
we have produced the desired feed. You will get similar results using InternetExplorer 7.
If you have not already started RoboServer then do so now. You startRoboServer from the Start menu.
The robot you will make will take the contents from a sample website that ispart of the product installation and produce an RSS feed. This websitepublishes a new Tip of the day every 2 minutes. Only the last 4 tips aredisplayed. There are only 10 unique Tips that are used in rotation but this is
sufficient to demonstrate that your RSS feed works as intended. Use a webbrowser to look at the sample web site athttp://localhost:50080/tutorial/rss.
Figure 3: Sample website for the RSS robot example
8/12/2019 Quick Start Guide Web 2.0 Edition
17/51
CREATING AN RSSFEED 11
Step 1 Start RoboMaker
First, start up RoboMaker. You can do this from the Start Menu. RoboMaker islocated in the program group Kapow Mashup Server 6.3 Web 2.0 Edition.
Step 2 Create New RSS Robot
RoboMaker presents a welcome screen that allows you to select the type ofrobot to create. Select Create a RSS/Atom feed.
Figure 4: RoboMaker Startup Wizard
8/12/2019 Quick Start Guide Web 2.0 Edition
18/51
12 CREATING AN RSSFEED
Step 3 Enter URL to Start From
We will start from the http://localhost:50080/tutorial/rsspage. Enterhttp://localhost:50080/tutorial/rssin the text field.
Figure 5: Enter start URL
Click Nextor press Enter to continue.
Step 4 Enter Name and Description
Next we will choose a name and description for your RSS feed. The wizardsuggests a name based on the URL you just entered, but in this case we will
choose another name. Enter Kapow Mashup Server Tip of the Dayin the
8/12/2019 Quick Start Guide Web 2.0 Edition
19/51
CREATING AN RSSFEED 13
Name field and a short description in the Description field, e.g. The best tipsfor using Kapow Mashup Server. The description is optional.
Figure 6: Enter Name and Description
Click Nextto continue.
8/12/2019 Quick Start Guide Web 2.0 Edition
20/51
8/12/2019 Quick Start Guide Web 2.0 Edition
21/51
CREATING AN RSSFEED 15
This will complete the wizard and create your robot. The newly created robotwill immediately load the start URL you entered
http://localhost:50080/tutorial/rss
Step 6 Load the page
First of all a short introduction is in order. What you will notice first is thebrowser-like view in the lower-left corner. That is the Page View. It displaysthe current page of the robot. The two boxes above in the Robot ViewareSteps. They define your robots interaction with the page. Currently there areonly two Steps, so the robot does little more than load the home page of thesample website.
The second step is marked green. That indicates:
The robot has executed all the previous steps. Any step inserted will be inserted (and executed) immediately preceding
this step.
Figure 8: Initially the robot has only two steps
8/12/2019 Quick Start Guide Web 2.0 Edition
22/51
16 CREATING AN RSSFEED
Step 7 Loop over the table rows
In the Browser View click on the subject of the first tip. That will select aspecific HTML tag. RoboMaker marks the selected tag with a green dashedbox. In the two views below the Browser View - the Tree Viewand theSource View- you see that the tips are organized as a tablewith a header and a body and that each tip is a row in the body.
In order to extract the tips we need to loop over the table rows in the body. Inthe Tree View click on the trtag immediately below the tbodytag.
Figure 9: The tr tag has been selected
8/12/2019 Quick Start Guide Web 2.0 Edition
23/51
CREATING AN RSSFEED 17
Now right-click on the trtag and select Loops | For Each Tag. This inserts anew step in the robot.
Figure 10: For Each Tag step inserted
8/12/2019 Quick Start Guide Web 2.0 Edition
24/51
18 CREATING AN RSSFEED
You will notice a blue bounding box in the Page View. This is shown to indicatethe part of the page we are currently looping over. We are looping over all the
tags inside the immediate surrounding tag (in this case the tag).
Each item of RSS content that we want to publish in our feed must have at
least a Title and a URL pointing to the content. Now we will extract thoseitems from the contents of the tag.
Step 8 Extract Title
To extract the news item title select the tag in the Source View and right-click on it and choose Extract Titlein the right-click menu.
Figure 11: Extract Title
8/12/2019 Quick Start Guide Web 2.0 Edition
25/51
CREATING AN RSSFEED 19
Step 9 Extract URL
Right-click again and select Extract URL to extract the URL for the item.
Figure 12: Extract URL
8/12/2019 Quick Start Guide Web 2.0 Edition
26/51
20 CREATING AN RSSFEED
Notice how selecting an action automatically generates a new step and insertsit before the current (green) step.
Also notice how the values in the Output Objecthave now been filled out inthe Object Viewin the bottom right of the screen.
Step 10 Publish the robot
We are now ready to publish the robot. Use File | Publish on Local Server.This calls up this dialog:
Figure 13: Publish the robot
C RSS F 21
8/12/2019 Quick Start Guide Web 2.0 Edition
27/51
CREATING AN RSSFEED 21
Change the suggested Service Path to just tips.
And set the Scheduling interval to 1 minute. The sample web server publishes
a new tip every 2 minutes so in order to always see the latest tips we need ascheduling interval that is shorter than 2 minutes.
Lastly click Publish.
The robot is now published and will execute every minute. RoboMaker pops upthis confirmation:
Figure 14: The robot has been published
Dont close RoboMaker yet - we will make further developments to this robot.
22 CREATING AN RSS FEED
8/12/2019 Quick Start Guide Web 2.0 Edition
28/51
22 CREATING AN RSSFEED
Step 11 Test the robot
Figure 14gives you the URL to the robots .infopage. All robots have a.infopage with brief description of the robot.
Figure 15: The .info page
CREATING AN RSS FEED 23
8/12/2019 Quick Start Guide Web 2.0 Edition
29/51
CREATING AN RSSFEED 23
Click Invoke Serviceto test the robot. The robot will output XML rather thanHTML but most browsers will be able to make sense of it. Here is the result as
presented by Firefox:
Figure 16: The RSS feed viewed in Firefox
You will notice that Firefox reports that the items have no description. We will
add that as an enhancement to the example.
24 CREATING AN RSS FEED
8/12/2019 Quick Start Guide Web 2.0 Edition
30/51
24 CREATING AN RSSFEED
Step 12 Enhance the robot
We will now enhance the robot by also putting something meaningful in thedescription of the items in the RSS feed. The description field is normally usedfor en expanded headline or a synopsis of the contents of the item. On thesample web site there isnt anything like that. Instead we will extract theactual tip and use that as the description.
Go back to RoboMaker. In the Robot View(top pane) click on the ReturnItemstep to make sure that this is the current step since we want to insertmore steps just before that step.
Figure 17: The "Return Item" step has been selected
CREATING AN RSSFEED 25
8/12/2019 Quick Start Guide Web 2.0 Edition
31/51
Step 13 Load Tip Page
To extract the contents of the tip we need to follow the link and load the pagewith the tip.
Right-click on the link to the tip in the Browser View and select Click.
Figure 18: Click to follow the link
26 CREATING AN RSSFEED
8/12/2019 Quick Start Guide Web 2.0 Edition
32/51
Figure 19: The link is followed and the new page loaded
CREATING AN RSSFEED 27
8/12/2019 Quick Start Guide Web 2.0 Edition
33/51
Step 14 Extract the Description
Now we can extract the description for the news item. Select the text thatconstitutes the tip itself, right-click and select Extract Description.
Figure 20: Select the text for extraction
28 CREATING AN RSSFEED
8/12/2019 Quick Start Guide Web 2.0 Edition
34/51
Step 15 Publish your Robot
The enhanced robot is ready. Publish and test like in steps 10 and 11. You canpublish as a second robot with a new name or you can replace the first robotby using the same name. The scheduling interval should still be set to 1minute.
When viewed in Firefox the RSS feed should look like this:
Figure 21: RSS feed with descriptions
CREATING A RESTWEB SERVICE 29
8/12/2019 Quick Start Guide Web 2.0 Edition
35/51
Creating a REST Web Service
This chapter will help you create your first REST web service. REST-style webservices are a lightweight alternative to SOAP-style web services.
If you have not already started RoboServer then do so now. You startRoboServer from the Start menu.
The robot you will produce will make the functionality of a sample website(that is part of the installation) available as a REST service. This very simplewebsite can calculate the sum of two integer numbers. The result is presented
both as a number and as a text string with the individual digits spelled out(like how you might write a check). The website has two pages: An input pageand a results page. Use a web browser to look at the sample web site athttp://localhost:50080/tutorial/rest
Figure 22: Input page of the sample website
30 CREATING A RESTWEB SERVICE
8/12/2019 Quick Start Guide Web 2.0 Edition
36/51
Figure 23: Result page of the sample web site
Step 1 Start RoboMakerThis is for the benefit of those who have jumped into the quick start guide atthis point. Of course you can skip this step if RoboMaker is already running.
RoboMaker can be started from the Start Menu.
CREATING A RESTWEB SERVICE 31
8/12/2019 Quick Start Guide Web 2.0 Edition
37/51
Step 2 Create a New REST RobotChoose to create a new REST robot. If you have just started RoboMaker thenyou can do that from the startup wizard (see Figure 4above). Otherwise, youcan choose File | Newto start the following wizard:
Figure 24: New REST Robot
Select REST web serviceand click Nextor press Enter to continue.
32 CREATING A RESTWEB SERVICE
8/12/2019 Quick Start Guide Web 2.0 Edition
38/51
Step 3 Enter URL to Start FromWe will start from the sample web site. Enterhttp://localhost:50080/tutorial/rest in the text field.
Figure 25: Enter Start URL
Click Nextor press Enter to continue.
CREATING A RESTWEB SERVICE 33
8/12/2019 Quick Start Guide Web 2.0 Edition
39/51
Step 4 Select Input ValuesDefine the names of the input values the robot takes. This robot takes twoinput values which we will call inputvalue1and inputvalue2.
Type inputvalue1in the text box and click Add. Repeat with inputvalue2.
Figure 26: Enter the names of the Input Values
Click Nextto continue to the next page.
34 CREATING A RESTWEB SERVICE
8/12/2019 Quick Start Guide Web 2.0 Edition
40/51
On this page you can fill out the sample input values that will be used byRoboMaker during the making of the robot (they will not be used once the
robot is published). Enter 42 and 117 for the two input values.
Figure 27: Fill in Values
Click Nextor press Enter to continue.
CREATING A RESTWEB SERVICE 35
8/12/2019 Quick Start Guide Web 2.0 Edition
41/51
Step 5 Select Output ValuesThe robot should return the calculated sum of the two numbers that wereprovided as input. There will be two results: A number and a text string. Wewill call them sumvalueand sumtext.
Type sumvaluein the text box and click Add. Repeat with sumtext.
Figure 28: Enter Output Values
Click Finishor press Enter to create the robot.
36 CREATING A RESTWEB SERVICE
8/12/2019 Quick Start Guide Web 2.0 Edition
42/51
Step 6 Enter Input ValuesNow the skeleton robot has been created, but it is still not configured to
handle the calculation. After loading the website input page the first thing therobot should do is to enter the input values into the two input fields.
Right-click on the input field with the caption "Integer 1" and select EnterText from Attribute | RESTInput | RESTInput.value1 (inputvalue1)from the right-click menu.
Figure 29: Enter Input Value 1
CREATING A RESTWEB SERVICE 37
8/12/2019 Quick Start Guide Web 2.0 Edition
43/51
Repeat with Integer 2 and RESTInput.value2.
Now the two temporary values 42 and 117 have been entered into the
fields (like if the robot had been called with those two actual values asparameters):
Figure 30: The input values have been entered
38 CREATING A RESTWEB SERVICE
8/12/2019 Quick Start Guide Web 2.0 Edition
44/51
Step 7 Click CalculateMake the robot click on the Calculate sumbutton: Right-click on the button
and select Clickon the right-click menu.
Figure 31: Click Calculate sum
Clicking on Calculate summakes the site calculate the sum of the two inputvalues.
8/12/2019 Quick Start Guide Web 2.0 Edition
45/51
40 CREATING A RESTWEB SERVICE
8/12/2019 Quick Start Guide Web 2.0 Edition
46/51
This places the calculated sum in the output value sumvaluewhich is returnedto the caller.
Repeat this step for the returned sumtextand extract it intoRESToutput.value2.
Step 9 Publish the Web ServiceThe robot is now complete. Click on File | Publish to Local Serverto publishthe robot.
Give your web service a Service Name and a description.
Figure 33: Publish the REST Robot
CREATING A RESTWEB SERVICE 41
f h f ll bl h d h b h f ll d l ll
8/12/2019 Quick Start Guide Web 2.0 Edition
47/51
After you have successfully published the robot the following dialog willappear:
Figure 34: REST Robot Published
Notice that REST services also have .infofiles.
42 CREATING A RESTWEB SERVICE
St 10 T t th R b t
8/12/2019 Quick Start Guide Web 2.0 Edition
48/51
Step 10 Try out the Robot
Click on the link in Figure 34to try out the web service.
Figure 35: Web Service Test Page
CREATING A RESTWEB SERVICE 43
The info file in Figure 35 can also be used to demonstrate the service
8/12/2019 Quick Start Guide Web 2.0 Edition
49/51
The .infofile in Figure 35can also be used to demonstrate the service
Enter two values (e.g. 99 and 521) and click Invoke Service. The robot
will take the input parameters, load the tutorial web site page, fill out thevalues, click on the Calculate sum button and extract the result. It will thenreturn the result as XML which will be rendered like this in a browser:
Figure 36: Web Service Result XML
Notice the URL in the browsers location field. This illustrates the syntax forpassing the input parameters to the web service.
The REST service can format the output in several ways. The XML format isthe default, but it can also return HTML, CSV text, and JSON. Every createdservice can return each of these output formats, depending on how it isinvoked. It is the intention to add more output formats in coming versions of
the product expanding the applicability of existing services
44 INDEX
8/12/2019 Quick Start Guide Web 2.0 Edition
50/51
Index
.
.info, 25
//admin, 9
WebDAV, 9
/admin web interface, 9
AAjax, 2
architecture, 5
Atom, 4
Ccache, 7
components, 5
Content Cache, 7
Control Center, 9
Control Center User's Guide, 11
Ddeployment, 10
documentation, 11
EEIS, 3
enterprise information systems, 3
Excel, 2
Excel macro, 3
HHTML, 4
HTML tag, 19
Iinstallation, 1, 10
Invoke Service, 26
JJavaScript, 4
JavaScript Object Notation, 2
JSON, 2
KKapow Developer Connection, 1
Kapow Mashup Server Web 2.0Edition, 2
KDC, 1
Mmashup, 2, 3
Microsoft Excel, 2
Modes of Deployment, 10
Ppublishing a robot, 23
Rrecommended reading, 11
remote server, 10
repository, 9
INDEX 45
REST, 2, 3, 4 S
8/12/2019 Quick Start Guide Web 2.0 Edition
51/51
REST, 2, 3, 4
example, 3
introduction, 2robots, 7
REST robot, 32
REST web service, 32
RoboMaker, 9
starting, 14, 33
RoboMaker User's Guide, 11
RoboServer, 5, 7
RoboServer User's Guide, 11
RoboSuite Installation Guide, 11
robot, 7
publish, 23
Robot Repository, 9
RSS
client, 4
feed, 4, 13
robots, 7
RSS robot, 13
SScheduler, 7
scheduling interval, 7, 24
Service Path, 24
Settings application, 9
support, 1
surrounding tag, 21
Ttag, 19
surrounding, 21
Uuser guides, 11
Wweb applications, 3
web server, 9
WebDAV, 9
top related