Get Started with SOA Composite Application

By Rudi Acikgoz, 05 March 2010 14:06

As combining SOA and composite application concepts together, I installed Oracle SOA Suite 11gR1 product to my computer. To illustrate a real world utility I wanted to implement a translator, and then I wrote down a sample user story as follows to develop a sample application.


1) Get the translation text from the user with the values of source and target language
2) Then validate input values and make a decision about translation
2-a) if the source and target language values are the same, then terminate the process
2-b) if the translation fails, then inform the user
2-c) if the translation is completed successfully, then return the translated text to the user

It is clear that the scenario is enough for involving mediator, process and composite application concepts in the sample application named as SoaSuite11gR1SampleApps. The application consists of two SOA Composite applications named as TranslationServiceProject and TranslationProcessProject. The TranslationServiceProject includes service and mediator component implementation for handling translation service. First of all, the main translation operation is handled by an external RESTful service owned by Google. TranslationProcessProject have a bpel resource for implementing business validation, which test the condition that whether the language pair value is valid or not, and it has a invoke component for calling translation service. As bottom-up approach is applied for development, implementation of the translation service, translation mediator, translation process in order is mentioned below.

I created TranslationServiceProject by using Oracle JDeveloper and defined ServiceObjects.xsd shown in Figure 1. Service objects are translationSource element, which has user specified texts include source text, source language, target language of translation service, and translationResponse element, which stands for response of the translation service. By the way, I need to say that XSD is duplicated in TranslationProcessProject for the exemplify the concepts related with service invocation. Next, I defined TranslatorMeditor component with selecting those service objects shown in Figure 2. Mediator component definition includes request-response data objects and template selection about the behavior of the component. Then I developed  TranslatorMediatorCalloutClass that is the client of that service which send all the inputs (text, source-target language pair) by receiving translation result at the end. At that point, I needed to declare 2 libraries that first one is a JAR for creating the client of RESTFul service and the second one is XML parser as shown in Figure 3. In that figure, there are third parts that the first one shows adding particular JAR file for JSON, next one shows adding a predefined library and the last one is for final view. Then, I created a mediator callout class named as TranslatorMediatorCalloutClass by defining AbstractJavaCalloutImpl as the superclass. Looking at postRouting method, the client of Google’s translator RESTFul service can be analyzed. Then, “Echo” type routing table is defined as shown in Figure 4. There are three parts in the figure to show that Java Class creator wizard, mediator plan view and XSL resource development wizard of Translation Mediator. There is a XSL file declaration in the routing table, it is used for defining response object’s initial message that “No matched found”. Finally, I deployed and tested the TranslationServiceProject composite application.

Figure 1

Figure 1



Figure 2

Figure 2



Figure 3

Figure 3



Figure 4

Figure 4



I defined Oracle SOA Server as an application server in JDeveloper to make deployments automated. Both composite applications are deployed via JDeveloper and tested in browser. JDeveloper is successful on build and deploy operation of composite application for SOA Server. But I must confess here that, I was unhappy with JDeveloper instead of using Eclipse environment during the implementation. After buying SUN, I get worry about the future of Oracle products’ interaction with Eclipse. Such a big vendor, I think Oracle should pay more attention on supporting Eclipse that is most valuable and respectable among the Java developers. Anyway, the deployment wizard view in JDeveloper by using predefined SOA Server illustrated in Figure 5 and testing via browser and server console result is shown in Figure 6.

Figure 5

Figure 5



Figure 6

Figure 6



As the last step of flow, I developed TranslationProcessProject by creating TranslationProcess bpel resource. Then, I defined partner link for translation service to bind it in the bpel. The selected options and wiring the components via declarations can be analyzed in Figure 7. The figure shows bpel resource creator wizard, partner link creator wizard and wiring the partner link to the business process in the composite configuration file in order. The most important action is binding partner link to the process itself that should be ready for invoke component of the process. So, Receive-Reply components were initially created for the business process. I added that assign components for initializing process variables and invoke component variables, a Java-Embedding component for logging (As most best practices says, do not use such vendor-based extensions as possible as you can. It is just used for exemplifying purposes.), and an invoke component to call translation service. The final bpel view including configuration of partner link of invoke component can be seen on Figure 8. Finally, it is the last step of implementation and similar to Figure 6, the illustration of testing the process can be seen on Figure 9.

Figure 7

Figure 7



Figure 8

Figure 8



Figure 9

Figure 9


Bookmark and Share
VN:F [1.9.3_1094]
Rating: 5.0/5 (2 votes cast)
VN:F [1.9.3_1094]
Rating: 0 (from 0 votes)
Get Started with SOA Composite Application, 5.0 out of 5 based on 2 ratings

Leave a Reply

Spam Protection by WP-SpamFree