Step 5. Publish and deploy the DataStage job as a Web service
In IIS, the process of surfacing a DataStage job as a Web service is called creating SOA services. The InfoSphere Information Services Director (IISD) is the tool that you use to accomplish this task . You access IISD through the Console for IBM Information Server.
To create SOA services, follow these steps:
- Create connection to an Information Provider.
- Create a project.
- Create an application.
- Generate, deploy and test SOA services.
- Optionally export service to WSRR.
To publish and deploy the IncidentReport DataStage job as a Web service, we created a project called, ISE_Offerings. In the ISE_Offerings project we created an application called ServDynIncReport. In the ServDynIncReport application, we created a service called GenIncidentReport. In the GenIncidentReport service, we created an operation called getIncRptByIncNum which was mapped to the IncRptFedViewParm DataStage job. The IncRptFedViewParm job is the DataStage job that generated the IncidentReport XML document.
After we created the ServDynIncReport application, we deployed it. Deploying the application made it available as a Web service. We did not do the optional step of exporting the application to WSRR.
For further discussion on the IISD tool, please refer to the InfoSphere Information Services Director documentation.
IISD supports two Information Services connection types: DataStage and QualityStage type and DB2 or Federation connection type. The IncidentReport Web service uses the DataStage and QualityStage type since the DataStage Server is its information provider. To create connection to the DataStage Server:
- Log on to the Console for IBM Information Server.
- Select Home -> Configuration -> Information Services Connections
- From the Information Services Connection page, highlight the existing DataStage Server connection and select Open from the Tasks panel. You only need to enable the connection by entering the User Name and Password. Enter the Userid who has administrative access to the DataStage server. In our case, we used Administrator.
- Test the connection as Figure 36 shows:
Figure 36. Test the DataStage Server connection
- After the connection test completes successfully, select the Save, Enable and Close button.
- From the My Home page, select the New Project button to create a project.
- On the New Project window, select Information Services type.
- Enter a project name. We created a project called ISE_Offerings as
Figure 37 shows:
Figure 37. Project lists on My Home page
To create an application under the ISE_Offerings project:
- From the My Home page, highlight the ISE_Offerings project, and select Open Project.
- From the project menu bar, select DEVELOP -> Information
Services Application :
Figure 38. Select Information Services application
- From the Information Services Application page, select New under the Tasks panel to create a new application.
- From the New Application page, enter the application name on the Name field. We entered ServDynIncReport.
- Select Save Application. At this point, you have created a
new application. Figure 39 shows the new information-service
Figure 39. New information-service application
- With the application page still open, select New -> Service to create a new information service.
- Enter a service name. We entered GenIncidentReport as Figure 40
Figure 40. New service
- Select Bindings. Click the Attach Binding drop-down.
Select SOAP over HTTP:
Figure 41. Select service binding
- From the left navigation menu, expand the Operations twistie.
Select newOperation to create a new operation. Enter a name
for the new operation. We entered getIncRptByIncNum as Figure 42
Figure 42. New operation
- Click Select next to "Select an information provider".
- From the Select an Information Provider page, select DataStage
and QualityStage in the Type drop-down list. Figure 43
shows this step:
Figure 43. Select Information Provider type
- When the "Select a DataStage Job" panel appears, keep on expanding
the relevant folder under the DSServer until you see the
IncidentReport DataStage job which is called IncRptFedViewParm.
Notice that only the DataStage jobs that have been enabled for
information services appear in this list.
Figure 44. List of information service enabled DataStage jobs
- Select IncRptFedViewParm and click OK. You will be
returned to the operation page as Figure 45 shows:
Figure 45. Map DataStage job to service operation.
- Notice the incidentNumber argument under the Inputs tab. The
IncRptFedViewParm job expects an incidentNumber parameter to be
passed into the job. It defines the incidentNumber parameter in
its Job Properties. IISD automatically detects parameters that are
defined in the Job Properties and creates corresponding input
arguments for the service operation. When a Web service consumer
calls the getIncRptByIncNum operation, it has to provide the
incidentNumber argument. Figure 46 shows the operation's input
Figure 46. The operation's input arguments
- Notice the document argument under the Outputs tab. The IISD
Output Stage of the IncRptFedViewParm is configured to return the
IncidentReport XML document to the caller. IISD automatically
detects the output parameters defined in the IISD Output Stage and
creates corresponding output arguments for the service operation.
When a Web service consumer calls the getIncRptByIncNum operation,
it can expect to receive a String data type back from the
operation. The String happens to be the IncidentReport XML
document as Figure 47 shows:
Figure 47. The operation's output arguments
- Select Save Application, then Close Application to complete the process of creating the ServDynIncReport application.
- After the application is created, the next step is to deploy the application. From the Information Services Application page, highlight the ServDynIncReport application. Select Deploy under the Tasks panel. Follow the deploy wizard to complete the deployment process.
The IISD tool provides you the functions to manage the deployed information service application. From the project menu bar, select Operate -> Deployed Information Services Application . Figure 48 shows this menu selection. From the Deployed Applications page, you can
- Undeploy the application.
- Disable the application.
- Find out the url of the WSDL file.
- Look at the WSDL file.
Figure 48. Deployed information services application menu selection
To undeploy an application:
- Select the application (that is, ServDynIncReport)
- Select Undeploy as Figure 49 shows:
Figure 549. The deployed applications page
To find out information about the wsdl file for an SOA Service such as the wsdl file for the GenIncidentReport service, follow these steps:
- Click on the twistie next to ServDynIncReport application to expand the application.
- Select the GenIncidentReport service. On the right panel,
find View Service in the Catalog.
Figure 50. ServDynIncReport application deployed view
- Select View Service in Catalog. That brings up the Service Catalog in a separate browser window.
- From the Information Services Catalog window, select Binding.
- Click the SOAP over HTTP twisty as Figure 51 shows:
Figure 51. GenIncidentReport Service binding information
- Click the Open WSDL Document link. That opens up the wsdl
document in a separate browser window. The wsdl url is displayed
on the browser’s address.
Figure 52. WSDL file for the GenIncidentReport Service
There are multiple ways to test the GenIncidentReport WebService: In our case, we tested the GenIncidentReport WebService using the Web Explorer in the RDA and RAD tools. We generated a test client for the GenIncidentReport WSDL file using the RAD tool. We also developed a portlet to call the GenIncidentReport WebService because our demo required displaying the IncidentReport XML document on the WebSphere Portal Server.
- You can use the Web Explorer in the RAD, RSA or RDA tool.
- You can use the RAD or RSA to generate a test client for the WSDL file.
- You can write your own servlet or portlet application to consume the GenIncidentReport WSDL file.