Welcome!

SOA & WOA Authors: Maureen O'Gara, Philip Lieberman, Jill Tummler Singer , Elizabeth White, Pat Romanski

Related Topics: Websphere, SOA & WOA

Websphere: Article

Building SOA Solutions with Service Component Architecture

Part One of a Two-Part Article

Create SCA client Web application and testing with WebSphere Process Server1. To have an SCA component be invoked by a non-SCA component packaged in the same SCA deployment, we need to create a standalone reference:

a.  In the SCA Assembly Editor, select the arrow next to the Import icon on the palette. This will expose a smaller submenu. Select the Standalone references icon and drag it anywhere on the Assembly Editor as shown in Figure 41.
b.  Click inside the Stand-alone References box (not the text) and drag it to the Credit Approval component as shown in Figure 42.
c.  Press OK to create a matching reference. (Figure 43)
d.  The next text box will give you an option to generate a Java interface. Remember, you created a WSDL Interface. However, WebSphere Integration Developer is generating an equivalent Java interface to let Java clients interact using the SCA API. Select Yes. (Figure 44)

2.  With a standalone reference, we can now invoke SCA components from non-SCA components in the same module. Remember, an SCA module is realized by an EAR file, so you can add additional J2EE components to the SCA module. In our example, we are going to import an existing WAR file that has a JSP file. That WAR file will be part of the underlying EAR file.
a.  Select File => Import to bring up the Import wizard. Select WAR file and press Next. (Figure 45)
b.  Select C:\SCA_ArticleSeries\Part1\CreditApprovalClient.war. Unselect Add module to an EAR Project.
c.  Select Yes to switch to the Web perspective. (Figure 47) d.  Open the JSP file to examine the code. You will find it under the Dynamic Web Projects directory, as shown in Figure 48. The JSP is called creditApprovalClient.jsp.
e.  We use a simple JSP to receive input and use the SCA API to invoke an SCA component. (Keep in mind this JSP does follow best practices for using MVC).

3.  SCA has a Dependency Editor that enables you to add different packages to the SCA module:
a.  Open the Dependency Editor by right-clicking the CreditApprovalSCAModule and select Open Dependency Editor. (Figure 49)
b.  Expand the J2EE section, then press the Add button. (Figure 50)
c.  Select the CreditApprovalClient Web project as shown in Figure 51.
d.  Be sure to unselect On Build Path. (Build Path adds this component to the classpath of the SCA module. In our case, we need to make the WAR file depend on the SCA module.) Save the Dependency Editor. This makes the WAR file part of the EAR file.
e.  To make the Web project see the SCA Java interface, right click the Web project and select Properties.
f.  Go to Java JAR Dependencies and select CreditApprovalSCAModuleEJBClient.jar, which is the generated EJB client JAR file that is generated underneath. (Figure 53)
g.  Close the editor. At this point, you can choose to perform a full build. This may not be necessary, but we always like doing a full build before deploying. If you have automatic build, you can do a Clean as shown in Figure 54.

4.  We are now ready to deploy and test our SCA component and Web client on WebSphere Process Server. Remember, our SCA module is realized by a J2EE application. You can switch to the J2EE perspective to view the artifacts. Keep in mind that these are generated artifacts. (We will cover these later in this article series.)
a.  Switch to the Servers view on the bottom of the Business Integration perspective. Right click WebSphere Process Server and select Start as shown in Figure 56.
b.  Wait for the server to start. Check the console and wait for the messages shown in Figure 57.
c.  Right-click the server again and select Add and remove projects. (Figure 58)
d.  Select CreditApprovalSCAModuleAdd and select Add as shown in Figure 59. This will move it into the Configured projects box on the right.
e.  Monitor the progress on the lower right corner and wait for the application to be deployed. (Figure 60)
f.  Verify at the console that the CreditApporvalSCAModuleApp is started. (Figure 61)
g.  Switch to the Web perspective. Right-click on the JSP and select Run => Run on Server as shown in Figure 62.
h.  Choose the existing WebSphere Process Server and select Set server as project default, then Finish. (Figure 63)
i.  When the application executes, enter the application test data shown in Figure 64.
j.  You should get the results shown in Figure 65.
k.  Close the browser and stop the server.

Congratulations, you have just created and tested your first SCA component!

Service Component Architecture (SCA) is a major shift in service-oriented architectures (SOA). SCA gives us a programming model for SOA, and will serve as a foundation for integration for years to come. Stay tuned for upcoming articles in this series, which will explore details of specific SCA features and the benefits they can bring to your applications.

More Stories By Roland Barcia

Roland Barcia is a consulting IT specialist for IBM Software Services for WebSphere in the New York/New Jersey Metro area. He is the author of one of the most popular article series on the developerWorks WebSphere site, www-106.ibm.com/developerworks/websphere/techjournal/0401_barcia/barcia.html, and is also a coauthor of IBM WebSphere: Deployment and Advanced Configuration. You can find more information about him at http://web.njit.edu/~rb54

More Stories By Jeff Brent

Jeff Brent is an Advisory Software Engineer for the WebSphere Business Integration Competency Center (WBICC). His responsibilities include helping independent software vendors develop integration strategies for WebSphere products.

Comments (3) View Comments

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.


Most Recent Comments
prabhavathy 03/12/08 12:15:22 PM EDT

Please upload the CreditApprovalClient.war.Since it is not available

C:\SCA_ArticleSeries\Part1\CreditApprovalClient.war.

prabhavathy 03/12/08 12:14:04 PM EDT

Please upload the CreditApprovalClient.war.Since it is not available

C:\SCA_ArticleSeries\Part1\CreditApprovalClient.war.

SYS-CON Australia News Desk 01/30/06 11:09:59 AM EST

In the previous article (part 1 in WebSphere Journal vol: 3. iss: 4) we began to build an SCA project in WebSphere Process Server. Here in part 2 we pick up the discussion. To see the associated images, please view the article online at www.ibm.com/developerWorks/websphere.