Lesson 1: Create an EGL web project for the service
EGL projects can act as services, as clients, or as both simultaneously. For this tutorial, you will create two projects: one to act as the service and one to act as the client. While you could put all the code into a single EGL project, using two projects demonstrates how EGL can call services in another application.
About this task
Procedure
Results

Create the interface to define the service
About this task
For
example, suppose you needed to write an application that performed
mathematical operations like a calculator. You might start by listing
all of the mathematical operations your application would need (such
as addition, subtraction, and multiplication), without actually writing
the code to perform these operations. In this case, you would name
each operation and specify each operation's input and output parameters,
but you would not start coding any logic. In this way, you would be
listing the functions that the EGL service application would need
in an interface. Such an interface might begin like this:
interface myCalculatorInterface
//Function to add numbers together
function addNumbers(number1 decimal(10,2) in,
number2 decimal(10,2) in) returns (decimal(10,2));
//Function to subtract numbers
function subtractNumbers(number1 decimal(10,2) in,
number2 decimal(10,2) in) returns (decimal(10,2));
endThen, when you are ready to begin coding the service, you can use this interface both as a starting point and as a test to make sure you are following your plan.
You will rarely
be required to write an interface, but in general, using interfaces
to describe your services is good programming practice:
- The interface lets you plan the service ahead of time, and EGL warns you if the service deviates from the interface.
- Interfaces provide a concise summary of a service, explaining what the service can do without providing all of the details of the service's implementation.
- Interfaces can serve as requirements for development or compliance.
Procedure
Results
Following are some technical details about the code you
just entered:
- As explained above, this is not a complete piece of EGL logic.
Instead, this function prototype describes a function that
will be in the service. In this case, the prototype describes a function
named
SayHello. - The function accepts two pieces of input from the client, called parameters:
- A string variable for a person's name
- A string variable for a city
- The code
returns (string)indicates this return value and its type.
The interface looks like this:




