In situations where you want to restrict access to the source code, you can also use an Interface part to access a local service. For example, you might ship services as generated Java™ classes with EGL Interface parts so that the customer can invoke the services from EGL programs. For information on Interface part syntax, see Interface part.
Interface StockQuote Function getQuote(symbol String in) returns (float); end
You cannot use an Interface part directly in your code; you must create a variable that is based on the part. At run time, the variable refers to a service that you are running from a specific location (URI).
When you access a service through an interface, the interface must be bound to the location of the service implementation with a deployment descriptor file. The deployment descriptor file describes how other applications can use a Service part from your application, and how your application uses an external service. For more information, see the EGL Generation Guide.
You can create an interface that describes the functionality that you want to have coded in an EGL service. After the interface is complete, you can code the service that implements the interface. The service must contain a function that matches each prototype in the interface. The interface is like a contract that the service fulfills.
A service can implement multiple interfaces, and multiple services can implement the same interface.
To access a Web service that is created outside of your organization, you must have the service-specific Web Service Description Language (WSDL) definition, which details how to access the service.
You use the WSDL definition as input to create an external service using the service module editor. The editor creates a service-specific Interface part through which you can access the service in your code.