In LSO 9.1.3 we moved the server to the Grid. There is a discovery service for LSO SDK applications (features) and Mashups that have a need to communicate with a Lawson Grid application. The discovery service reduces the configuration that needs to be added to the feature or mashup, e.g. no System Profile information needed in the manifests. This also means that there will be less work for the installer/administrator to configure installed applications. The discovery service can be used to retrieve the base URL to the Lawson Grid Application.
There are currently three types of URLs that a Grid application can expose. All URLs are relative to the context root and not to specific services.
- Web Service
- Rest Service
- Web Application
To retrieve a URL to a Grid application in a feature or mashup the following parameters must be specified:
- Grid Application Type
- Grid Module Name
- Grid Application URL
These parameters can be hardcoded because they are hardcoded in the Grid application as well.
Normally a Grid application cannot be installed several times in the same Grid. If an application can be installed mupltiple times in the same grid (should be very seldom) it is possible to use the Grid Application Name as well when querying for a URL.
Application Type, Module and URL Type can be found at the Grid Info page (web based).
Grid application discovery
When LSO starts up it will go through the grid information (https://server/grid/info.xml) where the LSO server is installed and internally store all grid application URLs. Grid applications that are located in another grid than the LSO server can be configured in the LSO System Profile using the External Grids profile value. Information from each additional Grid will be added to the list of Grid application URLs. If the same Grid application is installed in multiple Grids, LSO will use the application that is found first. Grid applications that exists in the same Grid as the LSO server will always be first in the list. Grid applications from additional Grids are added in the order that the additional Grid URLs are specified in the System Profile.
Administration
Additional Grids are configured in the Profile Editor in the field External Grids profile value in the SmartClient section.
Features
Two methods have been added to the ISystemProfile interface: GetGridApplicationURL and GetExplicitGridApplicationURL.
The method GetGridApplicationURL takes three parameters and looks like this:
string GetGridApplicationURL(string gridApplicationType, string gridModuleName, string type);
Example on how to use it:
string url = ApplicationServices.SystemProfile.GetGridApplicationUrl(“MI-WS”, “MI-WS”, GridUrlType.WebService);
The Grid Application Type and Grid Module Name can be found in the Grid tooling in Eclipse or on the Grid info page (see picture above). Use the static members on the GridUrlType class when specifying the URL type.
Note that the URL returned is only the base URL to your application and you probably need to add an additional path to the URL before using it, for example a REST path or a servlet name.
The GetExplicitGridApplicationURL method should only be used for Grid applications that can be installed more then once in the same grid. Scaling out is not the same thing as installing an application more than once because logically that is the same application, but the execution is distributed over several nodes. So far I have not seen any Grid application that can be installed more then once, but the method is there if the need arise.
Web Service
If you are currently calling web services using the WSHelper class from the Smart Office framework it is very easy to change your implementeation to use the discovery service. This means that there is no longer a need for having an entry in the system profile.
WSHelper has been extended with a method that will automatically retrieve the base URL. The endpoint must of course still be specified.
Here is an example on how to use the new method:
MIAccessWSClient client = WSHelper.CreateClient<MIAccessWSClient, MIAccessWS>(“MI-WS”, “MI-WS”, null, “MIAccess”, true);
When the fifth parameter (getUrlFromGrid) is set to true, the first parameter is interpreted as Grid Application Type and the second parameter is interpreted as the Grid Module name. The third parameter is the Grid Application name and it should be null in most cases. The only time the parameter is required is when the Grid application can be installed more than once.
The fourth parameter is the web service name.
Mashups
There is a new markup extension called GridUrlExtension in the namespace Mango.UI.Services.Mashup that can be used to retrieve Grid URLs in XAML.
The mandatory properties are ApplicationType, Module and UrlType. Optional properties are ApplicationName, Service and DefaultValue. The Service property can be used to append the service name to the URL that is retrieved. The DefaultValue property can be used to specify a URL that should be used if no Grid URL is found.
The examples below show how to use the GridUrlExtension in XAML to show the values in TextBoxes. A more realistic example could be to configure the RestDataService with the URLs to a Grid REST application.
<TextBox Text="{mashup:GridUrl ApplicationType=LSO, Module=LSO, UrlType=Web Service} "/>; <TextBox Text="{mashup:GridUrl ApplicationType=MI-WS, Module=MI-WS, UrlType=Rest Service, Service=MIAccess}" />; <TextBox Text="{mashup:GridUrl ApplicationType=LSO, Module=LSO, UrlType=Web Application} "/>;
Pingback: Mashups, SOAP WebServices and SAML | Potato IT
Pingback: Mashups, SOAP WebServices and SAML | Potato IT