SOA Introduction
Oracle SOA Suite Introduction
Oracle SOA Suite is a middleware tool that is used for integration, this tool helps two systems to exchange information between each other. This tool is based upon Service Oriented Architecture.
Versions till date
We have three versions of this tool as mentioned below.
1. 10g
2. 11g
3. 12c
10g was the first version of Oracle SOA Suite tool when it was launched by Oracle and then a few years later Oracle launched 11g version, there are few subversions under 11g version also. Recently in 2014 Oracle has launched 12c version also. This tutorial is based on the Oracle SOA Suite 11g version.
Prerequisites
You should know about below concepts for developers
1. XML
2. XSD (Schema)
3. WSDL
4. SOAP
The following components comprise an Oracle SOA Suite installation:
Service Infrastructure
Oracle Mediator
Oracle Adapters
Business Events and Events Delivery Network
Oracle Metadata Repository
Oracle Business Rules
Oracle WSM Policy Manager
Oracle BPEL Process Manager
Spring Context
Human Workflow
Oracle Business Activity Monitoring
Oracle User Messaging Service
Oracle B2B
Oracle JDeveloper
Oracle Enterprise Manager
Oracle SOA Suite provides a comprehensive suite of components for developing, securing, and monitoring service-oriented architecture (SOA).
Service components (BPEL process, business rule, human task, spring, and mediator) are the building blocks that you use to construct an SOA composite application. The Service Infrastructure provides the internal message transport infrastructure capabilities for connecting service components and enabling data flow. Service engines for the components process the message information received from the Service Infrastructure.
Oracle SOA Suite Introduction
Oracle SOA Suite is a middleware tool that is used for integration, this tool helps two systems to exchange information between each other. This tool is based upon Service Oriented Architecture.
Versions till date
We have three versions of this tool as mentioned below.
1. 10g
2. 11g
3. 12c
10g was the first version of Oracle SOA Suite tool when it was launched by Oracle and then a few years later Oracle launched 11g version, there are few subversions under 11g version also. Recently in 2014 Oracle has launched 12c version also. This tutorial is based on the Oracle SOA Suite 11g version.
Prerequisites
You should know about below concepts for developers
1. XML
2. XSD (Schema)
3. WSDL
4. SOAP
The following components comprise an Oracle SOA Suite installation:
Service Infrastructure
Oracle Mediator
Oracle Adapters
Business Events and Events Delivery Network
Oracle Metadata Repository
Oracle Business Rules
Oracle WSM Policy Manager
Oracle BPEL Process Manager
Spring Context
Human Workflow
Oracle Business Activity Monitoring
Oracle User Messaging Service
Oracle B2B
Oracle JDeveloper
Oracle Enterprise Manager
Oracle SOA Suite provides a comprehensive suite of components for developing, securing, and monitoring service-oriented architecture (SOA).
Service components (BPEL process, business rule, human task, spring, and mediator) are the building blocks that you use to construct an SOA composite application. The Service Infrastructure provides the internal message transport infrastructure capabilities for connecting service components and enabling data flow. Service engines for the components process the message information received from the Service Infrastructure.
Oracle SOA 10g | Oracle SOA 11g | Oracle SOA 12c |
Oracle SOA 10g having NO Service Component Architecture | Oracle SOA 11g contains Service Component Architecture | Single Installer-you only need to install only one setup (SOA Suite 12c), DB/Weblogic/SOA will get installed,Oracle SOA 12c use Java Derby database, which is file based and that makes it really fast. |
10g is based on Oracle AS 10g It uses Oracle Application Server 10.1.x,OC4J, Sun JVM Repository | 11g is based on Oracle FMW 11g It uses the Oracle Weblogic server 10gR3 ,Sun or JRockit JVM Repository |
SOA Templates: With
the introduction of templates sharing of code between teams become easier and
development efforts reduced. There are three types of templates 1)Project Templateintroduced. 2)Component
Template 3)Custom Activity Template
|
10g each component is deployed into particular/Single server | 11g all the SOA Components of Project deployed into into Single Server | Single IDE: In Oracle SOA 12c Jdeveloper is used as IDE for all designs |
10g having ESB Console, BPEL Console, Application Server Control these are all individual and not well integrated. | 11g Provides service monitoring across all SOA Components Such as ESB, BPEL, Enterprise Management Console,Oracle Business Activity Monitoring Oracle Enterprise Manager | Debugger is introduced to debug SOA and OSB applications. With the help of debugger we can debug our code before deploying it; this saves lot of development efforts. |
Repository tool irca to create the SOA 10g repository | Repository Creation Utility (RCU) to create or delete the SOA 11g repository | BPEL Sub-process is introduced in
this launch which helps to reduce redundancy. There are two types of
sub-processes. Standalone sub-process Inline sub-process |
Adapter: Coherence, LDAP and cloud adapter are introduced in this release. | ||
Enterprise Service Scheduler: ESS is out of box scheduler. By using this we can schedule the services. |
ADVANTAGES OF SOA
Oracle SOA Suite is a member of the Oracle Fusion Middleware family of products which is based upon SOA- Service Oriented Architecture so first we need to understand about SOA- Service Oriented Architecture concept. SOA- Service Oriented Architecture as the name suggested this concept further based upon services. So let’s first understand services & web service concept.
Web Service is a unit of work that performs some business function i.e. it is a piece of code written in any language that performs some business function. E.g. Card validation function created in Java. Service is always local to you, not available to anyone. To make it available to everyone we deploy it over the web.
![]() |
WEB SERVICE |
When we deploy any service over the web, it becomes web service as anyone who so ever has access can access that service over the web.
SOA – Service Oriented Architecture is essentially a collection of services. These services communicate with each other. The communication can involve either simple data passing or it could involve two or more services coordinating some activity. In the below diagram, boxes above & below SOA Architecture layers depict services.
Advantage and Features of Oracle SOA Suite tool:
1. Very minimal or no coding required as we build business processes and flow from pre-built components and activities.
2. SOA Suite can be used to deliver more loosely-coupled services.
3. We can build new client functionality on top of existing Business Services.
4. Well defined interfaces- make changes without affecting clients.
5. It is a standard platform that is service enabled and easily consumable by modern web applications.
6. It provides single design-time experience, single run-time infrastructure, end-to-end monitoring and greatly simplifies the work of building, maintaining and monitoring distributed SOA implementations.
7. It is hot-pluggable means it can natively run on, other vendor’s middleware also.
2. SOA Suite can be used to deliver more loosely-coupled services.
3. We can build new client functionality on top of existing Business Services.
4. Well defined interfaces- make changes without affecting clients.
5. It is a standard platform that is service enabled and easily consumable by modern web applications.
6. It provides single design-time experience, single run-time infrastructure, end-to-end monitoring and greatly simplifies the work of building, maintaining and monitoring distributed SOA implementations.
7. It is hot-pluggable means it can natively run on, other vendor’s middleware also.
SOA ARCHITECTURE
WebLogic Server: It is an application server that is based upon J2EE and this has all JDBC drivers, APIs, adapters, etc. deployed. In the earlier version of the SOA suite i.e. 10 g we use to have OC4J but 11g onward we use WebLogic as an application server. We can also deploy our custom application on this application server.
Oracle SOA Suite comprises of major four components as mentioned below and discussed in detail in the next chapters.
1. BPEL : Business Process Execution Language
2. Mediator
3. Business Rules
4. Human Task.
2. Mediator
3. Business Rules
4. Human Task.
Web Service Manager: In short form, this is known as OWSM. This is used to implement security in SOA suite tool. We need not install this separately, this will get installed when we SOA suite tool, we need to select Web Service Manager Option while creating a domain. This brings pre-built security policies that we can use to secure SOA Suite functionality exposed to the outside world, it also provides security policies to access any secured service from the SOA suite tool.
JDeveloper: It is IDE tool to develop SOA suite applications and projects. By default this tool does not SOA suite extensions so while doing the installation; we need to install required SOA suite extensions to develop SOA applications and projects.
Service Component Architecture:
Service Component Architecture is a set of specifications that describe a model for building applications and systems using a Service-Oriented Architecture. I.e. provides a model for composing applications that follow Service-Oriented Architecture principles.
Oracle SOA suite tool is based on SCA- Service Component Architecture, here we get all pre-built components, where we assemble all these components to build business processes. That means as a developer you need not build these components, you just need to assemble it. That assembly is known as SOA composite.
The below diagram depicts one SOA composites that comprise of different parts. This SOA composite is equivalent to one assembly that built after we connect all the different parts.
C1, C2 are components in SOA composite e.g. BPEL, Mediator, Business Rules & Human Tasks. These are also known as service components and these are the building block for composite application. Every component is hosted on its own service engine.
S & R are known as binding components that are used to connect SOA composite with the external world. S is equivalent to Service binding that is used to connect to source and R is equivalent to Reference binding that is used to connect to targets. As you see in the diagram apart from the composite level, every component also has its own service binding and reference binding.
Dotted lines connecting C1 & C2 are known as wire. This enables you to graphically connect the components in an SOA composite application.
SOA Suite Components
Oracle SOA Suite 11g has prebuilt service components that come as part of the SOA Suite tool. These service components are used to build composite applications.
As shown below , these service components use Service Bindings to connect to source/client and use reference bindings to connect to target/reference.
The following service components are available. There is a corresponding service engine of the same name for each service component. All service engines can interact in a single composite.
BPEL: BPEL stands for Business Process Execution Language. BPEL processes provide process orchestration and storage of a synchronous or an asynchronous process. You design a business process that integrates a series of business activities and services into an end-to-end process flow. Details explanation is provided on BPEL in the next chapter.
Mediator: It is a mediation component that route events (messages) between different components. We use this component when components need to interact with each other.
Business rules: It enables you to design a business decision based on rules. This component is used when a user needs a user interface to change their business policies with time without any coding change.
Human task: It provides workflow modeling that describes the tasks for users or groups to perform as part of an end-to-end business process flow. i.e. we use this component when we require human intervention in our business process.
Spring: It enables you to integrate Java interfaces into SOA composite applications.
BPEL
BPEL stands for Business Process Execution Language. BPEL is an XML based language for designing and running business processes. This product provides a comprehensive, standards¬ based and easy to use solution for creating, deploying and managing cross-application business processes with both automated and human workflow steps – all in service¬ oriented architecture.
BPEL is used for Service Orchestration. It is a standard way of composing multiple services into collaborative and transaction process flow. It is based on the OASIS standard called “Web Services Business Process Execution Language” (WS-BPEL).
There are different parts of BPEL as mentioned below.
Service Interface: A WSDL describing the functionality of the BPEL process. The service interface provides the end-user a way to interact with the BPEL process component using Service Interface / Service Binding.
Activities: units of work. The actual elements that make up the BPEL process flow or sequence of instructions to be executed.
Partner links: also called Reference bindings. A partner link describes the roles played for the interaction between the BPEL process and the service it invokes.
Oracle BPEL Process Manager is based natively on BPEL – there is no import or export of BPEL code. Moreover, it’s built ¬in support for standards such as XML, WSDL and Web Services, XSLT, XPATH, JMS, and JCA makes this an ideal solution for creating integrated business processes that are truly portable across platforms.
There are different types of BPEL templates in Oracle SOA Suite.
1. Synchronous Template: In this BPEL process response will return immediately after the request is received. E.g. when you need some information from your friend, you give him/her a call and he/she immediately reply with the required information.2. Asynchronous Template: In this BPEL process, the response will come after some time after the request is received. E.g. when you call your friend for some information, you give him/her a call but he/she doesn’t have that information immediately but he/she provide you that information after some time.
3. One Way Template: In this BPEL process, there is no response message; only request message will be processed. E.g. when you call your friend to pass some information but you don’t expect any response back.
3. One Way Template: In this BPEL process, there is no response message; only request message will be processed. E.g. when you call your friend to pass some information but you don’t expect any response back.
Mediator
A mediator is one of the components of the Oracle SOA Suite tool; it provides mediation capabilities such as selective routing, transformation, and validation capabilities. We use a mediator when components need to exchange information within a composite as it is a very light mediation framework.
We can use a mediator component to connect to different sources and consume a business event or receive a service invocation. You can use an Oracle Mediator service component to handle returned responses, callbacks, faults, and timeouts. The mediator component follows VETRO pattern, where we Validate, Enrich, Transform, Route and do Operations.
Features of Mediator
1. Content-based and Header Based routing.
2. Synchronous and Asynchronous Interactions.
3. Sequential and Parallel Routing.
4. Message Re-sequencing.
5. Data Transformation.
6. Payload validation
7. Event Handling
2. Synchronous and Asynchronous Interactions.
3. Sequential and Parallel Routing.
4. Message Re-sequencing.
5. Data Transformation.
6. Payload validation
7. Event Handling
Routing Rules
It is the core features of the Mediator component – the ability to route data between a source and target. The routing is implemented by adding one or more Routing Rules to a Mediator. Each Routing Rule defines how data flows from a source to a target service, may have additional properties that defined if the data needs to be validated, filtered, and transformed.
There are two types of routing rules in Mediator:
Dynamic routing rule: These rules are used for asynchronous interactions only. Business rules are used in these rules and endpoint is determined at run time from business rules.
Static routing rule: These rules are used for synchronous and asynchronous interactions and these are defined at design time.
Further routing rules are of two types:
Sequential: As the name suggested, Oracle Mediator evaluates routing and performs the resulting actions sequentially. Sequential Routing Rules execute in a single thread and transaction as the caller. Oracle Mediator always enlists itself into the global transaction propagated through the thread that is processing the incoming message. In case of exceptions, it rolls back all transactions.
Parallel: As names suggest, Oracle Mediator queues and evaluate routing in parallel in different threads. Oracle Mediator initiates a new transaction for processing each parallel rule. In case of exceptions, it rolls back transactions in their own thread.
Business Rules
Business Rule is one of the components of the SOA Suite tool. Business rules are statements that describe business policies. It allows a business analyst to change policies with little or no assistance from a programmer. It also enables the business to change their key decisions and policies rapidly and flexibly. There is no need to change the deployed application if there is a need to implement certain logic at runtime.
Business Rules can be used in following different ways.
• A decision component can be used within a SOA composite and used directly to run business rules.
• A decision component can be used with the Advanced Routing Rules in Human Workflow.
• A decision component can be used within a SOA composite and wired to a BPEL component.
• A decision component can be used with the Advanced Routing Rules in Human Workflow.
• A decision component can be used within a SOA composite and wired to a BPEL component.
Business Rules Architecture
As shown below, Composite application interacts with Rules Engine on which Business Rules component runs. All business rules stored in rule repository. Rule author is a web-browser where users can go change the business rules without any code changes.
Let’s briefly introduce the key components which make up a Business Rule. These are:
Facts: Represent the data or business objects that rules are applied to.
Rules: A rule consists of two parts, an IF part which consists of one or more tests to be applied to fact(s), and a THEN part, which lists the actions to be carried out should the test to evaluate to true
Rule Set: As the name implies, it is just a set of one or more related rules that are designed to work together.
Dictionary: A dictionary is the container of all components that make up a business rule; it holds all the facts, rule sets, and rules for a business rule.
Rule Set: As the name implies, it is just a set of one or more related rules that are designed to work together.
Dictionary: A dictionary is the container of all components that make up a business rule; it holds all the facts, rule sets, and rules for a business rule.
Human Task
Human Task is one of the components of the SOA Suite tool. At some end to end business processes, we require human intervention e.g. manager needs approval; in that case, we use this component i.e. Human Workflow component allows us to incorporate human intervention in a business process.
The human task component provides the following features:
- Human interactions with processes, including assignment and routing of tasks to the correct users or groups.
- Deadlines, escalations, notifications, and other features required for ensuring the timely performance of a task (human activity).
- Presentation of tasks to end-users through a variety of mechanisms, including a worklist application (Oracle BPM Worklist).
- The organization, filtering, prioritization, and other features required for end-users to productively perform their tasks.
- Reports, reassignments, load balancing, and other features required by supervisors and business owners to manage the performance of tasks.
- BPEL process invokes human workflow with human task activity. This creates a task in the human task service component. The process waits for the task to complete.
- There is metadata associated with the task that is used by the human task service component to manage the lifecycle of the task. This includes specification of the following:
- Who performs the task? If multiple people are required to perform the task, what is the order? Who are the other stakeholders? When must the task be completed?
- How do users perform the task, what information is presented to them, what are they expected to provide, and what actions can they take?
- The human task service component uses an identity directory, such as LDAP, to determine people’s roles and privileges.
- The human task service component presents tasks to users through a variety of channels, including the following:
- Oracle BPM Worklist, a role-based application that supports the concept of supervisors and process owners, and provides functionality for finding, organizing, managing, and performing tasks.
- Worklist functionality is also available as portlets that can be exposed in an enterprise portal.
- Notifications can be sent to email, phone, SMS, and other channels. Email notifications can be actionable, enabling users to perform actions on the task from within the email client without connecting to Oracle BPM Worklist or Oracle WebLogic Server.
Adapters
It is a JCA Binding component, which is a lightweight implementation that uses JCA standards for inbound and outbound communications. It provides an interaction layer between the integration server and another application. This enables interoperability with heterogeneous applications, provided by different vendors, based on different technologies and platforms. The JCA Binding component allows the composite application to integrate with a service exposed through the adapter as if it were a Web service. i.e. These adapters help us to connect to an external system for both inbound and outbound interactions.
Types of Adapters:1. Oracle Technology adapters
2. Legacy Adapters
3. Packaged Application
4. Oracle Application
Files/FTP:These adapters are used to connect to file and FTP system. File adapter is used to read both flat & XML files from local file system. FTP adapter is used to read both flat & XML files from a remote machine. We can perform below operations in these adapters.a. Read file
b. Write file
c. Sync Read
d. File ListingJMS/AQ/MQ:
These adapters are used to read the messages from JMS, AQ & MQ. JMS is an open/Java standard, AQ (Advanced Queue) is an oracle standard and MQ (Message Queue) is IBM standard. We can perform below operations in these adapters.a. Read
b. write
c. Sync Read & WriteDatabase:
This adapter is used to interact with the database. we can connect to different databases (like Oracle, DB2, SQL, etc) using this adapter. In case we need to connect to non-oracle databases then we need to import require drivers as these drivers are there by default. We can perform below operations in this adapter.a. Call stored procedure
b. CRUD operations
i. Select
ii. Delete
iii. Update
iv. Insert
v. merge
c. Poll for new or changes records
d. Execute pure SQLError Handling
Error or Fault occurs when web services return data other than what is normally expected. E.g. web service return error message instead of credit card status. In Oracle SOA Suite, mainly we have two types of faults.Business Faults:
When we have an error or fault-based Business functions, it is known as business faults. e.g. Invalid credit card number, Invalid age, etc. These faults are user-defined and application-specific.Technical (Runtime) Faults:
Runtime faults are the result of problems within the running of the BPEL process service component or web service. These faults are not user-defined and are thrown by the system. Below are the most commonly faced runtime faults in the SOA Suite tool.binding fault: A binding fault is thrown inside activity if the preparation of the invocation fails. For example, the WSDL of the process fails to load. A binding fault is not retryable. This type of fault usually must be fixed by human intervention.remote fault: A remote fault is also thrown inside an activity. It is thrown because the invocation fails. For example, a SOAP fault is returned by the remote service.In BPEL, we have some standard faults defined. these defined by WS-BPEL specifications and these are not associated with a message type or WSDL message and can be caught without a fault variable. These faults are thrown by the systems.In Oracle SOA Suite, we can handle the faults in following ways.
Catch BlocksWe use Catch & CatchAll blocks to handle the faults at the BPEL component level. we use a Catch block to handle specific fault like to handle remote fault and we use CatchAll block when we don’t know about the fault as this block handles all the faults.We can have only one CatchAll block in one BPEL process but we can have more than one Catch block in BPEL process. If we have both Catch & CatchAll block in one BPEL then Catch block executed first.Fault Handling Framework
This is another way to handle the faults in the Oracle SOA Suite. The main difference between these two methods is that in Catch Block we can only handle the error at BPEL level as we can’t apply these blocks in other components. e.g. to handle errors in the Mediator component we use Fault Handling framework not Catch blocks.The fault handling framework only handles faults that occur during runtime in an invoke activity in a process, the framework catches the fault and performs a user-specified action defined in a fault policy file associated with the activity.We need the following two files for policy-driven fault handling:fault-policy.xml: This file defines one or more fault Policies with conditions and actions. In this file, we define what type of error we want to handle and what action we need to perform when that fault occurs. In one file, we can define more than one policy as each policy will have one unique id.fault-bindings.xml: This file associate a policy with a composite application, a component, or a reference.SOA Start and Stop Server
We can start/stop the managed servers in two ways1) command line
2)Oracle Enterprise Manager Fusion Middleware ControlWhen we work on the SOA Suite tool on our local environment, we need to start our server before we start working on it and later once we complete all our work, we need to stop the server.
Follow the below steps to start and stop the SOA Suite server. Start ServerBefore we start SOA Suite server, we need to ensure that our database is up and running. Click on the Start Database link as shown below to start the database.
Start SOA suite server steps depends upon how we configure our domain, if we have selected ” Oracle SOA Suite for Developer” option then we need to run only one command that will start both Admin (WebLogic) and Managed server (SOA Suite). But in case we have selected other option “Oracle SOA Suite” then we need to run two commands, one for admin (WebLogic) server and other for the managed server (SOA Suite).
1) command line
Oracle SOA Suite for developer Option:
Go to {MIDDLEWARE_HOME}\user_projects\domains\base_domain\bin directory and run startWebLogic.cmd command.
Oracle SOA Suite Option Selected:
To Start Admin Server (WebLogic) :
Go to {MIDDLEWARE_HOME}\user_projects\domains\base_domain\bin directory and run startWebLogic.cmd command.
To Start Managed Server (SOA Suite):
Go to {MIDDLEWARE_HOME}\user_projects\domains\base_domain\bin directory and open it in command prompt. Then run below command.
startManagedWebLogic.cmd soa_server1Stop Server
We can simply click ctrl+c to stop the server or we can run stopWebLogic.cmd to stop admin server and stopManagedWebLogic.cmd to stop managed server.
2)Oracle Enterprise Manager Fusion Middleware Control
Perform the following steps to stop and start the server from Oracle Enterprise Manager Fusion Middleware Control.
- Expand the WebLogic domain.
- Select the managed server (for example, named soa_server1).
- Select Control --> Shut Down.
- Select Control --> Start Up
Get Started with SOA Oracle 12c - Hello World Example
Prerequisites:
- Install Oracle SOA 12c
- Configure default domain and start the server
Let’s get started with the example. First create a new SOA application,If you are not able to see SOA Application then first you need to install Extension SDK in JdeveloperName your SOA application and BPEL process. We choose standard composite as we are not creating this composite from any template.Once you create the composite, Drag BPEL process to it.Add synchronous BPEL to the empty composite.Add assign activity which simple assign request to response.Now deploy your composite to integrated server.Once you deploy it go to Application Servers and go to IntegratedWebLogicServer -> SOA -> Default Server -> {Partiiton_Name} -> {Composite}Right click on the composite to test it. You may face below error when you try to test it.Error: Error occurred while opening service WSFL URLTo avoid this error we need to disable SSL listen port for server. To do that goes to admin console (http://host:port/console)Click on Home -> Servers ->Deafultserver -> Configuration ->GeneralUn-check “SSL Listen Port Enable” and restart the server.Now test again your composite.You see it will open HTTP Analyzer and we can test the composite from here only. We need not to open EM console and test it from there.Provide input value and you see response.
BPEL process interacts with human workflow with human task activity, we use that activity in BPEL when we need human intervention.
In the Human task service component, we have three parts. The first part (Service Part) uses to interact with the BPEL process. Second Part (Client Interface) is used to interact with client applications. In the third part (Task Definition) we create a required human task.
Below is how the human workflow works.
No comments:
Post a Comment