Weblogic Authors: Yeshim Deniz, Elizabeth White, Michael Meiner, Michael Bushong, Avi Rosenthal

Related Topics: Weblogic

Weblogic: Article

Integration: Not Just Aggregation

Integration: Not Just Aggregation

When talking about enterprise application integration, we tend to think of using Web services technologies such as SOAP and UDDI to virtualize a data model across a large enterprise. The thinking is that with a consistent interface, the data stores of the company can be abstracted behind a Web services layer and reported in XML, which can then be kneaded to the particular needs of your application.

In an ideal world, this would be simple. However, we don't live in an ideal world, so there are a number of problems. The first problem is that we often want to take data from one service and use it as a parameter to call another, take returned data from that service and use it to call another, and so forth. We would then want to take pieces of data from each and aggregate them together to form our response to the original call.

In addition, data-type conversion may be necessary to map parameters to each other. For example, service 1 may return a double that is required by service 2 as an index, but service 2 expects it as a float. Interoperability is more than just being able to parse WSDL to create a proxy - operations such as data-type conversion are paramount.

Finally, you cannot expect all the services to run on the same platform. There may be .NET Web services, COM, DCOM, or other J2EE Web services that need to be integrated, to name a few. This is far more complicated than simple data aggregation, but is a real-world requirement; and with Web services development platforms alone it would require a lot of hand coding, defeating the purpose.

Here's where a tool such as BEA WebLogic Workshop 8.1 and a platform such as BEA WebLogic Integration 8.1 come into play.

A Real-World Use Case
A fictional company, The Pension Source (TPS), provides pension administration for their customers. Their pension plans have always been based on funds based in the U.S. but they want to branch into international funds. Their offices in Europe have a Web service that provides foreign exchange information, and these offices are standardized on Oracle as an application server. In addition, they have a domestic database that contains the recent price history and currency code for each fund. They would like to integrate these Web services to provide a new application. What will this entail?
1.  Exposing an interface that allows the user to query the dollar price of a particular fund
2.  Pulling the price of the fund from the database
3.  Pulling the currency code of the fund from the database
4.  Converting the price to U.S. dollars
5.  Returning the converted price to the user

In step 2, the fund price is returned to the user as a float. In step 4, the distant Web service requires the price to be passed to it as a double.

We'll see how straightforward the design and implementation of such a workflow and orchestration is with BEA WebLogic Workshop.

Building the Integrated Application
The downloads for this article (located at www.sys-con.com/weblogic/sourcec.cfm) include a zip file (CurrencyConv.zip) containing an emulation of the currency conversion Web service as an Oracle JDeveloper project that may be installed on Oracle JDeveloper and run on OC4J. Please check the readme file included with the download for instruction. In addition, PensionAPI.zip contains a WebLogic Workshop 8.1 application that emulates a service that retrieves data from the pension fund's database, and exposes it as an API. For simplicity, neither application is tied to a back-end database; they simply emulate a real-world scenario where they would.

Once both services are up and running, start WebLogic Workshop 8.1.

Getting Started with the Workflow and Adding a Client Request

  • Create a new empty application called TPSReport. For the server, make sure that you select the "Integration" server on the dropdown list.
  • Create a new empty workflow project called GetFundInformation.
  • Within the workflow folder you will see a file called workflow.jwf. Double-click it to open the designer.
  • Double-click the "Starting Event" and select "Invoked By a Client Request"
  • Double-click the Client Request node, select "String", and click Apply.
  • Select the "Receive Data" tab. This is where you will assign the parameter that has been passed by the user to a variable that is internal to your workflow. That variable does not yet exist, so in the next steps you can add it.
    - On the right side of your screen, you should see the Data Palette. Click "Add" besides the Variables tab, and then call the variable strSymbol and make it a string.
    - On the "Receive Data" tab of the Client Request node, click "Select Variable", variable strSymbol is now on the list.
  • Click "Apply" and then "Close" to update the Client Request node.

    You've finished the first step of the workflow, taking the data in from a client request. Your screen should look something like Figure 1.

    Consuming the Fund Price Web Service
    Now that you have the Client Input, as a string denoting the symbol of the fund you are interested in, the next step is to consume the Web service that exposes the Fund Price History and Currency Code.
    Consuming the Price History:

  • From the palette on the bottom left side of the screen, select "Control Send With Return" and drag it onto the green line between the Client Request node and the Finish.
  • Double-click the node that appears.
  • You can see that this node requires a control to continue. With the designer you can add a new one on the fly as follows:
    - On the right side of the screen (use Figure 1 as a guide) the Data Palette contains a Controls tab. On it, click "Add" and select "Web Service".
    - In the ensuing dialog, on step 1, call the control ctlPensionDetails
  • In step 2, select "Create a New Web Services Control to Use" and call it ctlPensionsAPI
    - In step 3, enter the URL to the WSDL of the Pensions API Web service that you downloaded and installed earlier.
    - Click "Create" and you will return to the node designer.
  • You can now select "ctlPensionDetails" as the control implementing the Web service, and when selected, the methods list box is populated.
  • Select the method "getPrice" and click "Apply".
  • Select the "Send Data" tab. This is where you set up the parameters that you are passing to the Web service and where they come from.
  • Click "Select Variable" and select "strSymbol". This will take the variable created by the User Call in the previous node and dispatch it as a parameter to the PensionsAPI Web service. Click "Apply".
  • Select the "Receive Data tab". This is where you specify what to do with the data that comes back from the Web service.
  • We don't have a variable to hold this data, so create a new one as before. Make it a Java float, and call it nAmount.
  • It will now be available on the "Select Variable" list, so select it and click "Apply".
  • Click "Close". You now have a node in your workflow that dispatches the client request to a Web service and gets a value back.

    Repeat these steps to add another node, calling the same control, but this time calling the "getCurrency" method. Map the returned value to a new integer called nCurrency.

    Your screen should now look like Figure 2.

    Orchestrating the Change Currency Web Service
    Now it gets interesting. At this point you have a workflow using all WebLogic Web services. You are going to integrate the service running on another platform - in this case the Currency Conversion service running on Oracle OC4J.

    As before, drag a "Control Send with Return" node onto the workflow, dropping it just above the "Finish" node.

  • Double-click it to configure it.
  • You do not yet have a control for the Web service, so click "Add" near "Controls" on the Data Palette.
  • Select Web Service". - Step 1: Call the instance ChangeCurrency - Step 2: Select "Create a new Control". Call it ctlChangeCurrency. - Step 3: Enter the WSDL of the running Web service. If you followed the instructions in the download it should look something like: http://machinename:8888/WebLogicArticle- CurrencyConv-contextroot/mypackage1.Change Currency?WSDL
    - Click "Close".
  • Return to configuring the node.
    - On "General Settings" select the Control "ChangeCurrency" and the node "ChangeCurrency" and click "Apply"
    - On "Send Data" select nAmount and nCurrency in step 1.
    - You'll notice on the dialog that the input variables are a "double" and an "int", whereas the values you are about to pass are a "float" and an "int". To transform them, on step 2a in the dialog do the following:
  • Click "New". In step 1 set the Variable Name to "TransformForCurrency" and in step 2, set the control name to dtfTransformCurrency
  • Enter "TransformAmount" in the Method box and click "Create Transformation" in step 2b.
  • The Map Variables dialog appears. Drag the float to arg1 and the int to arg 2.
  • Click OK when you're done.
    - Click Apply to update the "Send Data" settings
    - On the "Return Data" node, the double needs to be mapped to a variable. Create a new double variable as before, and call it nReturn. Select it, click "Apply" and then click close.

    You have now integrated the distant Web service, and it was done as seamlessly as the Web services running on the same WebLogic platform.

    Returning the Data to the User
    The user has now passed a string containing the fund that they are interested in to your workflow, and the workflow has pulled the details out, and translated the currency to US dollars. The last step is to return the currency-translated value back to the user.

    This is very simple. On the Palette, select a "Client Response" node and drop it just above the "Finish" node.

  • Double-click the "Client Response" node and select a "Double" on the "General Settings" tab.
  • On the "Send Data" tab, select the variable called "nReturn", click "Apply", and then click "Close".

    Your finished workflow should now look like Figure 3.

    Testing the Workflow
    Build the application and run it. The test harness will run and display the screen shown in Figure 4.

    Enter "ABC" in the textbox and click "clientRequest". Wait a few seconds and click "Refresh" on the Message Log. Keep doing this until you see a callback.clientResponse entry on the Message Log.

    By clicking on the nodes within the harness, you can see the calls and the data being passed around the different Web services.

    In the case of "ABC" the amount was being reported in currency code 1 (dollars) so no conversion was required. As an exercise, try to amend the workflow so that it doesn't bother to call the Currency Conversion Web service in this case. (Hint: Use a decision node.)

    By trying the symbols "BBC" and "CBC" you can investigate the currency conversion as it is happening.

    One really great thing about this is that this compiled workflow is actually running as a Web service, so it in turn could become a node in another, more complex orchestration!

    In this example you built a simple orchestration. You have barely touched on the features that are available in BEA WebLogic Workshop 8.1 for orchestrations. Other nodes can have Java code associated with them, be conditional, loop, or be asynchronous. The goals of true application integration - data aggregation, service chaining, and orchestration - are now in your hands.

  • More Stories By Laurence Moroney

    Laurence Moroney is a senior Technology Evangelist at Microsoft and the author of 'Introducing Microsoft Silverlight' as well as several more books on .NET, J2EE, Web Services and Security. Prior to working for Microsoft, his career spanned many different domains, including interoperability and architecture for financial services systems, airports, casinos and professional sports.

    Comments (0)

    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.

    @ThingsExpo Stories
    Coca-Cola’s Google powered digital signage system lays the groundwork for a more valuable connection between Coke and its customers. Digital signs pair software with high-resolution displays so that a message can be changed instantly based on what the operator wants to communicate or sell. In their Day 3 Keynote at 21st Cloud Expo, Greg Chambers, Global Group Director, Digital Innovation, Coca-Cola, and Vidya Nagarajan, a Senior Product Manager at Google, discussed how from store operations and ...
    In his session at 21st Cloud Expo, Raju Shreewastava, founder of Big Data Trunk, provided a fun and simple way to introduce Machine Leaning to anyone and everyone. He solved a machine learning problem and demonstrated an easy way to be able to do machine learning without even coding. Raju Shreewastava is the founder of Big Data Trunk (www.BigDataTrunk.com), a Big Data Training and consulting firm with offices in the United States. He previously led the data warehouse/business intelligence and B...
    In his keynote at 18th Cloud Expo, Andrew Keys, Co-Founder of ConsenSys Enterprise, provided an overview of the evolution of the Internet and the Database and the future of their combination – the Blockchain. Andrew Keys is Co-Founder of ConsenSys Enterprise. He comes to ConsenSys Enterprise with capital markets, technology and entrepreneurial experience. Previously, he worked for UBS investment bank in equities analysis. Later, he was responsible for the creation and distribution of life settle...
    "IBM is really all in on blockchain. We take a look at sort of the history of blockchain ledger technologies. It started out with bitcoin, Ethereum, and IBM evaluated these particular blockchain technologies and found they were anonymous and permissionless and that many companies were looking for permissioned blockchain," stated René Bostic, Technical VP of the IBM Cloud Unit in North America, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Conventi...
    A strange thing is happening along the way to the Internet of Things, namely far too many devices to work with and manage. It has become clear that we'll need much higher efficiency user experiences that can allow us to more easily and scalably work with the thousands of devices that will soon be in each of our lives. Enter the conversational interface revolution, combining bots we can literally talk with, gesture to, and even direct with our thoughts, with embedded artificial intelligence, whic...
    BnkToTheFuture.com is the largest online investment platform for investing in FinTech, Bitcoin and Blockchain companies. We believe the future of finance looks very different from the past and we aim to invest and provide trading opportunities for qualifying investors that want to build a portfolio in the sector in compliance with international financial regulations.
    Product connectivity goes hand and hand these days with increased use of personal data. New IoT devices are becoming more personalized than ever before. In his session at 22nd Cloud Expo | DXWorld Expo, Nicolas Fierro, CEO of MIMIR Blockchain Solutions, will discuss how in order to protect your data and privacy, IoT applications need to embrace Blockchain technology for a new level of product security never before seen - or needed.
    Leading companies, from the Global Fortune 500 to the smallest companies, are adopting hybrid cloud as the path to business advantage. Hybrid cloud depends on cloud services and on-premises infrastructure working in unison. Successful implementations require new levels of data mobility, enabled by an automated and seamless flow across on-premises and cloud resources. In his general session at 21st Cloud Expo, Greg Tevis, an IBM Storage Software Technical Strategist and Customer Solution Architec...
    Imagine if you will, a retail floor so densely packed with sensors that they can pick up the movements of insects scurrying across a store aisle. Or a component of a piece of factory equipment so well-instrumented that its digital twin provides resolution down to the micrometer.
    When shopping for a new data processing platform for IoT solutions, many development teams want to be able to test-drive options before making a choice. Yet when evaluating an IoT solution, it’s simply not feasible to do so at scale with physical devices. Building a sensor simulator is the next best choice; however, generating a realistic simulation at very high TPS with ease of configurability is a formidable challenge. When dealing with multiple application or transport protocols, you would be...
    Nordstrom is transforming the way that they do business and the cloud is the key to enabling speed and hyper personalized customer experiences. In his session at 21st Cloud Expo, Ken Schow, VP of Engineering at Nordstrom, discussed some of the key learnings and common pitfalls of large enterprises moving to the cloud. This includes strategies around choosing a cloud provider(s), architecture, and lessons learned. In addition, he covered some of the best practices for structured team migration an...
    No hype cycles or predictions of a gazillion things here. IoT is here. You get it. You know your business and have great ideas for a business transformation strategy. What comes next? Time to make it happen. In his session at @ThingsExpo, Jay Mason, an Associate Partner of Analytics, IoT & Cybersecurity at M&S Consulting, presented a step-by-step plan to develop your technology implementation strategy. He also discussed the evaluation of communication standards and IoT messaging protocols, data...
    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 ...
    We are given a desktop platform with Java 8 or Java 9 installed and seek to find a way to deploy high-performance Java applications that use Java 3D and/or Jogl without having to run an installer. We are subject to the constraint that the applications be signed and deployed so that they can be run in a trusted environment (i.e., outside of the sandbox). Further, we seek to do this in a way that does not depend on bundling a JRE with our applications, as this makes downloads and installations rat...
    Widespread fragmentation is stalling the growth of the IIoT and making it difficult for partners to work together. The number of software platforms, apps, hardware and connectivity standards is creating paralysis among businesses that are afraid of being locked into a solution. EdgeX Foundry is unifying the community around a common IoT edge framework and an ecosystem of interoperable components.
    DX World EXPO, LLC, a Lighthouse Point, Florida-based startup trade show producer and the creator of "DXWorldEXPO® - Digital Transformation Conference & Expo" has announced its executive management team. The team is headed by Levent Selamoglu, who has been named CEO. "Now is the time for a truly global DX event, to bring together the leading minds from the technology world in a conversation about Digital Transformation," he said in making the announcement.
    In this strange new world where more and more power is drawn from business technology, companies are effectively straddling two paths on the road to innovation and transformation into digital enterprises. The first path is the heritage trail – with “legacy” technology forming the background. Here, extant technologies are transformed by core IT teams to provide more API-driven approaches. Legacy systems can restrict companies that are transitioning into digital enterprises. To truly become a lead...
    Digital Transformation (DX) is not a "one-size-fits all" strategy. Each organization needs to develop its own unique, long-term DX plan. It must do so by realizing that we now live in a data-driven age, and that technologies such as Cloud Computing, Big Data, the IoT, Cognitive Computing, and Blockchain are only tools. In her general session at 21st Cloud Expo, Rebecca Wanta explained how the strategy must focus on DX and include a commitment from top management to create great IT jobs, monitor ...
    "Cloud Academy is an enterprise training platform for the cloud, specifically public clouds. We offer guided learning experiences on AWS, Azure, Google Cloud and all the surrounding methodologies and technologies that you need to know and your teams need to know in order to leverage the full benefits of the cloud," explained Alex Brower, VP of Marketing at Cloud Academy, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clar...
    The IoT Will Grow: In what might be the most obvious prediction of the decade, the IoT will continue to expand next year, with more and more devices coming online every single day. What isn’t so obvious about this prediction: where that growth will occur. The retail, healthcare, and industrial/supply chain industries will likely see the greatest growth. Forrester Research has predicted the IoT will become “the backbone” of customer value as it continues to grow. It is no surprise that retail is ...