Welcome!

IBM Cloud Authors: Liz McMillan, Pat Romanski, Yeshim Deniz, Carmen Gonzalez, Elizabeth White

Related Topics: IBM Cloud, Microservices Expo

IBM Cloud: Article

Building SOA Solutions with Service Component Architecture

Part One of a Two-Part Article

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.

d.  The business object is defined using standard XML schema type. You can open the business object using an XML editor to see it. (You can open the business object in a text editor by right clicking it and selecting Open with => and the editor of your choice.)
e.  Save and close the Business Object Editor.
f.  The XML schema should look something like the code in Listing 1.

3.  We will now create a second business object to represent the response.
a.  Create another business object following the same steps above. This business object will have three fields:

  • customerId of type string
  • creditScore of type int
  • creditLimit of type double
b.  As mentioned earlier, you can change the type by selecting the type column as shown in Figure 19.
c. Save and close the Business Object Editor

You now have two business objects created.

Define the service interface
You are now ready to create your SCA Interface. Again, the credit approval service is a request-response service that receives a credit application and returns a credit rating synchronously. The service interface defines the interaction between the service client and the service provider. There are several ways to create an interface. If you choose a Java interface, you can use the Java Eclipse tools within WebSphere Integration Developer to do this. In our example, we will create a WSDL interface from the Business Integration perspective. You can do this using the Assembly Editor or you can do it using the Business Integraiton view. We will use the latter. (We will use the Assembly Editor later to create the implementation.)

1.  First, we will create the Interface using the Business Integration view menu.
a.  Right-click on the Interfaces menu item and select New => Interfaces as shown in Figure 20 (See online version).
b.  On the New Interface menu, enter the name CreditApproval. (Keep in mind that we are using the default package and folders in our example for illustration purposes. You can select a folder to easily group different interfaces by functionality.)

2.  The CreditApproval Interface is a simple WSDL file. WebSphere Integration Developer comes with a simple WSDL editor that you can use to build up your interface.
a.  The Interface Editor should have opened when you created the Interface. If it is not open already, you can double click the interface in the business integration view to open it.
b.  We will first create a simple request-response operation. (You can also create one-way operations that can be used with asynchronous invocations, but for now, we are only creating a simple synchronous request.) Press the Add Request Response Operation icon as shown in Figure 22.
c.  An operation will be created on the editor. Name the operation calculateCreditRating. (Figure 23)
d.  Now we need to define the parameters. Remember, we created two business objects, one for input and the other for output. With the operation created, select the Add Input icon as shown in Figure 24.
e.  Name the input CreditApplication.
f.  Select the Type column and find the CreditApplicaiton business object. As you can see, the business object is now a valid type that you can use to build up the interface, as shown in Figure 25. (Optionally, you can select to create a new business object here.)
g.  Next, select the Add Output icon as shown in Figure 26.
h.  Select CreditRating as the type, similar to what we did with the input.
i.  Save and close the Interface Editor.
j.  If you wish to inspect the WSDL file, you can right click the CreditApproval.wsdl file in the Physical Resources view and open it with a text editor. (Figure 28)

The WSDL file should look like the code in Listing 2.

Generate the component and provide an implementationWe are now ready to create our SCA implementation. At this point, we have created standard interfaces and business objects. We will now define our SCA component. You will use the SCA Assembly Editor to do this.

1.  First, we will define the SCA component.
a.  Open the SCA Assembly Editor by double clicking the CreditApprovalSCAModule menu item, as shown in Figure 29.
b.  The SCA Assembly Editor has a palette you can use to create SCA artifacts. You can also drag certain artifacts from various views. Simply drag the CreditApproval interface onto the Assembly Editor as shown in Figure 30. (Alternatively, you could also drag a Java component from the palette and associate the interface afterwards.)
c.  A text box will appear. Select Component with No Implementation Type as shown in Figure 31.
d.  You should now see an SCA component on the Assembly Editor named Component1. (Figure 32)
e.  You can change the name by selecting the component and typing the name, or you can change it using the Properties Editor as shown in Figure 33. Change the Display Name to CreditApproval. The Name field should change automatically.

2.  We now have an SCA component with an interface, but no implementation. We will now use the Assembly Editor to generate the implementation.
a.  Generate a skeleton implementation by right-clicking the component in the Assembly Editor and selecting Generate Implementation => Java. (Figure 34)
b.  The new Java implementation should open in a Java Editor; you will see the calculateCreditRating. A simple code snippet is provided in the download file, in C:\SCA_ArticleSeries\Part1\CodeSnippet1.txt. The method is shown in Listing 3.

3.  The code uses the SCA service manager to locate the Business Object Factory, which is used to create business objects from XML schemas. In our demonstration purposes, we create the Response Data Object and return hard coded data.
4.  If you pasted in the code, you should have some compile errors. You can resolve the these by right clicking in the editor and selecting Source => Organize Imports as shown in Figure 35.
5.  Save and close the Java file, but leave the Assembly Editor open.

Unit test the SCA componentWebSphere Integration Developer provides the ability to unit test components using a unit test tool. Depending on the type of SCA implementation, you can test SCA components in a J2SE environment, which enables you to test components without a full application server; of course, this greatly depends on the type of component you have. A Java implementation can be easily tested in a J2SE environment, but an SCA component realized by a BPEL flow would need a BPEL engine like WebSphere Process Server. In our example, we will use the Test Component feature to test our SCA component.

To launch the Test Component feature:

  1. Right click the CreditApproval component in the SCA Assembly Editor and select Test Component. (Figure 36)
  2. This will launch the Test Component Editor. On the right side of the tool, enter the test data as shown in Figure 37, then press Continue.
  3. A list of available run times will display. Select Eclipse 1.4 JVM, then Finish. (Figure 38)
  4. To begin the test, select the Return item as shown in Figure 39. Monitor the Events window to see the flow.
  5. On the right side, you will see the result. (Figure 40)

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 a Program Director in IBM Bluemix Offering Management. He is responsible for establishing the "cloud every where" vision for IBM Bluemix. He has held many roles during his career including Senior Consultant, BPM SWAT Lead and Technical Offering Management. He enjoys coaching baseball, playing basketball and spending time with his wife and two children in South Florida.

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.

@ThingsExpo Stories
SYS-CON Events announced today that Dasher Technologies will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 - Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Dasher Technologies, Inc. ® is a premier IT solution provider that delivers expert technical resources along with trusted account executives to architect and deliver complete IT solutions and services to help our clients execute their goals, plans and objectives. Since 1999, we'v...
SYS-CON Events announced today that MIRAI Inc. will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. MIRAI Inc. are IT consultants from the public sector whose mission is to solve social issues by technology and innovation and to create a meaningful future for people.
SYS-CON Events announced today that TidalScale, a leading provider of systems and services, will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 - Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. TidalScale has been involved in shaping the computing landscape. They've designed, developed and deployed some of the most important and successful systems and services in the history of the computing industry - internet, Ethernet, operating s...
SYS-CON Events announced today that TidalScale will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. TidalScale is the leading provider of Software-Defined Servers that bring flexibility to modern data centers by right-sizing servers on the fly to fit any data set or workload. TidalScale’s award-winning inverse hypervisor technology combines multiple commodity servers (including their ass...
Recently, REAN Cloud built a digital concierge for a North Carolina hospital that had observed that most patient call button questions were repetitive. In addition, the paper-based process used to measure patient health metrics was laborious, not in real-time and sometimes error-prone. In their session at 21st Cloud Expo, Sean Finnerty, Executive Director, Practice Lead, Health Care & Life Science at REAN Cloud, and Dr. S.P.T. Krishnan, Principal Architect at REAN Cloud, will discuss how they b...
Amazon is pursuing new markets and disrupting industries at an incredible pace. Almost every industry seems to be in its crosshairs. Companies and industries that once thought they were safe are now worried about being “Amazoned.”. The new watch word should be “Be afraid. Be very afraid.” In his session 21st Cloud Expo, Chris Kocher, a co-founder of Grey Heron, will address questions such as: What new areas is Amazon disrupting? How are they doing this? Where are they likely to go? What are th...
SYS-CON Events announced today that IBM has been named “Diamond Sponsor” of SYS-CON's 21st Cloud Expo, which will take place on October 31 through November 2nd 2017 at the Santa Clara Convention Center in Santa Clara, California.
Infoblox delivers Actionable Network Intelligence to enterprise, government, and service provider customers around the world. They are the industry leader in DNS, DHCP, and IP address management, the category known as DDI. We empower thousands of organizations to control and secure their networks from the core-enabling them to increase efficiency and visibility, improve customer service, and meet compliance requirements.
Join IBM November 1 at 21st Cloud Expo at the Santa Clara Convention Center in Santa Clara, CA, and learn how IBM Watson can bring cognitive services and AI to intelligent, unmanned systems. Cognitive analysis impacts today’s systems with unparalleled ability that were previously available only to manned, back-end operations. Thanks to cloud processing, IBM Watson can bring cognitive services and AI to intelligent, unmanned systems. Imagine a robot vacuum that becomes your personal assistant tha...
SYS-CON Events announced today that IBM has been named “Diamond Sponsor” of SYS-CON's 21st Cloud Expo, which will take place on October 31 through November 2nd 2017 at the Santa Clara Convention Center in Santa Clara, California.
In his Opening Keynote at 21st Cloud Expo, John Considine, General Manager of IBM Cloud Infrastructure, will lead you through the exciting evolution of the cloud. He'll look at this major disruption from the perspective of technology, business models, and what this means for enterprises of all sizes. John Considine is General Manager of Cloud Infrastructure Services at IBM. In that role he is responsible for leading IBM’s public cloud infrastructure including strategy, development, and offering ...
SYS-CON Events announced today that N3N will exhibit at SYS-CON's @ThingsExpo, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. N3N’s solutions increase the effectiveness of operations and control centers, increase the value of IoT investments, and facilitate real-time operational decision making. N3N enables operations teams with a four dimensional digital “big board” that consolidates real-time live video feeds alongside IoT sensor data a...
In a recent survey, Sumo Logic surveyed 1,500 customers who employ cloud services such as Amazon Web Services (AWS), Microsoft Azure, and Google Cloud Platform (GCP). According to the survey, a quarter of the respondents have already deployed Docker containers and nearly as many (23 percent) are employing the AWS Lambda serverless computing framework. It’s clear: serverless is here to stay. The adoption does come with some needed changes, within both application development and operations. Tha...
With major technology companies and startups seriously embracing Cloud strategies, now is the perfect time to attend 21st Cloud Expo October 31 - November 2, 2017, at the Santa Clara Convention Center, CA, and June 12-14, 2018, at the Javits Center in New York City, NY, and learn what is going on, contribute to the discussions, and ensure that your enterprise is on the right path to Digital Transformation.
SYS-CON Events announced today that Avere Systems, a leading provider of enterprise storage for the hybrid cloud, will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 - Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Avere delivers a more modern architectural approach to storage that doesn't require the overprovisioning of storage capacity to achieve performance, overspending on expensive storage media for inactive data or the overbui...
Digital transformation is changing the face of business. The IDC predicts that enterprises will commit to a massive new scale of digital transformation, to stake out leadership positions in the "digital transformation economy." Accordingly, attendees at the upcoming Cloud Expo | @ThingsExpo at the Santa Clara Convention Center in Santa Clara, CA, Oct 31-Nov 2, will find fresh new content in a new track called Enterprise Cloud & Digital Transformation.
Most technology leaders, contemporary and from the hardware era, are reshaping their businesses to do software. They hope to capture value from emerging technologies such as IoT, SDN, and AI. Ultimately, irrespective of the vertical, it is about deriving value from independent software applications participating in an ecosystem as one comprehensive solution. In his session at @ThingsExpo, Kausik Sridhar, founder and CTO of Pulzze Systems, will discuss how given the magnitude of today's applicati...
Smart cities have the potential to change our lives at so many levels for citizens: less pollution, reduced parking obstacles, better health, education and more energy savings. Real-time data streaming and the Internet of Things (IoT) possess the power to turn this vision into a reality. However, most organizations today are building their data infrastructure to focus solely on addressing immediate business needs vs. a platform capable of quickly adapting emerging technologies to address future ...
SYS-CON Events announced today that NetApp has been named “Bronze Sponsor” of SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. NetApp is the data authority for hybrid cloud. NetApp provides a full range of hybrid cloud data services that simplify management of applications and data across cloud and on-premises environments to accelerate digital transformation. Together with their partners, NetApp emp...
As popularity of the smart home is growing and continues to go mainstream, technological factors play a greater role. The IoT protocol houses the interoperability battery consumption, security, and configuration of a smart home device, and it can be difficult for companies to choose the right kind for their product. For both DIY and professionally installed smart homes, developers need to consider each of these elements for their product to be successful in the market and current smart homes.