|
Comments
|
Today's Top SOA Links
Workspace Web Application Development
Using WorkSpace's RAD features to call a Business Process from a Web interface
By: Ian Thain
Feb. 5, 2007 02:00 PM
In my last few articles I have tried to show how to build Business Processes (BPs) and how to use them with PowerBuilder. This article will cover how to build a simple JSF within Sybase WorkSpace to call those BPs. My engineering colleague Jean Choi wrote recently about Web application development, but my aim here is to show you, step-by-step, how easy it is.
How Easy Is It? Next, in the New Web Application Project wizard screen, Project References dialog, make sure that Servers reference is checked. Click Finish and the WAD project will be created. Now we should be in the Web Application Development Perspective and we can expand the generated project in the WorkSpace Navigator View. To automatically generate all the Managed Beans we need for our JSF in a RAD way, right-click on deployed BP in the Enterprise Explorer under MyServiceContainer and select the option to Save WSDL (see Figure 3) to the folder \webroot\WEB-INF\wsdl. A WSDL (Web Services Definition Language) document is written in XML and describes a Web service. In addition to specifying the location of the Web service, a WSDL description also specifies the methods provided by the Web service and the messages, datatypes, and communication protocols used by a Web service. Now let's create a basic JSF Web page so we can build a UI. In the WorkSpace Navigator View, right-click on the webroot folder and take the New|Web Page option (see Figure 4). For our basic example we will keep the template of the page to JavaServerFaces_Basic. Our page will be created and displayed within WorkSpace, allowing us to build it in a RAD way by the process of drag and drop onto a JSF Form from the Palette view, where you see "Drag and Drop Webpage content Here" specified (see Figure 5). For our example, our simple BP takes one input and returns an output, so we need only place an OutputText , an InputText, and a CommandButton onto the Form from the Palette by drag and drop. The Command button is there for us to call the BP. Once placed, each control property sheet allows you to change certain values such as the CommandButton text to Search (see Figure 6). Development tools at Sybase are all about ease of use and rapid application development and you've just seen how our engineers have brought drag and drop to building a Web interface. With JSF development, all interaction is processed by Managed Beans and that's another place where you'll benefit from Sybase WorkSpace. Select the Data Bindings Tab and expand so you can see the option Managed Beans | Session, then drag and drop the saved wsdl from the WorkSpace Navigator onto the Session option under Managed Beans. The New Managed Bean Wizard will appear (see Figure 7). In that instant the wsdl has been parsed, allowing the wizard to display the service name and port name, and for you the developer to select the Operation Name that you want to call, from the dropdown of exposed operations in the Business Process. If you leave this empty, by default all operations will be created. Once completed, the Managed Bean Java code has just been generated for you and is now available in the Data Bindings Tab (see Figure 8). Now we can drag and drop the input from the Managed Bean test within the Data Bindings Tab onto the InputText field, followed by the output from the Managed Bean within the Data Bindings Tab onto the OutputText field. Finally, to call the BP we can drag and drop the method invoke() from the Managed Bean onto the CommandButton. Data Binding to our JSF is now complete...so easy, I'm sure you would agree.
Deploying and Testing
Conclusion Reader Feedback: Page 1 of 1
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
|
SYS-CON Featured Whitepapers
Most Read This Week |
|||||||||||||||||||||||||||