accelerate web and soa development with ibm rational...

31
Accelerate Web and SOA development with IBM Rational Business Developer extension Exploit EGL, the newest and most advanced business language By Reginaldo W. Barosa TechWorks Practice Lead Enterprise Modernization IBM Corporation Level: Introductory February 2008

Upload: others

Post on 17-Sep-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Accelerate Web and SOA development with IBM Rational ...public.dhe.ibm.com/software/dw/rational/pdf/rdz_rbde...Bear in mind that, in SOA, the services are stateless; they do not "remember"

Accelerate Web and SOA development with IBM Rational Business Developer extension

Exploit EGL, the newest and most advanced business language

By Reginaldo W. Barosa TechWorks Practice Lead Enterprise Modernization

IBM Corporation

Level: Introductory

February 2008

Page 2: Accelerate Web and SOA development with IBM Rational ...public.dhe.ibm.com/software/dw/rational/pdf/rdz_rbde...Bear in mind that, in SOA, the services are stateless; they do not "remember"

Accelerate Web and SOA development with Rational Business Developer Extension, Page 2 of 31

Copyright © 2008, IBM® Corporation. All rights reserved. Published by IBM® developerWorks®.

Contents

Create Web services with EGL ....................................................................................... 3 Tools and architecture in these examples ................................................................... 3 What you will learn from this article ............................................................................. 4

Build the Web service...................................................................................................... 4

Create an EGL Web project for Web services................................................................. 4 Use the correct workspace for these tasks .................................................................. 4 Create the service business logic ................................................................................ 8 Set up the service as a Web service.......................................................................... 10

Create an EGL program to debug the created service.................................................. 16 Generate the WSDL file............................................................................................. 20 Test the Web service interactively ............................................................................. 22

How to import the Solution project ................................................................................ 29

Trademarks ................................................................................................................... 30

Resources ..................................................................................................................... 30

About the author............................................................................................................ 31

Page 3: Accelerate Web and SOA development with IBM Rational ...public.dhe.ibm.com/software/dw/rational/pdf/rdz_rbde...Bear in mind that, in SOA, the services are stateless; they do not "remember"

Accelerate Web and SOA development with Rational Business Developer Extension, Page 3 of 31

Copyright © 2008, IBM® Corporation. All rights reserved. Published by IBM® developerWorks®.

Create Web services with EGL

This article shows you how to build and test a simple Web service using IBM® Rational® Business Developer extension, which supports service-oriented architecture (SOA). SOA is a method of organizing applications in modular pieces (called services and clients). The services provide logic to the clients in the form of functions, similar to the way that Enterprise Generation Language (EGL) libraries make functions available to programs.

Tools and architecture in these examples The examples in this article use Rational Business Developer extension installed on top of IBM® Rational® Business Developer for System z™, but they will also work by using Rational Business Developer extension installed on top of IBM® Rational® Application Developer and IBM® Rational® Software Architect. Bear in mind that, in SOA, the services are stateless; they do not "remember" interactions with a particular client. In this way, each time the service is called, it is as though that service is being used for the first time. Services are also able to provide their functions to a wide variety of applications through the Web Services Description Language (WSDL) standard, promoting flexibility and code reuse, as shown in Figure 1. Figure 1. Rational Business Developer extension services in SOA

Page 4: Accelerate Web and SOA development with IBM Rational ...public.dhe.ibm.com/software/dw/rational/pdf/rdz_rbde...Bear in mind that, in SOA, the services are stateless; they do not "remember"

Accelerate Web and SOA development with Rational Business Developer Extension, Page 4 of 31

Copyright © 2008, IBM® Corporation. All rights reserved. Published by IBM® developerWorks®.

What you will learn from this article By completing the exercises in this article, you will build an EGL Web service. At the end of this section, you should be able to test the Web services that you have created and deployed to Apache Tomcat Application Server.

Build the Web service

You will create a simple Web service that uses EGL. The service accepts two fields that perform an add operation and return the results. In other words, you will do a simple calculation that will demonstrate how easy it is to create and deploy Web services using EGL. In your company, the business logic will be more complex than this one. These are the steps that you will perform in this section:

1. Create an EGL Web project that will hold the Web services. 2. Create the service: Here, you will create a new EGL Service file. 3. Set up the service as a Web service, and generate the Java code. 4. Create and debug an EGL program to invoke the service for a simple test. 5. Generate the WSDL. 6. Deploy the Java™ code and test it using the WSDL-generated code.

Create an EGL Web project for Web services

This example assumes that Rational Developer for System z is already started. Note that you are operating under VMWARE, which may slow response time.

Use the correct workspace for these tasks

For this article, you will need to switch to another workspace, because these tasks have been designed to use a customized workspace to save you time.

1. To switch to the customized workspace designed for the use of Rational Business Developer extension in this article, click File and select Switch Workspace, as shown in Figure 2.

Page 5: Accelerate Web and SOA development with IBM Rational ...public.dhe.ibm.com/software/dw/rational/pdf/rdz_rbde...Bear in mind that, in SOA, the services are stateless; they do not "remember"

Accelerate Web and SOA development with Rational Business Developer Extension, Page 5 of 31

Copyright © 2008, IBM® Corporation. All rights reserved. Published by IBM® developerWorks®.

Figure 2. Switch to this workspace

2. When the Select a Workspace dialog displays, type C:\Workspaces\RBDe in the Workspace field and click OK, as shown in Figure 3. Be patient, because this operation will take longer than usual under VMWARE. It may take one or more minutes.

Figure 3. Specify workspace location

Page 6: Accelerate Web and SOA development with IBM Rational ...public.dhe.ibm.com/software/dw/rational/pdf/rdz_rbde...Bear in mind that, in SOA, the services are stateless; they do not "remember"

Accelerate Web and SOA development with Rational Business Developer Extension, Page 6 of 31

Copyright © 2008, IBM® Corporation. All rights reserved. Published by IBM® developerWorks®.

3. This switches your workspace. If the Welcome page displays, close it by clicking the , as shown in Figure 4.

Figure 4. Closing the Welcome page

4. To create a new EGL Web project in the Workbench, click File > New > Other (or Ctrl + N).

5. Type egl in the Wizards field, select EGL Web Project, and click Next, as

shown in Figure 5.

Figure 5. Select a wizard

6. Name the project LAB7WebService, select Apache Tomcat v5.5 as the Target Runtime, and click Finish, as shown in Figure 6. (Again, be patient, because this may take a while under VMWARE.)

Page 7: Accelerate Web and SOA development with IBM Rational ...public.dhe.ibm.com/software/dw/rational/pdf/rdz_rbde...Bear in mind that, in SOA, the services are stateless; they do not "remember"

Accelerate Web and SOA development with Rational Business Developer Extension, Page 7 of 31

Copyright © 2008, IBM® Corporation. All rights reserved. Published by IBM® developerWorks®.

Figure 6. Specify project options

7. You need to continue in the Web perspective; therefore, if the Confirm Perspective Switch dialog displays with a message asking if you want to switch to the J2EE perspective, click No, as shown in Figure 7.

Page 8: Accelerate Web and SOA development with IBM Rational ...public.dhe.ibm.com/software/dw/rational/pdf/rdz_rbde...Bear in mind that, in SOA, the services are stateless; they do not "remember"

Accelerate Web and SOA development with Rational Business Developer Extension, Page 8 of 31

Copyright © 2008, IBM® Corporation. All rights reserved. Published by IBM® developerWorks®.

Figure 7. Do not switch perspective

Note: You should be using the Web perspective. If necessary, click Window > Open Perspective > Other > Web > OK.

8. Expand the LAB7WebService > EGLSource folder in the Project Explorer. Notice that an EGL build descriptor named LAB7WebService.eglbld has been created, as shown in Figure 8.

Figure 8. EGL build descriptor

Create the service business logic To create the service business logic, follows these steps.

1. Right-click the EGLSource folder, and select New > Service.

2. In the Package field, type services.

3. In the EGL source file name field, type Calculate and click Finish, as shown in Figure 9.

Page 9: Accelerate Web and SOA development with IBM Rational ...public.dhe.ibm.com/software/dw/rational/pdf/rdz_rbde...Bear in mind that, in SOA, the services are stateless; they do not "remember"

Accelerate Web and SOA development with Rational Business Developer Extension, Page 9 of 31

Copyright © 2008, IBM® Corporation. All rights reserved. Published by IBM® developerWorks®.

Figure 9. Specify EGL Service Part options

4. Add the code in Listing 1 to the page. (If you prefer, you can import or copy the code from C:\RBDe_POT_V7\lab7\Calculate.egl ).

Listing 1. Code for packaging services

package services; // service service Calculate function addFields(field1 int in, field2 int in) returns (int) result int; result = field1 + field2; return (result); end end

5. Save and close the file (Ctrl + Shift + F4).

6. Click Yes to save your changes.

Page 10: Accelerate Web and SOA development with IBM Rational ...public.dhe.ibm.com/software/dw/rational/pdf/rdz_rbde...Bear in mind that, in SOA, the services are stateless; they do not "remember"

Accelerate Web and SOA development with Rational Business Developer Extension, Page 10 of 31

Copyright © 2008, IBM® Corporation. All rights reserved. Published by IBM® developerWorks®.

What you have done so far You have created an EGL Web project and defined an EGL Web service with only one operation (and two fields). Now that you have written the code for this service, you can make it available to other applications as a Web service or EGL services. In this article, you will only create a Web service. Making the service available in this way involves creating service binding information, which tells other applications where to find the service and what functions are available. The service publishes this information as a WSDL file. As an alternative to Web services, EGL client applications can access EGL service applications as EGL services. This method offers better performance than Web services, but it can be used only between two EGL applications.

Set up the service as a Web service In this step, you create an EGL deployment descriptor and add binding information to it. You will also configure the project's build descriptor to use the deployment descriptor.

Using the deployment descriptor with services When you write a service in EGL, you must also create a deployment descriptor to accompany it. The deployment descriptor file contains both the information describing how your service part calls external applications, and information describing how your EGL service is wrapped with a Web service and exposed to external applications. When you use them with Java generation, the generating EGL deployment descriptor files result in a runtime binding file (by using the naming convention: ddname-bind.xml). When you use them with COBOL generation, that generates a binding program instead.

1. Right-click the EGLSource folder, and select New > Deployment Descriptor, as

shown in Figure 10.

Page 11: Accelerate Web and SOA development with IBM Rational ...public.dhe.ibm.com/software/dw/rational/pdf/rdz_rbde...Bear in mind that, in SOA, the services are stateless; they do not "remember"

Accelerate Web and SOA development with Rational Business Developer Extension, Page 11 of 31

Copyright © 2008, IBM® Corporation. All rights reserved. Published by IBM® developerWorks®.

Figure 10. Create a new deployment descriptor

2. Enter ServiceDD as the EGL deployment descriptor file name and click Finish, as shown in Figure 11.

Figure 11. Specify EGL deployment descriptor options

3. The new deployment descriptor opens in the editor. Click the Web Service Deployment tab, located at the base of the editor, as shown in Figure 12.

Figure 12. Select the Web Service Deployment tab

4. In the Web Service Deployment view, click Add, as shown in Figure 13.

Page 12: Accelerate Web and SOA development with IBM Rational ...public.dhe.ibm.com/software/dw/rational/pdf/rdz_rbde...Bear in mind that, in SOA, the services are stateless; they do not "remember"

Accelerate Web and SOA development with Rational Business Developer Extension, Page 12 of 31

Copyright © 2008, IBM® Corporation. All rights reserved. Published by IBM® developerWorks®.

Figure 13. Add a new service part

5. To move your service to the EGL service parts to be generated as Web services list, select it from the EGL service parts found list in the Add Web Services window, and then click Add, as shown in Figure 14.

Figure 14. Select EGL service parts to be generated as Web services

6. Click Finish

7. Save the ServiceDD.egldd file (Ctrl + S). The service now displays in the list on the Web Service Deployment tab, as shown in Figure 15. You do not need to add any other information on this tab for now. The deployment descriptor is showing the Web service binding information.

Page 13: Accelerate Web and SOA development with IBM Rational ...public.dhe.ibm.com/software/dw/rational/pdf/rdz_rbde...Bear in mind that, in SOA, the services are stateless; they do not "remember"

Accelerate Web and SOA development with Rational Business Developer Extension, Page 13 of 31

Copyright © 2008, IBM® Corporation. All rights reserved. Published by IBM® developerWorks®.

Figure 15. Verify that the service displays

8. Double-click LAB7WebService.eglbld, located in the project's EGLSource folder. The build descriptor file contains build descriptor options that describe how EGL will generate your project into the output language.

9. In the build parts editor, clear the Show only specified options check box, as

shown in Figure 16.

Figure 16. Show all options in the build parts editor

10. In the list of build descriptor options, find the option named deploymentDescriptor.

11. Edit the Value field for the deploymentDescriptor option, and then click the

button in the Value field.

12. In the File Selection window, select the ServiceDD.egldd deployment descriptor file, as shown in Figure 17, and then click OK.

Page 14: Accelerate Web and SOA development with IBM Rational ...public.dhe.ibm.com/software/dw/rational/pdf/rdz_rbde...Bear in mind that, in SOA, the services are stateless; they do not "remember"

Accelerate Web and SOA development with Rational Business Developer Extension, Page 14 of 31

Copyright © 2008, IBM® Corporation. All rights reserved. Published by IBM® developerWorks®.

Figure 17. Selecting the file

13. Figure 18 shows the result (the specified value in the deploymentDescriptor option).

Figure 18. deploymentDescripor now has the specified value

14. Scroll down to find the Option serverType and, using the drop-down menu, select TOMCAT5.X, as shown in Figure 19. This is the application server that you will use in this tutorial.

Page 15: Accelerate Web and SOA development with IBM Rational ...public.dhe.ibm.com/software/dw/rational/pdf/rdz_rbde...Bear in mind that, in SOA, the services are stateless; they do not "remember"

Accelerate Web and SOA development with Rational Business Developer Extension, Page 15 of 31

Copyright © 2008, IBM® Corporation. All rights reserved. Published by IBM® developerWorks®.

Figure 19. Specify the serverType

15. Save and close the build descriptor (press Ctrl + Shift + F4, and then click Yes to save).

16. To generate Java code, right-click the project (Lab7WebService) and select Generate, as shown in Figure 20.

Figure 20. Generate Java code

Note: The generation should have no errors when you run Calculate, but you will have an issue on ServiceDD, because Tomcat is not yet defined (as shown in Figure 21). You will clear that later.

Page 16: Accelerate Web and SOA development with IBM Rational ...public.dhe.ibm.com/software/dw/rational/pdf/rdz_rbde...Bear in mind that, in SOA, the services are stateless; they do not "remember"

Accelerate Web and SOA development with Rational Business Developer Extension, Page 16 of 31

Copyright © 2008, IBM® Corporation. All rights reserved. Published by IBM® developerWorks®.

Figure 21. EGL Generation Results tab

What you have done so far You have created an EGL Web Project and defined an EGL Web service. You also defined the EGL Deployment descriptor to create Web services, modified the EGL build descriptor, and generated the EGL, creating Java Code. You might now debug the Web services after deploying the code. But before doing this, you should create an EGL Test Client program that will invoke this service defined with EGL.

Create an EGL program to debug the created service

This is an optional step, but it is a very good idea to debug the EGL service that you created. The only way to do this is to create an EGL Program to invoke this service.

1. Right-click the EGLSource folder and select New > Program, as shown in Figure 22.

Figure 22. Create a new program

2. Type programs in the Package field. Type TestService in the EGL source file name field (as shown in Figure 23), and then click Finish.

Page 17: Accelerate Web and SOA development with IBM Rational ...public.dhe.ibm.com/software/dw/rational/pdf/rdz_rbde...Bear in mind that, in SOA, the services are stateless; they do not "remember"

Accelerate Web and SOA development with Rational Business Developer Extension, Page 17 of 31

Copyright © 2008, IBM® Corporation. All rights reserved. Published by IBM® developerWorks®.

Figure 23. Specify EGL Program part options

3. Replace the default boiler plate code with the code in Listing 2. This code functions as follows:

• anService Calculate declares a service variable named anService.

• @BindService tells EGL to bind the service. In this case, it uses the default name of Calculate.

Tip: If you prefer, you can import or copy the code from: C:\RBDe_POT_V7\lab7\TestService.egl

Listing 2. Declare and bind a service

package programs; import services.Calculate; program TestService type BasicProgram {} function main() value1 int = 24; value2 int = 06; result int ; anService Calculate {@BindService {}}; // the default Bind key result = anService.addFields(value1, value2); //invoke service end end

Page 18: Accelerate Web and SOA development with IBM Rational ...public.dhe.ibm.com/software/dw/rational/pdf/rdz_rbde...Bear in mind that, in SOA, the services are stateless; they do not "remember"

Accelerate Web and SOA development with Rational Business Developer Extension, Page 18 of 31

Copyright © 2008, IBM® Corporation. All rights reserved. Published by IBM® developerWorks®.

4. Add a breakpoint next to an operational EGL instruction inside the function. You can do this by double-clicking the grey area to the left of the code, as shown in Figure 24.

Figure 24. Add a breakpoint

5. Close and save the EGL source code that you are editing (Ctrl + Shift + F4).

6. From the Project Explorer, expand EGLSource and programs, right-click TestService.egl, and select Debug EGL Program, as shown in Figure 25.

Figure 25. Start to debug the program

7. When a message displays, asking if you want to switch to the Debug Perspective, click Yes.

8. When the debug perspective is open, use the Variables view to expand the main function. You should see the variables defined, as shown in Figure 26.

Page 19: Accelerate Web and SOA development with IBM Rational ...public.dhe.ibm.com/software/dw/rational/pdf/rdz_rbde...Bear in mind that, in SOA, the services are stateless; they do not "remember"

Accelerate Web and SOA development with Rational Business Developer Extension, Page 19 of 31

Copyright © 2008, IBM® Corporation. All rights reserved. Published by IBM® developerWorks®.

Figure 26. Defined variables

9. Click the icon (or press F5) and you will be able to step through each statement in the TestService.egl and Calculate.egl services, as shown in Figure 27.

Figure 27. Stepping through Calculate service

Keep clicking the icon (or pressing F5) until the program ends (the icons will be disabled).

10. To close the Debug perspective, right-click and select Close (see Figure 27).

Page 20: Accelerate Web and SOA development with IBM Rational ...public.dhe.ibm.com/software/dw/rational/pdf/rdz_rbde...Bear in mind that, in SOA, the services are stateless; they do not "remember"

Accelerate Web and SOA development with Rational Business Developer Extension, Page 20 of 31

Copyright © 2008, IBM® Corporation. All rights reserved. Published by IBM® developerWorks®.

Figure 28. Close the Debug perspective

11. Close all files that are still open (Ctrl + Shift + F4).

What you have done so far You have defined an EGL Web service, defined the EGL deployment descriptor to create Web services, modified the EGL build descriptor, and generated the EGL (creating Java Code). To debug the created EGL service, you created an EGL program to invoke the Web service and debugged it. Now you are ready to generate the WSDL, deploy the Web service, and test it.

Generate the WSDL file WSDL files communicate information about services to clients, describing the functions provided in the service and specifying the location of the service. In this section, you will generate a WSDL file from the service, and then change the application server port.

1. To generate the WSDL file, expand services, right-click Calculate.egl, and select EGL Services > Generate WSDL File, as shown in Figure 29.

Page 21: Accelerate Web and SOA development with IBM Rational ...public.dhe.ibm.com/software/dw/rational/pdf/rdz_rbde...Bear in mind that, in SOA, the services are stateless; they do not "remember"

Accelerate Web and SOA development with Rational Business Developer Extension, Page 21 of 31

Copyright © 2008, IBM® Corporation. All rights reserved. Published by IBM® developerWorks®.

Figure 29. Generate a WSDL file

2. In the "Create WSDL File from an EGL Service" window, click Show Advanced.

3. In the Port field, type 8080 to replace 9080, as shown in Figure 30. This will be

the port number for the Tomcat application server.

4. Accept all of the other defaults for the window, and click Finish. Figure 30. Change the Port number

Page 22: Accelerate Web and SOA development with IBM Rational ...public.dhe.ibm.com/software/dw/rational/pdf/rdz_rbde...Bear in mind that, in SOA, the services are stateless; they do not "remember"

Accelerate Web and SOA development with Rational Business Developer Extension, Page 22 of 31

Copyright © 2008, IBM® Corporation. All rights reserved. Published by IBM® developerWorks®.

5. The generated WSDL (commonly pronounced “Wis Dul”) should now be open in

the content area, as shown in Figure 31. Figure 31. Generated WSDL content

6. If you want, expand the window and click the arrows to get more details. Notice the input message (field1 and field2) and the output message (return).

7. Close all files that are still open (Ctrl + Shift + F4).

What you have done so far You have configured the service to be used by other applications at run time. The WSDL file describes the service so that clients can connect to it at run time, and the deployment descriptor file allows EGL to make the service available at run time.

Test the Web service interactively Before starting the tests, create an instance of the Tomcat Application Server:

1. Click the Servers tab to switch to the Server view. Right-click the blank space and select New > Server, as shown in Figure 32.

Figure 32. Create a new server

2. Expand Apache, select Tomcat v5.5 Server, and click Finish, as shown in Figure 33.

Page 23: Accelerate Web and SOA development with IBM Rational ...public.dhe.ibm.com/software/dw/rational/pdf/rdz_rbde...Bear in mind that, in SOA, the services are stateless; they do not "remember"

Accelerate Web and SOA development with Rational Business Developer Extension, Page 23 of 31

Copyright © 2008, IBM® Corporation. All rights reserved. Published by IBM® developerWorks®.

Figure 33. Select the correct server type

This creates an instance of a Tomcat v5.5 server, which you will see in the Servers view.

3. In the Servers view, right-click Tomcat v5.5 Server and select Add and Remove Projects, as shown in Figure 34.

Figure 34. Add a project to the Tomcat server

4. Select the LAB7WebService project, click Add, and then click Finish, as shown in Figure 35.

Page 24: Accelerate Web and SOA development with IBM Rational ...public.dhe.ibm.com/software/dw/rational/pdf/rdz_rbde...Bear in mind that, in SOA, the services are stateless; they do not "remember"

Accelerate Web and SOA development with Rational Business Developer Extension, Page 24 of 31

Copyright © 2008, IBM® Corporation. All rights reserved. Published by IBM® developerWorks®.

Figure 35. Add a project

5. To start the application server, right-click and select Start. Alternatively, click on

the icon shown in Figure 36. This may take a while running under VMWARE.

Figure 36. The Start icon

6. If you get an error message such as Resource out of synch, the server will not start. To correct the error, click OK and execute these steps: • To bypass this error, right-click LAB7WebService and select Generate. Do

not worry if ServiceDD still has errors. • Click the Servers tab and try to start the Tomcat application server again

(right-click and select Start or click the icon).

7. Click the Servers tab to check its status.

Page 25: Accelerate Web and SOA development with IBM Rational ...public.dhe.ibm.com/software/dw/rational/pdf/rdz_rbde...Bear in mind that, in SOA, the services are stateless; they do not "remember"

Accelerate Web and SOA development with Rational Business Developer Extension, Page 25 of 31

Copyright © 2008, IBM® Corporation. All rights reserved. Published by IBM® developerWorks®.

After the server has started, you are ready to run your tests, because the Java application was deployed to the server. Notice that the value of the Status column should be Started, as shown in Figure 37.

Figure 37. Sever status

8. Now you have Tomcat configured. However, to clear the generation issue that you had previously, you still need to re-generate the EGL code. Right-click LAB7WebService and select Generate, as shown in Figure 38.

Figure 38. Re-generate the EGL code

Page 26: Accelerate Web and SOA development with IBM Rational ...public.dhe.ibm.com/software/dw/rational/pdf/rdz_rbde...Bear in mind that, in SOA, the services are stateless; they do not "remember"

Accelerate Web and SOA development with Rational Business Developer Extension, Page 26 of 31

Copyright © 2008, IBM® Corporation. All rights reserved. Published by IBM® developerWorks®.

9. Click the EGL Generation Results tab. Notice that the errors that displayed previously are now cleared, as shown in Figure 39.

Figure 39. Result showing generation completed with not errors

Rational Business Developer extension offers a useful interactive Web services test facility called the Web Services Explorer. You can use this tool to test your Web service functionality effectively, before embedding calls to it from your service client. To do so, follow these steps.

10. Right click Calculate.wsdl (which you generated under \EGLSource\wsdl\), and select Web Services > Test with Web Services Explorer, as shown in Figure 40. This may take a while, because you are still running under VMWARE.

Figure 40. Launch Web Services Explorer

11. The Web Services Explorer will now display in the Content Area. To access it and test, double-click the Web Services Explorer title to maximize it, expand CalculateBinding, and click addFields (which is the service that you are going to test).

12. Type 456 in field1 and 4 in field2, as shown in Figure 41, and then click Go.

Page 27: Accelerate Web and SOA development with IBM Rational ...public.dhe.ibm.com/software/dw/rational/pdf/rdz_rbde...Bear in mind that, in SOA, the services are stateless; they do not "remember"

Accelerate Web and SOA development with Rational Business Developer Extension, Page 27 of 31

Copyright © 2008, IBM® Corporation. All rights reserved. Published by IBM® developerWorks®.

Figure 41. Enter test options

13. Resize the Status area to see the results, as shown in Figure 42.

Figure 42. Test results

14. The results must be the sum of the 2 fields, as shown in Figure 43.

Page 28: Accelerate Web and SOA development with IBM Rational ...public.dhe.ibm.com/software/dw/rational/pdf/rdz_rbde...Bear in mind that, in SOA, the services are stateless; they do not "remember"

Accelerate Web and SOA development with Rational Business Developer Extension, Page 28 of 31

Copyright © 2008, IBM® Corporation. All rights reserved. Published by IBM® developerWorks®.

Figure 43. Test results

15. Click the Source link to see the SOAP envelopes, as shown in Figure 44.

Figure 44. SOAP Response Envelope

16. Close all files that are still open (Ctrl + Shift + F4).

What you have done so far You have defined an EGL Web service, defined the EGL deployment descriptor to create Web services, modified the EGL build descriptor, and generated the EGL (creating Java Code). Then you generated the WSDL of the services created and deployed the Java code created that implements the Web service. By using the generated WSDL, you tested the service (this time, not in Debug mode but running the Java deployed code inside of the application server). You also verified the input and output SOAP messages.

You have completed the exercises in this article.

Page 29: Accelerate Web and SOA development with IBM Rational ...public.dhe.ibm.com/software/dw/rational/pdf/rdz_rbde...Bear in mind that, in SOA, the services are stateless; they do not "remember"

Accelerate Web and SOA development with Rational Business Developer Extension, Page 29 of 31

Copyright © 2008, IBM® Corporation. All rights reserved. Published by IBM® developerWorks®.

How to import the Solution project

If you could not complete the exercises in this article, or if you missed one step or typed a wrong name (which would cause problems), you can load the solution in your workspace. This article provides a solution using IBM® WebSphere® Application Server Version 6.1 rather than Tomcat:

Share this article

Digg this story

Post to del.icio.us

Slashdot it!

1. In any perspective, import the Solution project. Select File > Import > Other > Project Interchange, and use the solution located at: C:\RBDE_POT_V7\lab7\solution\Lab7.solution.zip.

2. Click Select All (Figure 45) and click Finish.

Figure 45. Import the solution

In addition, the solution workspace (C:\Workspaces\RBDe_Solution) exists in your VMWARE image. To start the workspace with the solution, follow these steps:

1. Open the folder by double-clicking the icon on the desktop (it is located on the desktop, near the Mountains).

2. Double-click the icon.

Page 30: Accelerate Web and SOA development with IBM Rational ...public.dhe.ibm.com/software/dw/rational/pdf/rdz_rbde...Bear in mind that, in SOA, the services are stateless; they do not "remember"

Accelerate Web and SOA development with Rational Business Developer Extension, Page 30 of 31

Copyright © 2008, IBM® Corporation. All rights reserved. Published by IBM® developerWorks®.

Trademarks IBM, the IBM logo, and Rational are trademarks of IBM Corporation in the United States, other countries, or both. Other company, product, or service names may be trademarks or service marks of others. Resources Learn

Find out more about IBM Enterprise Modernization Solutions. Learn more about IBM Rational Developer for System z. Watch a demo of Rational Developer for System z. Read Unleash the power of mainframe assets into SOA. Visit the Rational page on developerWorks to find technical resources and learn

about best practices for the Rational Software Delivery Platform. Subscribe to The Rational Edge weekly newsletter. Subscribe to the IBM® developerWorks® newsletter, a weekly update on the best

of developerWorks tutorials, articles, downloads, community activities, webcasts and events.

Browse the technology bookstore for books on these and other technical topics.

Discuss

• Join the Architecture forum on developerWorks to get connected with others and take advantage of their expertise and experience to get you tips that can help you as a developer or architect to use the principles of service-oriented architecture (SOA).

• Check out developerWorks blogs. and get involved in the developerWorks community.

Download

Get an evaluation version of Rational Developer for System z. Download trial versions of other IBM Rational software. Download these IBM product evaluation versions and get your hands on

application development tools and middleware products from DB2®, Lotus®, Tivoli®, and WebSphere®.

Page 31: Accelerate Web and SOA development with IBM Rational ...public.dhe.ibm.com/software/dw/rational/pdf/rdz_rbde...Bear in mind that, in SOA, the services are stateless; they do not "remember"

Accelerate Web and SOA development with Rational Business Developer Extension, Page 31 of 31

Copyright © 2008, IBM® Corporation. All rights reserved. Published by IBM® developerWorks®.

About the author

Reginaldo W. Barosa is an IBM Executive IT Specialist. He provides sales support, helping customers with enterprise modernization solutions and development tools, such as Rational Developer for System z. Before joining IBM US more than seven years ago, Reginaldo worked for 27 years in IBM Brazil. He has co-authored IBM Redbooks and has written two books, as well as other articles and tutorials for IBM developerWorks. He holds a degree in electrical engineering from Instituto Mauá de Tecnologia, São Paulo, Brazil.