Welcome!

SOA & WOA Authors: Peter Silva, Maureen O'Gara, Tony Bishop, Mark O'Neill, Yeshim Deniz

Related Topics: SOA & WOA

SOA & WOA: Article

WebFace & WebFace Studio by Vultus

WebFace & WebFace Studio by Vultus

As Web services proliferate and more and more applications expose their business logic in this manner, the need for effective user interfaces to consume these services grows. WebFace and WebFace Studio, from Vultus, provide a means of creating rich, Windows-like user interfaces distributed in a browser for Web services. The interface behaves like a traditional client/server application and does not require browser refreshes. The technology is built upon XML, HTML, and JavaScript, and requires that the user be running at least Internet Explorer 5.0. For this review, the focus will be on WebFace Studio and the development process.

Development in WebFace Studio
WebFace Studio is an IDE that provides a graphical environment in which to build applications using an event-driven model. The user interface itself, and each of its controls, comprise an XML document following Vultus' WebFace Application Markup Language (WAML) specification. At runtime, client-side WebFace JavaScript libraries interpret the XML document to paint the windows and controls for the user in the browser.

To start developing an application, the SOAP Application Builder wizard is executed. From an existing WSDL specification, the wizard generates a basic set of display, data, and communications components, along with supporting code to execute the service and display its results. As an example, I've created a simple Web service that allows you to manage your gym workouts. To demonstrate the wizard, I have requested it to generate the components necessary to retrieve a specific workout definition from the system. Figure 1 shows the results of the operation.

 

The parameters of the request include a workout ID and a user name and are shown by the two text boxes on the left side of the generated window. The result is an XML document that defines a specific workout and will be placed in the text box located in the right portion of the window.

Behind every GUI component or combination of components that display data is a DataSet object. These DataSets are part of WebFace's Model-View-Control (MVC) architecture and function similarly to the Java Swing GUI components and their models (i.e., JTable and DefaultTable Model). In the case of the workout ID and username text boxes, a DataSet with one row and two columns (one for each field) exists behind the scenes. This DataSet is the source of the data for the SOAP call, not the controls themselves. To establish a relationship between the DataSet and the controls, a DataController object is defined. This ensures that changes to the data in the DataSet are reflected in the controls and vice versa.

The workhorse of WebFace applications is the Task object. Several types of tasks exist within WebFace:

  • Load Task: Retrieves partial WAML documents from a host server. This may be used to request GUI components on demand.
  • Open Task: Retrieves a complete window document from a host server.
  • Search Task: Executed to retrieve data from a server, for example the result of a Web service.
  • Submit Task: Submits data to the host server with no returned data.
  • Conduit Task: Allows data to be transferred between DataSets.
  • Window Conduit Task: Allows data to be transferred between DataSets across WebFace windows.

    All tasks may be executed synchronously or asynchronously depending on the process requirement. A Task object contains the definitions of and source control references for the input parameters, the destination control references for its results, and the operations that it must perform.

    In the workout example, the SOAP wizard created a Search Task to execute the appropriate Web service for retrieving the workout definition. When the submit button is clicked, the associated onClick event executes the Task to retrieve the data. The resulting XML document is displayed in the output textbox.

    While tasks handle data associated with the request/response of service calls, a Request Broker object handles the details of the communications process. Three broker types may be used in WebFace: Local, SOAP, and HTTP. The Local broker may only be used in conjunction with an Open Task to retrieve a window definition from the local machine. The remaining tasks may be used to execute remote services either via SOAP calls or HTTP calls.

    In the workout example, the result of the Web service call is an XML document that is displayed in a text box. In order to work with the data, however, a more sophisticated view of the information, such as a grid, must be presented to the user. To accommodate a grid display, a DataSet must be defined to hold the information. Figure 2 shows the DataSet Editor dialog in WebFace Studio. This allows the developer to specify the columns and rows for the data grid. Constraints may be placed on the data, including data types, whether a value in a column is required, or its nullability. Once the DataSet is defined, a DataController is created to link the DataSet to the display grid.

     

    To populate the new DataSet, the information from the XML document produced by the Web service must be mapped appropriately. Recall that WebFace windows and their controls are themselves XML documents. Therefore, an XSL stylesheet may be used to transform the result of the Web service into the appropriate DataSet object (note that parameters for a request are also transformed via XSL stylesheets from their source DataSets into the service call). To assign a stylesheet to perform the transformation, the task is edited to include an xsltReplyTranslator that points to the desired XSL stylesheet. Figure 3 is a new window created in WebFace Studio that leverages the communications components and input fields created by the SOAP Wizard, but with the output transformed by an XSL stylesheet to fill a data grid.

     

    As mentioned earlier, WebFace applications are event driven. Event handlers and all supporting code are written using JavaScript. In the WebFace Studio IDE, the developer may switch to the source view of the window to reveal the WAML document. From here, the CDATA element of the customCode tag may be edited to include any supporting JavaScript. All controls created are accessible as objects from the JavaScript code and may be manipulated or inspected at runtime. To wire an individual event handler to a control, the function name is assigned to the desired event in the properties editor for the control.

    Deploying Applications
    WebFace Studio provides a wizard to deploy applications for testing. The wizard may be used to deploy locally or remotely to a server. The local deployment simply copies the application files to a local directory on the developer's machine. Internet Explorer may be pointed to this directory using a file URL to launch the application. For server deployments, the destination machine must provide FTP write access. At deploy time, the application's configuration files are updated to reflect the runtime environment.

    Summary
    WebFace and WebFace Studio from Vultus provide the means to deliver rich, Windows-like user interfaces for Web services to a browser. By leveraging XML, HTML, and JavaScript they negate the need for browser refreshes when executing service calls and manipulating data. It does require some time to become comfortable with the development environment and the relationship between the various controls and components, but once acclimated, application development is relatively straightforward. For Internet Explorer-based applications, the WebFace product suite from Vultus is a good alternative.

    Company Info
    Vultus, Inc.
    355 South 520 West, Suite 150
    Lindon, UT 84042

    SALES
    sales@vultus.com
    801.852.0880

  • More Stories By Brian Barbash

    Brian R. Barbash is the product review editor for Web Services Journal. He is a senior consultant and technical architect for Envision Consulting, a unit of IMS Health, providing management consulting and systems integration that focuses on contracting, pricing, and account management in the pharmaceutical industry.

    Comments (0)

    Share your thoughts on this story.

    Add your comment
    You must be signed in to add a comment. Sign-in | Register

    In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.