Creating a New Web Services (SOAP) Application

Creating a New Web Services (SOAP) Application
In addition to database-driven applications, you can also create applications that interact with Web services. This chapter shows you how to generate an application against a SOAP service. To keep things simple, we create this as a separate application, but you could easily add this SOAP service to your existing database application.
Before You Begin
Before you begin, closed all open projects (Project > Close Project) and files (File > Close All).
Understanding your WSDL File
In order to create an application based on an external Web service, you need to understand the service that you want to access. SOAP services are defined in WSDL files, which you can view and edit in the Web Services Editor. At a minimum, you need to know:
The input message for each operation you want to access, including all the message parts, their types and appropriate settings
In this tutorial, we create an application that includes a Google search operation. Google publishes the WSDL file, along with the relevant documentation, here:
http://www.google.com/apis/
Look at the documentation that Google provides for the Web service and get a Google license key.
Create a New Application
To create a new Web Services application, follow these steps:
1.
Select the File menu option then, select New.
2.
In the New dialog box, leave New Project selected.
3.
Under Type, select From Service and then click OK (Figure 1).
Fig. 1 Create a New Project
4.
Click Next. The Choose a Service screen appears.
5.
Select The GoogleSOAPService service from the list and click Next (Figure 2).
Fig. 2 Choose a Service
6.
The Choose Operations screen appears. Click to uncheck the doGetCachedPage operation and the doSpellingSuggestion operation (Figure 3).
Fig. 3 Choose Operations
7.
Click the Customize... button next to the doGoogleSearch operation check box.
The Pick Message Parts screen appears (Figure 4).
Fig. 4 Pick Message Parts Screen
Here you select the Message Parts that you want to include in the service call. By default, all the Message Parts are selected.
8.
Leave the defaults and click Next. The Configure Message Parts screen appears (Figure 5).
Fig. 5 The Configure Message Parts Screen
9.
Make the following selections in the Configure Message Parts screen:
 
 
type in the license key that you got when you downloaded the Google Search WSDL
Form Input
 
 
 
 
 
 
 
 
 
 
 
 
10.
Click Next. The Pick Message Parts to Include in Result screen appears. This screen allows you to configure what you’re going to display in the search results page.
11.
Fig. 6 Configure Results Page
12.
The Name the Pages screen appears. In the Result Page Name field, enter:
SearchResults
13.
In the Request Page Name field, enter:
SearchRequest
14.
Click Finish (Figure 7).
Fig. 7 Name the Pages
15.
Back on the Choose Operations screen, click the Next button.
16.
The Page Settings screen appears. Enter the following settings:
In the Title field, enter:
Web Search
In the Footer field, enter:
Powered by Google.
Fig. 8 Page Settings
17.
Click Next. The Skin Settings screen appears.
18.
Leave the default skin settings and click Next. The Name and Location screen appears.
19.
Leave the default file Location and in the Name field, type:
WebSearch
20.
Click Finish (Figure 9).
Fig. 9 Enter a Name and Location
21.
The ActiveGrid Studio generates a project file, called WebSearch.agp, a Page Flow file, called WebSearch.bpel, and other necessary files for the new application. All the files are listed in the Project Panel.
22.
Double-click on the Page Flow file, WebSearch.bpel. The Page Flow appears in the Page Flow Editor (Figure 10).
Fig. 10 The Page Flow
To run the application, right-click in the Page Flow Editor and select Run Process from the pop-up menu. The application runs (Figure 11).
Fig. 11 The Running Application

ActiveGrid
ActiveGrid Studio Tutorial
Version 2.0