PROBLEM
Rich Internet Applications (RIA) are applications that resemble desktop applications, and there are a variety of technologies for implementing RIAs. Independent of the framework or toolkit used for implementing the front-end of an RIA, all RIA applications need to access logic and/or databases that reside on the server. There needs to be mechanism to easily publish a Spring DSL service in a format that can be consumed by RIAs.
SOLUTION
Skyway Builder Web Services Edition has some accelerators for exposing the Spring DSL Services and Operations as DWR services. DWR is "a Java library that enables Java on the server and JavaScript in a browser to interact and call each other as simply as possible". The DWR functionality in Skyway Builder makes it very easy to make the functionality of Spring Services accessible to RIAs.
HOW IT WORKS
The Spring DSL services aren't automatically exposed as DWR services. The decision of exposing application logic as DWR services is left to the developer to decide based on their requirements.
Steps for publishing a DWR service:
Open the Service editor for the Spring DSL Service that needs to DWR enabled and switch to the DWR tab.
Click on the Synchronize button to refresh the DWR service meta-data from the Spring DSL service meta-data.
Under DWR Service Details, check the Publish option.
Deploy your application, and the service will be available as a DWR service.
The web service is preconfigured using common conventions for the service and operations, but the DWR tab provides some configuration options. By default all the Operations in the Service are published with DWR. If you want to exclude certain operations, you can highlight the operation in the DWR tab and check the "Exlude" option.
DWR will automatically generates some pages that can assist in
developing with DWR. The DWR Service index page lists
all the classes known to DWR. It's usefull for verifying which Spring
DSL services are or are not DWR enabled. The URL for the accessing the
index page is
http://server:port//context/dwr/index.html
Each service listed on the index page includes a hyperlink to access the DWR Service details page. The details page lists the script includes needed to use the DWR-enabled service from javascript. The name of the javascript file is specified by the DWR configuration in the DWR tab. The details page also include a listing of all available javascript methods. There should be a javascript method for every operation in the DWR-enabled service that wasn't configured to be excluded. Beside each javascript function there is an "Execute" button that can be used for testing client/server communication prior to building the front-end that used javascript functions..
RELATED RECIPES