SlideShare a Scribd company logo
1. SERVICEORIENTED ARCHITECTURE
What is SOA?
Service Oriented Architecture. T his could be the basic definition of SO A.
But why is the name SO A?
SO A is an architectural approach for building business process with integration of loosely coupled applications/software
(Service Orientation).
M ost of you might be thinking what the hell does that mean?
SO A originated with the concept of Service orientation. Service orientation is listening and understanding the customer
(customer can be working on different platforms but they want to access application build on a different environment).
T hat seems to be easy with words but I still did not get what does SOA means.
Let us start with basic understanding of evolution of SO A.
C onsider a so called problem definition with which we will try to:
 A nalyze and understand problems faced with orthodox implementation of the software.
 How did evolution of SO A happened
 How would SO A implementation help business gain revenue?
A ssume that you are a businessman which everyone in the IT industry thinks to be one day, planning/dreaming
everyday to start a side business. T his is one typical example which is used everywhere, as we can find a lot of help with th is
typical example. We have tried to make it a bit simple for beginners to understand with help online.
So I being a small middle class IT guy I have a brilliant idea to start a small mortgage business where I lend money at low r ate
of interest. I start with an online service where user can login and apply for a loan. With analysis we defined a problem
definition for the service.
P roblem definition:
1) If the rate of interest for the loan application is less than 5%, then the application for the loan has to go through a
special approval from the management. Where the management would analyze the requirement of the applicant his needs and
approve.
2) A ll other application can be directly sanctioned by the service, conditioned on having the details of the applicant.
T hinking like a business man I start with thinking on how to save money, so what I plan to implementing the
software all by yourself as I have the background of software after all my parents have spend so much of money it should be
used somewhere.
With all my knowledge and IT background I plan to start with the implementation.
Basic and the most import thing for software is its architecture. So below is how I plan to implement my software:
 First page of the screen (assuming will implement login later on) which accepts the user information and details of loan to b e
sanctioned.
 O nce the user enters the details, save the user details in a user details table and route the request to call appropriate methods,
say requestWithRateBelowFive() and requestWithRateAboveFive().
 C all these methods based on the request type i.e details and background information and capability to pay the EM I.
A fter 6 long months of work and rigorous testing of my software, I plan to put my software live.
With all the domain registration done my software is live.
Now my project is live and is giving me a lot of profit. With the increased profit I want to have mor e functionality to be added
in my software.
Extension to problem definition:
 Where I can retrieve the details of the user who are consistent with their EMIs and are loyal customer to the company. A t the
same time with millions of dollars in as my liquid cash I have acquired a company which gives special offers to the user with
auto loans with low rate of interest.
P roblems:
 With the current implementation of my project I will have to modify the entire implementation to include the new offer and
merge the new companies’ software into my software.
 T his will result in downtime for 2 days which is directly proportional to loss of significant amount of revenue and customers .
T his implementation/architecture of project is called as point to point integration.
T his is one of the oldest and original integration patterns.
It derives its name from the direct, tightly bound connections that are made between applications and is the simplest of the
integration architectures.
T here are advantages with point to point integration:
 P oint-to-Point solutions are often fast and efficient.
 T he efficiency that derives from applications being tightly bound is one reason why at least a few P oint -to-Point solutions will
continue to be utilized for the foreseeable future.
What are the drawbacks with the current implementation/architecture of the product?
 A s the number of applications increases so does the overall complexity of the environment.
 High maintenance costs and a lack of flexibility, when it becomes necessary to make chang es.
Conclusion:
T he basic problem is the A rchitecture of the product, to be specific “Integration architecture”.
2. INTEGRATIONARCHITECTURE
So what is Integration architecture and how is it significant for a fast growing business.
C onsider an example of a well deigned building where all electrics and plumbing keep working no matter how many appliances
are switched on or connected.
T his building is capable enough for extension without tearing up the blueprint and start again with new electrical connection.
T his is an example of good architecture.
T he same applies to software systems. Software architecture is the backbone of any complex computer system. T he
architecture encompasses all of the software elements, the relationships between the elemen ts and the user interfaces to
those elements. T he performance and reliability of a software system are highly dependent upon the software architecture.
Well-designed software architecture can be extended with relative ease to accommodate new applications without requiring
extensive infrastructure development.
Now question comes down to how can we eliminate this downtime and in future with new acquisitions integration.
T here are many other types of INTEGRATION ARCHITECTURE:
3. HUB AND SPOKEINTEGRATIONARCHITECTURE
T he earliest formal integration technologies worked on the principle that all information coming from the applications
had to be processed within a single machine or server called a “hub”. A cting as a central point of control, the hub dealt with all
message processing including routing, splitting and combining of messages, mapping, and so on.
Hub and Spoke implementations decouple the sending and receiving applications. U nlike P oint -to-Point, the applications on
either side of the hub can be modified independently of each other. Since applications no longer need to perform data
mapping, centralized definition and control of business processes could be easily achieved for the first time.
Hub and Spoke A rchitecture
C entralized Integration P rocessing Hub
What are the advantages of Hub and Spoke architecture?
With Hub and Spoke, the integration environment becomes less complex. Whereas Point-to-Point becomes impossibly
complicated as the number of connections increase, Hub and Spoke remains, in principle, simple since all the connections are
to and from the hub. Hub and Spoke is the preferred architecture for achieving an easily controlled and managed environment
in a medium sized integration project.
What are the disadvantages of Hub and Spoke architecture?
With Hub and Spoke, the initial setup of two-way communications can be challenging. T he hub has to coordinate messages
flowing between applications, and at the same time applications on both sides of the hub need to work well in a decoupled
fashion. Both the source and target applications need some knowledge of each other in order to process messages. T his
sometimes makes it difficult to add or remove senders and receivers.
Since the hub must control all of the integrated processes, it is a viable option only when both sender and receiver agree on
which hub to use. T his will not be a problem for companies that are integrating internally, but may become a serious issue fo r
Business to Business (B2B) and even cross-departmental integration projects.
U nfortunately, with so much processing taking place in the central hub, Hub and Spoke exacts high overheads. P rocesses
within the hub often require significant processing power and lots of disk space. A s the number and complexity of proce sses
increase, performance can suffer and hubs often become difficult to manage, maintain, and extend.
P ure Hub and Spoke implementations do not scale well. O ne solution is to create a Federated architecture, which is an
extension of Hub and Spoke that allows for multiple hubs to provide load sharing and back-up in case of failure.
4. DISTRIBUTEDINTEGRATIONARCHITECTURE
In distributed architecture:
M essage translation, routing, splitting, and combining are performed closer to source and target system by using smaller
computers called agents. A gent computers are connected to just one system and reduce the processing load on that system.
A gents take information from the application they are connected to, process it, and send it to any target appli cation(s)
interested in receiving that information.
T his is also known as peer to peer integration architecture.
What are the advantages of Distributed architecture?
Distributed architecture is governed by centralized rules and the requirements of the bu siness flow. M ost of the processing is
performed in agent processors located near the source and target applications. Besides gains in processing efficiency by
distributing the workload among dedicated processors, a Distributed A rchitecture is able to grow relatively easily.
What are the disadvantages of Distributed architecture?
M any organizations have a mix of platforms and operating systems on which their business applications run, a situation that i s
often the result of mergers and acquisitions. When it becomes necessary to change or expand the system architecture, it is
unfortunately not simply a matter of choosing one of the distributed technologies and implementing it. O pting for one
technology may only provide a distributed solution for half of your organization due to the mix of systems that are being used.
Beyond these internal problems, there is also the issue of engaging in Business to Business (B2B) exchanges with other
companies. T his is another case where an eclectic mix of systems and technolo gies between businesses can impede the use of
Distributed Architecture.
5. SERVICEORIENTED ARCHITECTURE (SOA)
Service Oriented A rchitecture (SOA) is the latest architectural approach, although it’s not really very new.
Service Oriented A rchitecture is essentially an enhanced version of Distributed Architecture that uses loosely coupled software
services to support the requirements of business processes and software users.
It goes a step further than the previous architectures by providing an integrated environment which spreads out the workload,
breaking down the different “silos” of business functionality and opening their processes to other applications.
A pplications comprised of loosely bound Web Services.
One way to think of SOA is like a Lego set. A Lego set is more than just the individual blocks; specialized bigger pieces for
complex creations are also available. Similarly, with SO A, an application can customize and/or change the individual pieces o r
“services” that it uses. U sing these concepts, vast and complex component based applications can be developed.
T he breakthrough for SO A came with the acceptance of Web Services, where different vendors agree to a common
communication a standard which is XML.
A fter Web Services came Enterprise Service Bus (ESB) technology. Based on Web Services, and exhibiting all of the
characteristics of the M essaging solutions previously supplied by the integration vendors, ESB has become the accepted
standard for the creation of an organization’s Service Oriented A rchitecture. Without exception all of the integration vendors
now provide an SO A architecture built on the concept of an Enterprise Service Bus (ESB).
T o summarize the definition, SOA is an architecture pattern to integrate loosely coupled applications in to one system.
IT companies have started to realize that the ultimate objective these days for building a system would be to automate
business processes i.e. to develop applications that would provide a complete flow of the process from its end to the beginning.
T here are many challenges that an IT company building the application would face. T wo of the basic challenges which lay the
basic foundation of the developing business process are:
1) Every company does not have the same requirements.
2) C hanges are constantly incorporated in a business process to compete; the enterprise service has to be flexible enough
to incorporate the changes.
If you are still not clear with the definition you may say that this statement contradict with the basic requirement on which a
service is build i.e. stability and availability to process as and when required. Here it goes again with very simple and cle ar
words. SOA is aggregation of such stable services. Services are constructed to be stable and efficient while aggregations
are designed to be agile or rather accept the changes.
Hence these loosely coupled services (Service O riented) aggregations are much more open to changes rather than the
orthodox monolithic services that require ages to incorporate even a small change in the service.
Now the questions arises how are these independent stable services aggregated to design a loosely coupled system? How do
we ensure that the stability of the service will be maintained if it is coupled with another se rvice which is constructed on a
different platform?
T he answer to the questions is standardization of the platform on which the services are coupled. T hese services remain stable
by relying themselves on standard based interfaces and standard/defined messa ges (SOAP/Schemas).
I hope the basic question of why SO A is introduced in IT industry and how would it look like in a top view of the system is
clear.
For a beginner there are millions of questions that needs to be answered with respect to the ingredients to coupling of services,
how are these services deployed and on what platform do we couple or rather how do we incorporate the standardization to
integrate this system. I hope the next upcoming section of SO A would answer their questions.
6. EXTENSIBLEMARKUPLANGUAGE
What is XML?
From definitions of W3C :
 XM L stands for EXtensible M arkup Language.
 XM L is a markup language much like HTML.
 XM L was designed to carry and store data, not to display data.
 XM L tags are not predefined. Y ou must define your own tags.
 XM L is designed to be self-descriptive.
 XM L is a W3C Recommendation.
Example:
<note>
<to>T ove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don’t forget me this weekend!</body>
</note>
Where:
T he tags in the example above (like <to> and <from>) are not defined in any XM L standard.
T hese tags are “invented” by the author of the XM L document.
What is XM L namespace?
XM L Namespaces provide a method to avoid element name conflicts.
T he XM L namespace is a special type of reserved XM L attribute that you place in an XM L tag.
T he reserved attribute is actually more like a prefix that you attach to any namespace you create.
T his attribute prefix is “xmlns:”, which stands for XM L NameSpace.
T he colon is used to separate the prefix from your names pace that you are creating.
What is XML Schema?
A n XM L Schema describes the structure of an XM L document.
T he XM L Schema language is also referred to as XML Schema Definition (XSD).
A n XM L Schema:
 defines elements that can appear in a document
 defines attributes that can appear in a document
 defines which elements are child elements
 defines the order of child elements
 defines the number of child elements
 defines whether an element is empty or can include text
 defines data types for elements and attributes
 Defines default and fixed values for elements and attributes.
7. WEB SERVICE DESCRIPTIONLANGUAGE
What is WSDL?
 WSDL stands for Web Services Description Language
 WSDL is written in XM L
 WSDL is an XM L document
 WSDL is used to describe Web services
 WSDL is also used to locate Web services and the operations (or methods) the service exposes.
 WSDL is a W3C recommendation.
T o start with any software we have client requirements.
T hese requirements define the input and the output elements of the service.
T he data types of the input and output messages in terms if whether the input message will have a U ser ID with a length
defined of 8 characters and it shout be of string type.
T hese requirements are like a contract between the provider of the service and the user of the service. T he user cannot
access the service if it provides the input (U ser ID) with more than 8 characters and the provider of the service needs to th row
a fault or make the service unavailable for the user with U s er ID more than 8 characters.
T his contact is defined in a document called WSDL on which web service is constructed.
Y ou can say that WSDL is the stilt of a web service.
WSDL is definition of web service in its language i.e. XM L.
It is a contract between the service provider and the user.
It is a description of the web service.
WSDL can be broken down to 4 critical chunks.
1. Interface information/ Operation information.
2. M essage Information/ Data type information.
3. Binding Information/ T ransport Information.
4. A ddress Information/ Location Information.
With respect to constructing a WSDL it can be defined with 6 major elements:
1. definitions
2. types
3. message
4. portT ype
5. binding
6. service
Y ou might be thinking why I have written the elements name in lower case.
T his would sound a bit stupid but this is how the elements appear in the wsdl definition.
Let us look at a sample WSDL now.
<?xml version=”1.0″ encoding=”U TF-8″ standalone=”no”?>
<wsdl:definitions xmlns:soap=”http://schemas.xmlsoap.org/wsdl/soap/”
xmlns:tns=”http://www.example.org/NewWSDLFile/” xmlns:wsdl=”http://schemas.xmlsoap.org/wsdl/”
xmlns:xsd=”http://www.w3.org/2001/XMLSchema”
name=”NewWSDLFile” targetNamespace=”http://www.example.org/NewWSDLFile/”>
<wsdl:types>
<xsd:schema targetNamespace=”http://www.example.org/NewWSDLFile/”>
<xsd:element name=”NewOperation”>
<xsd:complexType>
<xsd:sequence>
<xsd:element name=”in” type=”xsd:string”/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name=”NewOperationResponse”>
<xsd:complexType>
<xsd:sequence>
<xsd:element name=”out” type=”xsd:string”/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:types>
<wsdl:message name=”NewOperationRequest”>
<wsdl:part element=”tns:NewOperation” name=”parameters”/>
</wsdl:message>
<wsdl:message name=”NewOperationResponse”>
<wsdl:part element=”tns:NewOperationResponse” name=”parameters”/>
</wsdl:message>
<wsdl:portT ype name=”NewWSDLFile”>
<wsdl:operation name=”NewOperation”>
<wsdl:input message=”tns:NewOperationRequest”/>
<wsdl:output message=”tns:NewOperationResponse”/>
</wsdl:operation>
</wsdl:portT ype>
<wsdl:binding name=”NewWSDLFileSOAP” type=”tns:NewWSDLFile”>
<soap:binding style=”document” transport=”http://schemas.xmlsoap.org/soap/http”/>
<wsdl:operation name=”NewOperation”>
<soap:operation soapAction=”http://www.example.org/NewWSDLFile/NewOperation”/>
<wsdl:input>
<soap:body use=”literal”/>
</wsdl:input>
<wsdl:output>
<soap:body use=”literal”/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name=”NewWSDLFile”>
<wsdl:port binding=”tns:NewWSDLFileSOAP” name=”NewWSDLFileSOAP”>
<soap:address location=”http://www.example.org/”/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
In the WSDL described above all the 6 elements are highlighted in black. Y ou would by now have concluded that a WSDL is
aggregation of these 6 elements.
Let us now see what exactly these 6 elements consists of and why are they included in a WSDL definition.
1) definitions: It is the root element of all the WSDL document.
It defines the name of the web service.
<wsdl:definitions name=”NewWSDLFile” xmlns:soap=”http://schemas.xmlsoap.org/wsdl/soap/”
xmlns:tns=”http://www.example.org/NewWSDLFile/” xmlns:wsdl=”http://schemas.xmlsoap.org/wsdl/”
xmlns:xsd=”http://www.w3.org/2001/XMLSchema” targetNamespace=”http://www.example.org/NewWSDLFile/”>
</wsdl:definitions>
It defines various namespaces that is used through out the document.
2) types: It describes the data type of the message being exchanged.
If the message exchange is only in terms of simple data types as string and integer then this types element would not be
required.
O ne more thing to notice is WSDL does not use any exclusive typing system, but if not declared it uses W3C XML schema
specifications as the default choice.
<wsdl:types>
<xsd:schema targetNamespace=”http://www.example.org/NewWSDLFile/”>
<xsd:element name=”NewOperation”>
<xsd:complexType>
<xsd:sequence>
<xsd:element name=”in” type=”xsd:string”/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name=”NewOperationResponse”>
<xsd:complexType>
<xsd:sequence>
<xsd:element name=”out” type=”xsd:string”/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:types>
3) messages: It provides the abstract of the message being transferred in a one-way transmission. It can contain one or
more part elements which can refer to message parameters or return values.
<wsdl:message name=”NewOperationRequest”>
<wsdl:part element=”tns:NewOperation” name=”parameters”/>
</wsdl:message>
<wsdl:message name=”NewOperationResponse”>
<wsdl:part element=”tns:NewOperationResponse” name=”parameters”/>
</wsdl:message>
4) portType: portT ype combines multiple message elements defined above to complete the round trip of the operation.
Each operation to complete its service needs to have a set of request and response message which is described in the message
elements.
Each portType can have multiple operations element.
<wsdl:portT ype name=”NewWSDLFile”>
<wsdl:operation name=”NewOperation”>
<wsdl:input message=”tns:NewOperationRequest”/>
<wsdl:output message=”tns:NewOperationResponse”/>
</wsdl:operation>
</wsdl:portT ype>
Let us link up the 3 elements above and see where we have reached in terms of WSDL description.
Starting from the bottom, each web service has an operation or it can have many operations to perform. Each operation during
its service takes an input request and delivers an output response. T his operation is defined in portT ype element described
above. T his input and output messages has multiple parameters or data types that is described in the element message. T he
data type can be defined separately as a combination of many sub data types or elements which is describes under types
element.
5) binding: T his element describes the concrete protocol/standard on which the service will be implemented. It describes
the data format specification on which the message and operations are defined. WSDL has a build in extension for defining
SO AP based services. Hence SOAP specific information goes under this element.
<wsdl:binding name=”NewWSDLFileSOAP” type=”tns:NewWSDLFile”>
<soap:binding style=”document” transport=”http://schemas.xmlsoap.org/soap/http”/>
<wsdl:operation name=”NewOperation”>
<soap:operation soapAction=”http://www.example.org/NewWSDLFile/NewOperation”/>
<wsdl:input>
<soap:body use=”literal”/>
</wsdl:input>
<wsdl:output>
<soap:body use=”literal”/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
6) service: T his element describes the location or the address for invoking the service. It is used to aggregate a set of ports
to retrieve the location to access the specific service.
<wsdl:service name=”NewWSDLFile”>
<wsdl:port binding=”tns:NewWSDLFileSOAP” name=”NewWSDLFileSOAP”>
<soap:address location=”http://www.example.org/”/>
</wsdl:port>
</wsdl:service>
So there it is we are done with the creation of a WSDL. A ll the elements defined here aggregated will let us define a web
service contract.
T his WSDL is a very important aspect of a web service.
T his contract defines all the elements/parameters needed in the request and response of the operation and which is agreed
upon by the provider and user of the web service.
Based on the requirements from the client the elements are described in the messages.
T he input that is received from the user to the operation is validated against the operation elements described in the WSDL.
T heir input cannot violate the description of the input message in the WSDL, which is an important aspect of web -services
security operations.
8. ORACLE SERVICE BUS
A s explained earlier service bus is a solution to problems faced by poor integration architecture.
8.1. Bus, what Bus?
T he use of a Service Bus pattern helps to decouple the pieces from each other, messages are passed between the components
in the form of asynchronous event topics in a publish/subscribe pattern, that allows every part to be decoupled from the othe r
part and we do not need to span transactions or hold connections between the internal components that would ultimately
cause a degradation in the performance of the system.
T he Service Bus should also perform the routing of messages between the components so no components would have to be
dependent on the knowledge of the location of another component.
C onnections between the user interface will and should be point to point as this is required for the component to perform its
duty within the constraints that are imposed upon it, the same holds true for software architectures.
T he reduction of dependency on other parts should be driven as far down into the architecture as is reasonable, as this will
lead one down the path of flexibility and testability.
Introduction:
A proven, lightweight, configuration based, policy driven integration techno logy specifically designed for the task of integrating,
virtualizing, scaling service management, and traditional message brokering across heterogeneous IT environments and
managing services in a service-oriented architecture (SOA), O racle Service Bus enables you to achieve value more quickly with
simple, code-free, configuration based service integration. Y ou will be able to move toward enterprise wide SOA deployments
with a high-performance, highly scalable SOA integration backbone.
T he O racle Service Bus (O SB) provides service bus capabilities for the entire company, again including standard functionality
as transformation, routing, event delivery and payload validation. It’s main function is to decouple intra -application
communication from inter-application. Endpoint changes will not affect the internals of composite applications. T he O SB is
based on the A qualogic Service Bus, augmented with key features from the O racle ESB, especially JCA adapters, DVM, X -ref
and JDev based design-time.
A dvantages:
Location transparency: Isolate from changes to service location.
Backward compatibility: isolate from changes to service contact on the new service added.
Service enablement: allow multiple protocols/messages to participate in SOA.
Dynamic routing: U se business rules to determine destination service.
Message enrichment: update the message using the response from another service.
8.2. Resources in Oracle Service Bus
In O racle Service Bus world, all the artifacts are called the O SB resources. In a typical SOA environment, there will be a need
to share the different resources across the projects. T he resources can be anything like WSDLs, XSDs, P roxy, Business service
etc.
We cannot create all kinds of resources in the O SB Configuration P roject. For example creating WSDL or XSD in configuration
project will give the error. We can only create the Global Resources like Proxy Server, JNDI Provider and SM TP Server. A ll
these resources that can be created in the O SB Configuration P roject can be accessed from different O SB projects present in
the C onfiguration Project.
8.3. Proxy Services and Business Services
O racle Service Bus provides intelligent message brokering between business services (such as enterprise services
and databases) and service clients (such as presentation applications or other business services) through proxy services that
you can configure using O racle Service Bus Console. P roxy services are O racle Service Bus definitions of intermediary Web
services that O racle Service Bus implements locally on WebLogic Server. With O racle Service Bus message brokering, service
clients exchange messages with an intermediary proxy service rather than working directly with a business service.
O racle Service Bus allows you to implement proxy services independently and configure them dynamically, as driven by your
business needs without requiring costly infrastructure development efforts. T he configuration functions are separated from the
management functions in O racle Service Bus C onsole. A proxy service can route messages to multiple business services; you
can choose to configure a proxy service with an interface that is independent of the business services with which the proxy
service communicates. In such cases, you can configure a message flow definition to route a message to the appropriate
business service and map the message data into the format required by the business service’s interface.
Business services are O racle Service Bus definitions of the enterprise services that exchange messages during business
processes. A business service and its interface can be defined and configured using the O racle Service Bus C onsole. T o
configure a business service you must specify its interface, type of transport it uses, its security requirements, and other
characteristics.
A business service definition is similar to that of a proxy service, but it does not have a p ipeline.
8.4. Message Flows and Pipelines
In O racle Service Bus, a message flow is the implementation of a proxy service. Y ou configure the logic for the
manipulation of messages using proxy service message flow definitions. T his logic includes such activities as transformation,
publishing, and reporting, which are implemented as individual actions within the stages of a pipeline.
P ipelines are one-way processing paths that include no branching. A pipeline is a named sequence of stages containing actions,
representing a non-branching one-way processing path. It is used to specify the message flow for service requests and
responses. A stage is a user-configured processing step. M essages fed into the pipelines are accompanied by a set of message
context variables that contain the message contents. T hey can be accessed or modified by actions in the pipeline stages.
8.5. Pipeline Pairs
P ipeline pairs are request and response pipelines. T he request pipeline definition specifies the actions that O racle Service Bus
performs on request messages to the proxy service before invoking a business service or another proxy service. T he response
pipeline definition specifies the processing that O racle Service Bus performs on responses from the business or proxy service
that the proxy service invokes before returning a response to a client.
Each pipeline consists of a sequence of stages, each stage containing actions. However, a single service-level request pipeline
might optionally branch out into operational pipelines (you can configure one default operational pipeline at most one per
operation). T he determination of the operation is done through user-selected criteria. T he response processing starts with the
relevant operation pipeline which then joins into a single service-level response pipeline.
8.6. Message Flow Components
A message flow is composed of components that define the logic for routing and manipulating messages as they flow through a
proxy service. Nodes are configured to route messages through the message flow, and stages and actions contain rules for
processing and transforming messages.
M ost of the processing logic in a message flow is handled in pipelines. A pipeline is a named sequence of stages representing a
non-branching one-way processing path. P ipelines belong to one of the following categories:
 Request pipelines process the request path of the message flow.
 Response pipelines process the response path of the message flow.
 Error pipelines handle errors for stages and nodes in a message flow as well as errors at the level of the message flow
(service).
T o implement the processing logic of a proxy service, request and response pipelines are paired together in pipeline pair
nodes. T hese pipeline pair nodes can be combined with other nodes into a single-rooted tree structure to control overall flow.
T able 3-1 describes the components available for defining message flows.
Component
Type
Summary
Start node Every message flow begins with a start node. A ll messages enter the message flow through the start node,
and all response messages are returned to the client through the start node. T here is nothing to configure in
a start node.
P ipeline pair
node
A pipeline pair node combines a single request pipeline and a single response pipeline in one top -level
element. A pipeline pair node can have only one direct descendant in the message flow. During request
processing, only the request pipeline is executed when O racle Service Bus processes a pipeline pair node. T he
execution path is reversed when O racle Service Bus processes the response pipeline.
Stage Request pipelines, response pipelines, and error handlers can contain stages, where you configure actions to
manipulate messages passing through the pipeline.
Error handler A n error handler can be attached to any node or stage, to handle potential errors at that location.
Branch node A branch node allows processing to proceed along exactly one of several possible paths. O perational
branching is supported for WSDL -based services, where the branching is based on operations defined in the
WSDL. C onditional branching is supported for conditions define d in an XP ath-based switch table.
Route node A route node performs request/response communication with another service. It represents the boundary
between request and response processing for the proxy service. When the route node dispatches a request
mess age, the request processing is considered complete. When the route node receives a response message,
the response processing begins. T he route node supports conditional routing as well as request and response
transformations.
Because a route node represents the boundary between request and response processing, it cannot have any
descendants in the message flow.
8.7. Building a Message Flow
T he only components required in a message flow are a start node and a route node. No restrictions exist on what
other components can be chained together in the message flow. Y ou could create a single route node that contained all the
logic for the flow. O r, you could link two pipeline pair nodes without a branch node in between. If you use branch nodes, eac h
branch node could start with a different element. O ne branch could terminate with a route node, another could be followed by
a pipeline pair, and yet another could have no descendant. (When a branch with no descendants is executed at run time,
response processing begins immediately.)
However, in general, a message flow is likely to be designed in one of the following ways:
 For non-operational services (services that are not based on WSDLs with operations), the flow consists of a single pipeline pair
at the root followed by a route node.
 For operational services, the flow consists of a single pipeline pair at the root, followed by a branch node based on an
operation, with each branch consisting of a pipeline pair followed by a route node.
8.8. Message Execution
T able below describes how message are processes in a typical message flow:
M essage Flow Node What happens during message processing?
Request P rocessing
Start node Request processing begins at the start node.
P ipeline pair node Executes the request pipeline only.
Branch node Evaluates the branch table and proceeds down the relevant branch.
Route node P erforms the route along with any request transformations.
In the message flow, regardless of whether routing takes place or not, the route node
represents the transition from processing a request to processing a response. A t the route
node, the direction of the message flow is reversed. If a request path does not have a route
node, the response processing is initiated in the reverse direction without waiting for any
response.
Response P rocessing Skips any branch nodes and continues with the node that preceded the branch
Route node Executes any response transformations.
Branch node Skips any branch nodes and continues with the node that prec eded the branch
P ipeline pair node Executes the response pipeline
Start node Sends the response back to the client
8.9. Branching in Message Flows
T wo kinds of branching are supported in message flows: operational branching, configured in an operational branch node,
and conditional branching, configured in a conditional branch node.
8.9.1. Operational Branching
When message flows define WSDL-based proxy services, operation-specific processing is required. When you create an
operational branch node in a message flow, you can build branching logic based on the operations defined in the WSDL.
Y ou must use operational branching when a proxy service is based on a WSDL with multiple operations. Y ou can consider using
an operational branch node to handle messages separately for each operation.
8.9.2. Conditional Branching
U se conditional branching to branch based on a specified condition, for example the document type of a message.
C onditional branching is driven by a lookup table with each branch tagged with simple, unique string values, for example,
Q uantityEqualToOrLessThan150 and Q uantityMoreThan150.
Y ou can configure a conditional branch to branch based on the value of a variable in the message context (declared, for
example, in a stage earlier in the message flow), or you can configure the condition to branch based on the results of an XP a th
expression defined in the branch itself.
A t run time, the variable or the expression is evaluated, and the resulting value is used to determine which branch to follow. If
no branch matches the value, the default branch is followed. A branch node may have several d escendants in the message
flow: one for each branch, including the default branch. Y ou should always define a default branch. Y ou should design the
proxy service in such a way that the value of a lookup variable is set before reaching the branch node.
For example, consider the following case using a lookup variable. A proxy service is of type any SOAP or any XM L, and you
need to determine the type of the message so you can perform conditional branching. Y ou can design a stage action to identify
the message type and then design a conditional branching node later in the flow to separate processing based on the message
type.
Now consider the following case using an XP ath expression in the conditional branch node. Y ou want to branch based on the
quantity in an order. T hat quantity is passed via a variable that can be retrieved from a known location in $body.
Y ou could define the following XP ath expression to retrieve the quantity:
declare namespace openuri=”http://www.openuri.org/&#8221;;
declare namespace com=”oracle.com/demo/orders/cmnCust”;
./openuri:processCust/com:cmnCust/com:Order_Items/com:Item/com:Quantity
T he condition (for example, <500) is then evaluated in order down the message flow against the expres sion. Whichever
condition is satisfied first determines which branch is followed. If no branch condition is satisfied, then the default branc h is
followed.
Y ou can use conditional branching to expose the routing alternatives for the message flow at the top level flow view. For
example, consider a situation where you want to invoke service A or service B based on a condition known early in the
message flow (for example, the message type). Y ou could configure the conditional branching in a routing table in th e route
node. However, that makes the branching somewhat more difficult to follow if you are just looking at the top level of the flo w.
Instead, you could use a conditional branch node to expose this branching in the message flow itself and use simple rout e
nodes as the subflows for each of the branches.
C onsider your business scenario before deciding whether you configure branching in the message flow or in a stage or route
node. When making your decision, remember that configuring branches in the message flow can be awkward in the design
interface if a large number of branches extend from the branch node.
8.10. Configuring Actions in Stages and Route Nodes
A ctions provide instructions for handling messages in pipeline stages, error handler stages, and route nodes. T he context
determines which actions are available in the O racle Service Bus C onsole or in the O racle Service Bus Plug -ins for Workshop for
WebLogic, as described in the following sections:
 C ommunication A ctions
 Flow C ontrol Actions
 M essage P rocessing A ctions
 Reporting A ctions
8.10.1. Communication Actions
C ommunication actions control message flow:
A ction U se A vailable in
Dynamic publish P ublish a message to a service specified
by an XQ uery expression
 P ipeline stage
 Error handler stage
 Route node
P ublish Identify a statically specified target
service for a message and to configure
how the message is packaged and sent
to that service
 P ipeline stage
 Error handler stage
P ublish table P ublish a message to zero or more
statically specified services. Switch-
style condition logic is used to
determine at run time which services
will be used for the publish
 P ipeline stage
 Error handler stage
Routing options M odify any or all of the following
properties in the outbound request:
U RI, Q uality of Service, M ode, Retry
parameters, M essage P riority
 P ipeline stage
Service callout C onfigure a synchronous (blocking)
callout to an O racle Service Bus-
registered proxy or business service.
 P ipeline stage
 Error handler stage
T ransport headers Set the header values in messages  P ipeline stage
 Error handler stage
8.10.2. Flow Control Actions
Flow controls actions implement conditional routing, conditional looping, and error handling. Y ou can also use them to notify
the invoker of success or to skip the rest of the actions in the stage:
Action Use to. Available in
For each Iterate over a sequence of values and
execute a block of actions
 P ipeline stage
Error handler stage
If… then… P erform an action or set of actions
conditionally, based on the Boolean
result of an XQ uery expression
 P ipeline stage
 Route node
Error handler stage
Raise error Raise an exception with a specified
error code (a string) and description
 P ipeline stage
Error handler stage
Reply Specify that an immediate reply be sent
to the invoker.
T he reply action can be used in the
request, response or error pipeline. Y ou
can configure it to result in a reply with
success or failure. In the case of reply
with failure where the inbound transport
is HT TP, the reply action specifies that
an immediate reply is sent to the
invoker
 P ipeline stage
Error handler stage
Resume Resume message flow after an error is
handled by an error handler. T his action
has no parameters and can only be
used in error handlers
 Error handler stage
Skip Specify that at run time, the execution P ipeline stage
of this stage is skipped and the
processing proceeds to the next stage
in the message flow. T his action has no
parameters and can be used in the
request, response or error pipelines
 Error handler stage
8.10.3. Message Processing Actions
T he actions in this category process the message flow. T able 3-5 describes the message processing actions.
A ction U se Location
A ssign A ssign the result of an XQ uery expression to a context variable. P ipeline
stage
Error
handler
stage
Delete Delete a context variable or a set of nodes specified by an XP ath expression. P ipeline
stage
Error
handler
stage
Insert Insert the result of an XQ uery expression at an identified place relative to nodes selected by an
XP ath expression.
P ipeline
stage
Error
handler
stage
Java
callout
Invoke a Java method, or EJB business service, from within the message flow. P ipeline
stage
Error
handler
stage
M FL
transform
C onvert message content from XM L to non-XML, or vice versa, in the message pipeline. A n M FL is
a specialized XML document used to describe the layout of binary data. It is an O racle proprietary
language used to define rules to transform formatted binary data into XML data, or vice versa.
P ipeline
stage
Error
handler
stage
Rename Rename elements selected by an XP ath expression without modifying the contents of the
element.
P ipeline
stage
Error
handler
stage
Replace Replace a node or the contents of a node specified by an XP ath expression. T he node or its
contents are replaced with the value returned by an XQ uery expression.
A replace action can be used to replace simple values, elements and even attributes. A n XQuery
expression that returns nothing is equivalent to deleting the identified nodes or making them
empty, depending upon whether the action is replacing entire nodes or just node contents.
T he replace action is one of a set of U pdate actions.
P ipeline
stage
Error
handler
stage
V alidate V alidate elements selected by an XP ath expression against an XM L schema element or a WSDL
resource. Y ou can validate global elements only; Oracle Service Bus does not support validation
against local elements.
P ipeline
stage
Error
handler
stage
8.10.4. Reporting Actions
Y ou use the actions in this category to log or report errors and generate alerts if required in a message flow within a
stage. T able 3-4 describes the reporting actions.
A ction U se to… A vailable in
A lert Generate alerts based on message context in a pipeline, to send to an alert destination. U nlike SLA
alerts, notifications generated by the alert action are primarily intended for business purposes, or to
report errors, and not for monitoring system health. A lert destination should be configured and
chosen with this in mind.
If pipeline alerting is not enabled for the service or enabled at the domain level, the configured alert
action is bypassed during message processing.
P ipeline
stage
Error
handler
stage
Log C onstruct a message to be logged and to define a s et of attributes with which the message is logged. P ipeline
stage
Error
handler
stage
Report Enable message reporting for a proxy service. P ipeline
stage
Error
handler
stage
8.11. Configuring Transport Headers in Message Flows
T he transport header action is a communication type action, and it is available in pipeline stages and error handler
stages.
8.11.1. Configuring Global Pass Through and Header-Specific Copy Options for Transport Headers
T he following options are available when you configure a transport headers action:
 T he Pass all Headers through Pipeline option specifies that at run time, the transport headers action passes all headers
through from the inbound message to the outbound message or vice versa. Every header in the source set of headers is copied
to the target header set, overwriting any existing values in the target header set.
 T he Copy Header from Inbound Request option and the Copy Header from Outbound Response options specifies that
at run time, the transport headers action copies the specific header with which this option is associated from the inbound
message to the outbound message or vice versa.
U se the options in a way that best suits your scenario. Both options result in the headers in the source header set being copied
to the target header set, overwriting any existing value in the target set. Note that the Pass all Headers through
Pipeline option is executed before the header-specific Copy Header options. In other words, for a given transport headers
action configuration, if you select Pass all Headers through Pipeline, there is no need to select theCopy Header option for
given headers.
However, you can select Pass all Headers through Pipeline to copy all headers, and subsequently configure the action such
that individual headers are deleted by selecting Delete Header for specific headers.
WARNING: Because transport headers are specific to the transport types, it is recommended that the pass -through (or
copy) options only be used to copy headers between services of the same transport type. P assing (or copying)
headers between services of different transport types can result in an error if the header being passed is not
accepted by the target transport. For the same reasons, be careful when you specify a header name using the
Set Header option.
8.11.1.1. Understanding How the Run Time Uses the Transport Headers Settings
A s described above, you can use transport header actions to configure the values of the transport headers for outbound
requests (the messages sent out by a proxy service in route, publish, or service callout actions) and inbound responses (the
response messages a proxy service sends back to clients). In general, the header values can be:
 Specified using an XQ uery expression
 P assed through from the source to the target service
 Deleted while going from the source to the target service
T he transport headers action allows you to set, delete, or pass -through the headers in $inbound or $outbound. If you set or
delete these headers and then log $inbound or $outbound, you can see the effects of your changes. However, when the
message is sent out, the O racle Service Bus binding layer may modify or remove some headers in $inbound or $outbound and
the underlying transport may in turn, ignore some of these headers and use its own values. A n important distinction is that
any modifications done by the binding layer on a header are done directly to $inbound and $outbound, whereas modifications
done by the transport affects only the message’swire format. For example, although you can specify a value for the outbound
C ontent-Length header, the binding layer deletes it from $outbound when sending the message. C onsequently, the
modification is visible in the response path (for example, you can see the modified value if you log $outbound). If you set t he
U ser-Agent header in $outbound, the HT TP transport ignores it and use its own value—however, the value in $outbound is not
changed.
T able 3-7 describes the transport headers that are ignored or overwritten at run time and other limitations that exist for
specific transport headers.
T ransport Description of Limitation… T ransport Headers A ffected By Limitation…
O utbound Request Inbound Response
HT TP O racle Service Bus run time may overwrite these headers in
the binding layer when preparing the message for dispatch. If
these headers are modified, $inbound and $outbound are
updated accordingly.
C ontent-Type C ontent-Type
T he underlying transport may ignore these headers and use
different values when sending the message. A ny changes
done by the transport will not be reflected in $inbound or
$outbound.
A ccept
C ontent-Length
C onnection
Host
U ser-Agent
C ontent-Length
Date
T ransfer-Encoding
JM S C an only be set when the request is with respect to a one-
way service or a request/response service based on
JM SMessageID correlation.
If sending to a request/response service based on
JM SCorrelationID correlation, these headers are overwritten
at run time.
JM SCorrelationID JM SCorrelationID
Should be set to the message time-to-live in milliseconds.
T he resulting value in the message received is the sum of the
time-to-live value specified by the client and the GM T at the
time of the send or publish1.
JM SExpiration JM SExpiration
T he O racle Service Bus run time sets these headers. In other
words, any specifications you make for these headers at
design time are overwritten at run time.
JM SMessageID
JM SRedelivered
JM STimestamp
JM SXDeliveryCount
JM SXUserID
JM S_IBM_PutDate2
JM S_IBM_PutTime 2
JM S_IBM_PutApplType 2
JM S_IBM_Encoding 2
JM S_IBM_Character_Set2
JM SMessageID
JM SRedelivered
JM STimestamp
JM SXDeliveryCount
JM SXUserID
JM S_IBM_PutDate 2
JM S_IBM_PutTime 2
JM S_IBM_PutApplType 2
JM S_IBM_Encoding 2
JM S_IBM_Character_Set 2
Because IBM MQ does not allow certain properties to be set
by a client application, if you set these headers with respect
to an IBM M Q destination, a run-time exception is raised.
JM SXDeliveryCount
JM SXUserID
JM SXAppID
JM SXDeliveryCount
JM SXUserID
JM SXAppID
T hese headers cannot be deleted when the P ass all Headers
through P ipeline option is also specified.
JM SDeliveryMode
JM SExpiration
JM SMessageID
JM SRedelivered
JM STimestamp
JM SXDeliveryCount
 JM SDeliveryMode
 JM SExpiration
 JM SMessageID
 JM SRedelivered
 § JM STimestamp
 § JM SXDeliveryCount
 JM SCorelationID—if the inbound
message has the correlation ID se
example, if the inbound response c
from a registered JMS business se
FT P No limitations. In other words you can set or delete the
header(s)3for File and FT P transports and your specifications
are honored by the O racle Service Bus run time.
File
E-mail T he O racle Service Bus run time sets these headers. In other C ontent-Type C ontent-Type
words, any specifications you make for these headers at
design time are overwritten at run time.
O racle Service Bus does not use these headers for outbound
requests. If you set them dynamically (that is, if you set
them in the $outbound headers section), O racle Service Bus
ignores them.
T hese headers are received in $inbound. Date is the time the
mail was sent by the sender. From is retrieved from incoming
mail headers.
From (Name)
Date
 For example, if you set the JM SExpiration header to 1000, and at the time of the send, GM T is 1,000,000 (as a result of
System.currentTimeMillis()), the resulting value of the JM SExpiration property in the JM S message is 1,000,1000
 Header names with the JM S_IBM prefix are to be used with respect to destinations hosted by an IBM MQ server
 For FT P and file proxies, there is an transport request header ‘fileName’. T he value of this request head er is the name of the
file being polled.
Note T he same limitations around setting certain transport headers and metadata are true when you set the inbound
and outbound context variables, and when you use the O racle Service Bus T est C onsole to test your proxy or
business services.
8.12. Performing Transformations in Message Flows
T ransformation maps describe the mapping between two data types. O racle Service Bus supports data mapping that uses the
XQ uery and the eXtensible Stylesheet Language T ransformation (XSLT) standards. XSLT maps describe XM L-to-XML mappings.
XQ uery maps can describe XML-to-XML, XM L to non-XML, and non-XML to XM L mappings.
T he point in a message flow at which you specify a transformation depends on whet her:
 T he message format relies on target services—that is, the message format must be in a format acceptable by the route
destination. T his applies when the transformation is performed in a route node or in one of the publish actions.
P ublish actions identify a target service for a message and configure how the message is packaged and sent to that service.
O racle Service Bus also provides publish table actions. A publish table action consists of a set of routes wrapped in a switc h-
style condition table. It is a shorthand construct that allows different routes to be selected, based upon the results of a single
XQ uery expression.
 Y ou perform the transformation on the response or request message regardless of the route destination. In this case, you can
configure the transformations in the request or response pipeline stages.
8.13. Transformations and Publish Actions
When transformations are designed in publish actions, the transformations have a local copy of the $outbound variable and
message-related variables ($header, $body, and $attachments). A ny changes you make to an outbound message in a publish
action affect only the published message. In other words, the changes you make in the publish action are rolled back before
the message flow proceeds to any actions that follow the publish action in your message flow.
For example, consider a message flow that deals with a large purchase order, and you have to send the summary of the
purchase order, through e-mail, to the manager. T he summary of the of the purchase order is created in the SOAP body of the
incoming message when you include a publish action in the request pipeline. In the publish action, the purchase order data is
transformed into a summary of the purchase order—for example, all the attachments in $attachments can be deleted because
they are not required in the summary of the purchase order.
8.14. Transformations and Route Nodes
Y ou may need to route messages to one of two destinations, based on a WS -addressing header. In that case, content-based
routing and the second destination require the newer version of the document in the SO AP body. In this situation, you can
configure the route node to conditionally route to one of the two destinations. Y ou can configure a transformation in the rou te
node to transform the document for the second destination.
Y ou can also set the control elements in the outbound context variable ($outbound) to influence the behavior of the system fo r
the outbound message (for example, you can set the Q uality of Service).
See Inbound and O utbound Variables and C onstructing M essages to Dispatch for information about the sub-elements of the
inbound and outbound variables and how the content of messages is constructed using the values of the variables in the
message context.
8.15. Constructing Service Callout Messages
When O racle Service Bus makes a call to a service via a service callout action, the content of the message is constructed using
the values of variables in the message context. T he message content for outbound messages is handled differently depending
upon the type of the target service.
How the message content is created depends on the type of the target service and whether you choose to configure
the SO AP body or the payload (parameters or document), as described in the following topics:
 SO AP Document Style Services
 SO AP RPC Style Services
 XM L Services
 M essaging Services
8.16. SOAP Document Style Services
M essages for SO AP Document Style services (including EJB document and document-wrapped services), can be constructed as
follows:
 T he variable assigned for the request document contains the SOAP body.
 T he variable assigned for the SO AP request header contains the SOAP header.
 T he response must be a single XML document—it is the content of the SO AP body plus the SOAP header (if specified)
T o illustrate how messages are constructed during callouts to SOAP Document Style services, consider a service callout action
configured as follows:
 Reques t Document V ariable: myreq
 Response Document V ariable: myresp
 SO AP Request Header: reqheader
 SO AP Response Header: respheader
A ssume also that at run time, the request document variable, myreq, is bound to the following XM L.
Listing 3-1 Content of Request Variable (myreq)
<sayHello xmlns=”http://www.openuri.org/”&gt;
<intV al>100</intVal>
<string>Hello</string>
</sayHello>
A t run time, the SO AP request header variable, reqheader, is bound to the following SO AP header.
Listing 3-2 Content of SOAP Request Header Variable (reqheader)
<soap:Header xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/
xmlns:wsa=”http://schemas.xmlsoap.org/ws/2003/03/addressing”&gt;
<wsa:A ction>…</wsa:A ction>
<wsa:T o>…</wsa:T o>
<wsa:From>…</wsa:From>
<wsa:ReplyT o>…</wsa:ReplyTo>
<wsa:FaultT o>…</wsa:FaultTo>
</soap:Header>
In this example scenario, the full body of the message sent to the external service i s shown inListing 3-3 (the contents of
the myreq and reqheader variables are shown in bold).
Listing 3-3 Message Sent to the Service as a Result of Service Callout Action
<?xml version=”1.0″ encoding=”U TF-8″?>
<soapenv:Envelope xmlns:soapenv=”http://schemas.xmlsoap.org/soap/envelope/”&gt;
<soap:Header xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/
xmlns:wsa=”http://schemas.xmlsoap.org/ws/2003/03/addressing”&gt ;
<wsa:Action>…</wsa:Action>
<wsa:To>…</wsa:To>
<wsa:From>…</wsa:From>
<wsa:ReplyTo>…</wsa:ReplyTo>
<wsa:FaultTo>…</wsa:FaultTo>
</soap:Header>
<soapenv:Body>
<sayHello xmlns=”http://www.openuri.org/”&gt;
<intVal>100</intVal>
<string>Hello</string>
</sayHello>
</soapenv:Body>
</soapenv:Envelope>
Based on the configuration of the service callout action described above, the response from the service is assigned to
the myresp variable. T he full response from the external service is shown inListing 3-4.
Listing 3-4 Response Message From the Service as a Result of Service Callout Action
<?xml version=”1.0″ encoding=”U TF-8″?>
<env:Envelope xmlns:env=”http://schemas.xmlsoap.org/soap/envelope/&#8221;
xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221;
xmlns:soapenc=”http://schemas.xmlsoap.
org/soap/encoding/” xmlns:xsd=”http://www.w3.org/2001/XMLSchema”&gt;
<env:Header/>
<env:Body env:encodingStyle=”http://schemas.xmlsoap.org/soap/encoding/”&gt;
<m:sayHelloResponse xmlns:m=”http://www.openuri.org/”&gt;
<result xsi:type=”xsd:string”>T his message brought to you by Hello and the number 100
</result>
</m:sayHelloResponse>
</env:Body>
</env:Envelope>
In this scenario, the myresp variable is assigned the value shown in Listing 3-5.
Listing 3-5 Content of Response Variable (myresp) as a Result of Service Callout Action
<m:sayHelloResponse xmlns:m=”http://www.openuri.org/”&gt;
<result ns0:type=”xsd:string” xmlns:ns0=”http://www.w3.org/2001/XMLSchema-instance”&gt;
T his message brought to you by Hello and the number 100
</result>
</m:sayHelloResponse>
8.17. SOAP RPC Style Services
M essages for SO AP RPC Style services (including EJB RPC services) can be constructed as follows:
 Request messages are assembled from message context variables.
o T he SO AP body is built based on the SO AP RPC format (operation wrapper, parameter wrappers, and so on).
o T he SO AP header is the content of the variable specified for the SO AP request header, if one is specified.
o P art as element—the parameter value is the variable content.
o P art as simple type—the parameter value is the string representation of the variable content.
o P art as complex type—the parameter corresponds to renaming the root of the variable content after the parameter name.
Response messages are assembled as follows:
 T he output content is the content of SOAP header, if a SO AP header is specified.
 P art as element—the output content is the child element of the parameter; there is at most one child element.
 P art as simple/complex type—the output content is the parameter itself.
T o illustrate how messages are constructed during callouts to SOAP RPC Style services, look at this example with the followin g
configuration:
 A message context variable input1 is bound to a value 100.
 A message context variable input2 is bound to a string value: Hello.
 A service callout action configured as follows:
o Request Parameter intval: input1
o Request Parameter string: input2
o Response Parameter result: output1
In this scenario, the body of the outbound message to the service is shown in Listing 3-6.
Listing 3-6 Content of Outbound Message
<?xml version=”1.0″ encoding=”U TF-8″?>
<soapenv:Envelope xmlns:soapenv=”http://schemas.xmlsoap.org/soap/envelope/”&gt;
<soapenv:Body>
<sayHello2 xmlns=”http://www.openuri.org/”&gt;
<intV al>100</intVal>
<string >Hello</string>
</sayHello2>
</soapenv:Body>
</soapenv:Envelope>
T he response returned by the service to which the call was made is shown in Listing 3-7.
Listing 3-7 Content of Response Message From the helloWorld Service
<?xml version=”1.0″ encoding=”U TF-8″?>
<env:Envelope xmlns:env=”http://schemas.xmlsoap.org/soap/envelope/&#8221;
xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221;
xmlns:soapenc=”http://schemas.xmlsoap.org/soap/encoding/&#8221;
xmlns:xsd=”http://www.w3.org/2001/XMLSchema”&gt;
<env:Header/>
<env:Body env:encodingStyle=”http://schemas.xmlsoap.org/soap/encoding/”&gt;
<m:sayHello2Response xmlns:m=”http://www.openuri.org/”&gt;
<result xsi:type=”n1:HelloWorldResult” xmlns:n1=”java:”>
<message xsi:type=”xsd:string”>
T his message brought to you by Hello and the number 100
</message>
</result>
</m:sayHello2Response>
</env:Body>
</env:Envelope>
T he message context variable output1 is assigned the value shown in Listing 3-8.
Listing 3-8 Content of Output Variable (output1)
<message ns0:type=”xsd:string” xmlns:ns0=”http://www.w3.org/2001/XMLSchema-intance”&gt;
T his message brought to you by Hello and the number 100</message>
8.18. XML Services
M essages for XM L services can be constructed as follows:
 T he request message is the content of the variable assigned for the request document.
 T he content of the request variable must be a single XML document.
 T he output document is the response message.
T o illustrate how messages are constructed during callouts to XM L services, ta ke for example a service callout action
configured as follows:
 Request Document Variable: myreq
 Response Document Variable: myresp
A ssume also that at run time, the request document variable, myreq, is bound to the following XM L.
Listing 3-9 Content of myreq Variable
<sayHello xmlns=”http://www.openuri.org/”&gt;
<intV al>100</intVal>
<string>Hello</string>
</sayHello>
In this scenario:
 T he outbound message payload is the value of the myreq variable, as s hown in T able 3-9.
 T he response and the value assigned to the message context variable, myresp, is shown inListing 3-10.
Listing 3-10 Content of myresp Variable
<m:sayHelloResponse xmlns:m=”http://www.openuri.org/”&gt;
<result xsi:type=”xsd:string”>T his message brought to you by Hello and the number 100
</result>
</m:sayHelloResponse>
8.19. Messaging Services
In the case of M essaging services:
 T he request message is the content of the request variable. T he content can be simple text, XM L, or binary data represented
by an instance of <binary-content ref=…/> reference XM L.
 Response messages are treated as binary, so the response variable will contain an instance of <binary -content ref= … />
reference XM L, regardless of the actual content received.
For example, if the request message context variable myreq is bound to an XM L document of the following format:
<hello>there</hello>, the outbound message contains exactly this payload. T he response message context variable (myresp)
is bound to a reference element similar to the following:
<binary-content ref=” cid:1850733759955566502-2ca29e5c.1079b180f61.-7fd8″/>
8.20. Handling Errors as the Result of a Service Callout
Y ou can configure error handling at the message flow, pipeline, route node, and stage level. T he types of errors that are
received from an external service as the result of a service callout include transport errors, SOAP faults, responses that do not
conform to an expected response, and so on.
T he fault context variable is set differently for each type of error returned. Y ou can build your business and error handling logic
based on the content of the fault variable. T o learn more about $fault, see Fault V ariable.
8.21. Transport Errors
When a transport error is received from an external service and there is no error response payload returned to O racle Servic e
Bus by the transport provider (for example, in the case that an HT TP 403 error code is returned), the service callout action
throws an exception, which in turn causes the pipeline to raise an error. T he fault variable in a user -configured error handler is
bound to a message formatted similarly to that shown in Listing 3-11.
Listing 3-11 Contents of the Oracle Service Bus fault Variable—Transport Error, no Error Response Payload
<con:fault xmlns:con=”http://www.bea.com/wli/sb/context”&gt;
<con:errorC ode>BEA-380000</con:errorCode>
<con:reason>Not Found</con:reason>
<con:details>
…….
</con:details>
<con:location>
<con:node>P ipelinePairNode1</con:node>
<con:P ipeline>P ipelinePairNode1_request</con:Pipeline>
<con:Stage>Stage1</con:Stage>
</con:location>
</con:fault>
In the case that there is a payload associated with the transport error—for example, when an HT TP 500 error code is received
from the business service and there is XML payload in the response —a message context fault is generated with the custom
error code: BEA -382502.
T he following conditions must be met for a BEA -382502 error response code to be triggered as the result of a response from a
service—when that service uses an HT TP or JM S transport:
 (HT TP) T he response code must be any code other than 200 or 202.
 (JM S) T he response must have a property set to indicate that it is an error response—the transport metadata status code set
to1 indicates an error.
 T he content type must be text/xml.
 If the service is AnySoap or WSDL -based SOAP, then it must have a SO AP envelope. T he body inside the SOAP envelope must
be XM L format; it cannot be text.
 If the service type is AnyXML, or a messaging service of type text returns XML content with a non -successful response code
(any code other than 200 or 202).
If the transport is HTTP, the ErrorResponseDetail element will also conta in the HTTP error code returned with the response.
T he ErrorResponseDetail element in the fault contains error response payload received from the service. Listing 3-12 shows an
example of the ErrorResponseDetail element.
Listing 3-12 Contents of the Oracle Service Bus fault Variable—Transport Error, with Error Response Payload
<ctx:Fault xmlns:ctx=”http://www.bea.com/wli/sb/context”&gt;
<ctx:errorC ode>BEA-382502<ctx:errorCode>
<ctx:reason> Service callout has received an error response from the server</ctx:reason>
<ctx:details>
<alsb:ErrorResponseDetail xmlns:alsb=”http://www.oracle.com/…”&gt;
<alsb:detail> <! [C DATA[
. . .
]]>
</alsb:detail> <alsb:http-response-code>500</alsb:http-response-code>
</alsb:ErrorResponseDetail>
</ctx:details>
<ctx:location>. . .</ctx:location>
</ctx:Fault>
Note: T he XM L schema for the service callout-generated fault is shown in XM L Schema for the Service C allout-Generated
Fault Details.
8.22. SOAP Faults
In case an external service returns a SOAP fault, the O racle Service Bus run time sets up the context variable $fault with a
custom error code and description with the details of the fault. T o do so, the contents of the 3 elements under the <SOAP-
ENV:Fault> element in the SO AP fault are extracted and used to construct an O racle Service Bus fault element.
T ake for example a scenario in which a service returns the following error.
Listing 3-13 SOAP Fault Returned From Service Callout
<SO AP-ENV:Envelope xmlns:SOAP-ENV=”http://schemas.xmlsoap.org/soap/envelope/”&gt;
<SO AP-ENV:Body>
<SO AP-ENV:Fault>
<faultcode>SOAP-ENV:Client</faultcode>
<faultstring>Application Error</faultstring>
<detail>
<message>That’s an Error!</message>
<errorcode>1006</errorcode>
</detail>
</SO A P-ENV:Fault>
</SO A P-ENV:Body>
</SO A P-ENV:Envelope>
T he <faultcode>, <faultstring>, and <detail> elements are extracted and wrapped in
an<alsb:ReceivedFault> element. Note that the faultcode element in Listing 3-15 contains a Q Name—any
related namespace declarations are preserved. If the transport is HTTP, the ReceivedFault element will also contain the
HT TP error code returned with the fault response.
T he generated <alsb:ReceivedFault> element, along with the custom error code and the error string are used to
construct the contents of the fault context variable, which in this example takes a format similar to that shown in Listing 3-
14.
Listing 3-14 Contents of the Oracle Service Bus Fault Variable—SOAP Fault
<ctx:Fault xmlns:ctx="http://www.bea.com/wli/sb/context">
<ctx:errorCode>BEA-382500<ctx:errorCode>
<ctx:reason> service callout received a soap Fault
response</ctx:reason>
<ctx:details>
<alsb:ReceivedFault xmlns:alsb="http://www.oracle.com/...">
<alsb:faultcode
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">SOAP-ENV:Clien
</alsb:faultcode>
<alsb:faultstring>Application Error</alsb:faultstring>
<alsb:detail>
<message>That’s an Error! </message>
<errorcode>1006</errorcode>
</alsb:detail>
<alsb:http-response-code>500</alsb:http-response-code>
</alsb:ReceivedFault>
</ctx:details>
<ctx:location> </ctx:location>
</ctx:Fault>
Note: T he unique error code BEA-382500 is reserved for the case when service callout actions receive SOAP fault
responses.
8.23. Unexpected Responses
When a service returns a response message that is not what the proxy service run time expects, a message context fault will
be generated and initialized with the custom error code BEA -382501. T he details of the fault include the contents of the SO AP-
Body element of the response. If the transport is HTTP, the ReceivedFault element will also contain the HTTP error code
returned with the fault response.
T he XM L schema definition of the service callout-generated fault details is shown in Listing 3-15.
Listing 3-15 XML Schema for the Service C allout-Generated Fault Details
<xs:complexType name=”ReceivedFaultDetail”>
<xs:sequence>
<xs:element name=”faultcode” type=”xs:QName”/>
<xs:element name=”faultstring” type=”xs:string”/>
<xs:element name=”detail” minO ccurs=”0″ >
<xs:complexType>
<xs:sequence>
<xs:any namespace=”##any” minO ccurs=”0″ maxOccurs=”unbounded” processContents=”lax” />
</xs:sequence>
<xs:anyAttribute namespace=”##any” processContents=”lax” />
</xs:complexType>
</xs:element>
<xs:element name=”http-response-code” type=”xs:int” minOccurs=”0″/>
type=”xs:int” minO ccurs=”0″/>
</xs:sequence>
</xs:complexType>
<xs:complexType name=”U nrecognizedResponseDetail”>
<xs:sequence>
<xs:element name=”detail” minOccurs=”0″ type=”xs:string” />
</xs:sequence>
</xs:complexType>
<xs:complexType name=”ErrorResponseDetail”>
<xs:sequence>
<xs:element name=”detail” minOccurs=”0″ type=”xs:string” />
</xs:sequence>
</xs:complexType>
8.24. Handling Errors in Message Flows
T he process described in the next paragraph constitutes an error handling pipeline for the stage of an error handler. In
addition, an error pipeline can be defined for a pipeline (request or response) or for an entire proxy service.
T he error handler at the stage level is invoked for handling an error; If the stage -level error handler is not able to handle a
given type of error, the pipeline error handler is invoked. If the pipeline -level error handler also fails to handle the error, the
service-level error handler is invoked. If the service-level error handler also fails, the error is handled by
the system.The following table summarizes the scope of the error handlers at various levels in the message flow.
Level Scope
Stage Handles all the errors within a stage.
P ipeline Handles all the errors in a pipeline, along with any unhandled errors from any stage in a pipeline.
Service Handles all the errors in a proxy service, along with any unhandled errors in any pipeline in a service.
Note: All WS-Security errors are handled at this level.
System Handles all the errors that are not handled any where else in a pipeline.
Note: T here are exceptions to the scope of error handlers. For example, an exception thrown by a non -XM L transformation
at the stage level is only caught by the service-level error handler. Suppose a transformation occurs that transforms
XM L to M FL for an outgoing proxy service response message, it always occurs in the binding layer. T herefore, for
example, if a non-XM L output is missing a mandatory field at the stage level, only a service -level error handler can
catch this error.
For more information on error messages and error handling, see P roxy Services: Error Handlers inUsing the Oracle Service Bus
Console.
Y ou can handle errors by configuring a test that checks if an assertion is true and use the reply action configured false. Y ou can
repeat this test at various levels. A lso you can have an error without an error handler at a lower level and handle it throug h an
error handler at an higher level in message flow.
In general, it is easier to handle specific errors at a stage level of the message flow and use error handlers at the higher level
for more general default processing of errors that are not handled at the lower levels. It is good practice to explicitly handle
anticipated errors in the pipelines and allow the service-level handler to handle unanticipated errors.
Note: Y ou can only handle WS-Security related errors at the service level.
8.25. Generating the Error Message, Reporting, and Replying
A predefined context variable (the fault variable) is used to hold information about any error that occurs during message
processing. When an error occurs, this variable is populated with information be fore the appropriate error handler is invoked.
T he fault variable is defined only in error handler pipelines and is not set in request and response pipelines, or in route o r
branch nodes. For additional information about $fault, see P redefined C ontext V ariables .
In the event of errors for request/response type inbound messages, it is often necessary to send a message back to the
originator outlining the reason why an error occurred. Y ou can accomplish this by using a Reply with Failure action after
configuring the message context variables with the response you want to send. For example, when an HT TP message
fails, Reply with Failuregenerates the HTTP 500 status. When a JM S message fails, Reply with Failure sets the JM S_BEA_Error
property to true. T he O racle Service Bus error actions are discussed in P roxy Services: Error Handlers in Using the Oracle
Service Bus Console.
A n error handling pipeline is invoked if a service invoked by a proxy service returns a SOAP fault or transport error. A ny
received SOAP fault is stored in $body, so if a Reply with Failure is executed without modifying $body, the original SOAP fault
is returned to the client that invoked the service. If a reply action is not configured, the system error handler generates a new
SO AP fault message. T he proxy service recognizes that a SOAP fault is returned because a HT TP error status is set, or the JM S
property SERVER_Error is set to true.
Some use cases require error reporting. Y ou can use the report action in these situations. For example, consider a scenario i n
which the request pipeline reports a message for tracking purposes, but the service invoked by the route node fails after the
reporting action. In this case, the reporting system logged the message, but there is no guarantee that the message was
processed successfully, only that the message was successfully received.
Y ou can use the O racle Service Bus Console to track the message to obtain an accurate picture of the message flow. T his
allows you to view the original reported message indicating the message was submitted for processing, and also the
subsequent reported error indicating that the message was not processed correctly. T o learn how to configure a report action
and use the data reported at run time, see P roxy Services: A ctions in Using the Oracle Service Bus Console.
8.26. Example of Action Configuration in Error Handlers
T his example shows how you can configure the report and reply actions in error handlers. T he message flow shown in Figure 3-
2 includes an error handler on the validate loan application stage. T he error handler in this case is a simple message flow with
a single stage configured—it is represented in the O racle Service Bus C onsole as shown in Figure 3-2.
Figure 3-2 Error Handler M essage Flow
T he stage is, in turn, configured with actions (replace, report, and reply) as shown in Figure 3-3.
Figure 3-3 Actions in Stage Error Handler
T he actions control the behavior of the stage in the pipeline error handler as follows:
 Replace—T he contents of a specified element of the body variable are replaced with the contents of the fault context
variable. T he body variable element is specified by an XP ath expression. T he contents are replaced with the value returned by
an XQ uery expression—in this case $fault/ctx:reason/text()
 Report— M essages from the reporting action are written to the O racle Service Bus Reporting Data Stream if the error handler
configured with this action is invoked. T he JMS Reporting Provider reports the messages on the O racle Service Bus Dashboard.
O racle Service Bus provides the capability to deliver message data to one or more reporting providers. M essage data is
captured from the body of the message and from any other variables associated with the message, such as header or inbound
variables. Y ou can use the message delivered to the reporting provider for functions such as tracking messages or regulatory
auditing.
 When an error occurs, the contents of the fault context variable are reported. T he key name is errorCode, an d the key value is
extracted from the fault variable using the following XP ath expression: ./ctx:errorCode. Key/value pairs are the key identifi ers
that identify these messages in the Dashboard at run time.
 T o configure a report action and use the data reported at run time, see P roxy Services: A ctions in Using the Oracle Service Bus
Console.
 Reply— A t run time, an immediate reply is sent to the invoker of the loanGateway3 proxy service (see Figure 3-3) indicating
that the message had a fault T he reply is With Failure.
 For configuration information, see P roxy Services: Error Handlers in Using the Oracle Service Bus Console.
 When you do not know the service you need to invoke from the proxy service you are creating, you can use dynamic routing.
 For any given proxy service, you can use one of the following techniques to dynamically route messages:
 In a message flow pipeline, design an XQuery expression to dynamically set the fully qualified service name in O racle Service
Bus and use the dynamic route or dynamic publish actions.
 Note:
 Dynamic Routing can be achieved in a route node, whereas dynamic publishing can achieved in a stage i n a request pipeline or
a response pipeline.
 With this technique, the proxy service dynamically uses the service account of the endpoint business service to send user
names and passwords in its outbound requests. For example, if a proxy service is routing a request to Business Service A , then
the proxy service uses the service account from Business Service A to send user names and passwords in its outbound request.
See Implementing Dynamic Routing.
 C onfigure a proxy service to route or publish messages to a business service. T hen, in the request actions section for the ro ute
action or publish action, add a Routing O ptions action that dynamically specifies the U RI of a service.
 With this technique, to send user names and passwords in its outbound requests, the proxy service uses the service account of
the statically defined business service, regardless of the U RI to which the request is actually sent.
 For information on how to use this technique, see Implementing Dynamic Routing.
 Note:
 T his technique is used when the overview of the interface is fixed. T he overview of the interface includes message types, port
types, and binding, and excludes the concrete interface. T he concrete interface is the transport U RL at which the service is
located.
 Implementing Dynamic Routing
 Y ou can use dynamic routing to determine the destination during the runtime of a proxy service. T o achieve this you can use a
routing table in an XM L file to create an XQ uery resource.
 Note:
 Instead of using the XQuery resource, you can also directly use the XM L file from which the resource is created.
 A n XM L file or the Xquery resource can be maintained easily. A t runtime you provide the entry in the routing table that will
determine the routing or publishing destination of the proxy service.T he XM L file or the XQ uery resource contains a routing
table, which maps a logical identifier to (such as the name of a company) to the physical identifier (the fully qualified nam e of
the service in O racle Service Bus). T he logical identifier, which is extracted from the message, maps on to the physical
identifier, which is the name of the service you want to invoke.
 Note:
 T o use the dynamic route action, you need the fully qualified name of the service in O racle Service Bus.
 In a pipeline the logical identifier is obtained with an XP ath into the message.You assign the XM L table in the XQ uery resource
to a variable. Y ou implement a query against the variable in the routing table to extract the physical identifier based on th e
corresponding logical identifier. U sing this variable you will be able to invoke the required service. T he following sections
describe how to implement dynamic routing.
 Sample XM L File.
 C reating an XQuery Resource From the Sample XML
 C reating and C onfiguring the P roxy Service to Implement Dynamic Routing
8.27. Using Dynamic Routing
8.28. Sample XML File
Y ou can create an XQuery resource from the following XM L file. Save this as sampleXquery.xml.
Listing 3-16 Sample XML File
<routing>
<row>
<logical>Sample</logical>
<physical>default/goldservice</physical>
</row>
<row>
<logical>ABC Corp</logical>
<physical>default/silverservice</physical>
</row>
</routing>
8.29. Creating an XQuery Resource From the Sample XML
 In an active session, select P roject Explorer from the left navigation panel. T he P roject V iew page is displayed.
 Select the project to which you want to add the XQ uery resource.
 In the P roject V iew page, select the XQuery resource from the Select Resource Type drop-down list. T he C reate XQuery page is
displayed.
 In the Resource Name field, enter the name of the resource. T his is a mandatory.
 In the Resource Description field, provide the a description for the resource. T his is optional.
 In the XQ uery field, provide the path to the XM L you are using as an XQ uery resource. C lick on Browse to locate the file.
O ptionally, you can copy and paste the XML in the XQ uery field. T his is mandatory.
 Save the XQ uery resource.
 A ctivate the session.
 In an active session, select P roject Explorer from the left navigation panel. T he P roject V iew page is displayed.
 Select the project to which you want to add the proxy service.
 In the P roject V iew page, select the P roxy Service resource from the Select Resource T ype drop-down list. T he General
C onfiguration page is displayed.
 In the Service Name field of the General C onfiguration page, enter the name of the proxy service. T his is mandatory.
 Select the type of service by clicking on the button adjacent to various types of services available under Service T ype. For
more information on selecting the service type, see P roxy Services: A ctions.
 C lick Finish. O n the Summary page, click Save to save the proxy service.
 O n the P roject View page, click the Edit M essage Flow icon against the newly created proxy service in the Resource table. T he
Edit M essage Flow page is displayed.
 C lick on the message flow to add a pipeline pair to the message flow.
 C lick on Request P ipeline icon select A dd Stage from the menu.
 C lick on the Stage1 icon to and select Edit Stage from the menu. T he Edit Stage C onfiguration page appears.
 C lick A dd Action icon. C hoose A dd an A ction item from the menu.
 C hoose the A ssign action from M essage P rocessing.
 C lick on Expression. T he XQuery Expression Editor is displayed.
 C lick on XQ uery Resources. T he browser displays the page where you can import the XQ uery resource. C lick on the Browse to
locate the XQuery resource.
 C lick on V alidate to validate the imported XQuery resource.
 Save the imported XQ uery resource on successful validation.
 O n the Edit Stage C onfiguration page, enter the name of the variabl e in the field.
 T his assigns the XQuery resource to this variable. T he variable now contains the externalized routing table.
 C lick on the A ssign action icon to add another assign action.
 Note:
 T o do this repeat step 11 to step 13 .
 Enter the following Xquery:
 <ctx: route>
<ctx: service isProxy=’false’> {$routingtable/row[logical/text()=$logicalidentifier]/physical/text()}
</ctx: service>
</ctx: route>
 In the above code, replace $logicalidentifier by the actual XPath to extract the logical identifier from the mes sage (example
from $body).
 C lick on V alidate to validate the Xquery.
 Save the Xquery on successful validation.
 O n the Edit Stage C onfiguration page, enter the name of the variable (for example, routeresult) in the field.
 T his extracts the XM L used by the dynamic route action into this variable.
 C lick on the message flow to add a route node to the end of the message flow.
 C lick on the Route Node icon and select Edit from the menu.
 C lick the A dd Action icon. C hoose Add an A ction item from the menu.
 C hoose the Dynamic Route action.
 C lick on Expression. T he XQuery Expression Editor is displayed.
 Enter the variable from step 22 (for example, $routeresult)

 O racle Service Bus provides read-access to databases from proxy services without requiring you to write a custom EJB or
custom Java code and without the need for a separate database product like Oraclce Data Service Integrator. Y ou can use the
execute-sql() function to make a simple JDBC call to a database to perform simple database reads. A ny SQL query is legal,
from a query that gets a single tax rate for the supplied location to a query that does a complex join to obtain an order’s
current status from several underlying database tables.
 A database query can be used to get data for message enrichment, for routing decisions, or for customizing the behavior of a
proxy service. T ake for example a scenario in which an O racle Service Bus proxy service receives “request for quote”
messages. T he proxy service can route the requests based on the customer’s priority to one of a number of quotation business
services (say, standard, gold, or platinum level services). T he proxy service can then perform a SQ L-based augmentation of
the results that those services return—for example, based on the selected ship method and the weight of the order, the
shipping cost can be looked up and that cost added to the request for quote message.
 fn-bea:execute-sql() describes the syntax for the function and provides examples of its use. T he execute -sql() function returns
typed data and automatically translates values between SQL/JDBC and XQ uery data models.
 Y ou can store the returned element in a user-defined variable in an O racle Service Bus message flow.
 T he following databases and JDBC drivers are supported using the execute-sql() function:
 IBM DB2/NT 8
 M icrosoft SQL Server 2000, 2005
 O racle 8.1.x
 O racle 9.x, 10.x
 P ointbase 4.4, 5.x
 Sybase 12.5.2 and 12.5.3
 WebLogic T ype 4 JDBC drivers
 T hird-party drivers supported by WebLogic Server
 U se non-XA drivers for datasources you use with the fn-bea:execute-sql() function—the function supports read-only access to
the datasources.
 WARNING:
 In addition to specifying a non-XA JDBC driver class to use to connect to the database, you must ensure that you disable global
transactions and two-phase commit. (Global transactions are enabled by default in the WebLogic Server console for JDBC data
sources.) T hese specifications can be made for your data source via the WebLogic Server A dministration C onsole. See C reate
JDBC Data Sources in the WebLogic Server Administration Console Online Help.
 For complete information about database and JDBC drivers support in O racle Service Bus, see Supported Database
C onfigurations in Supported Configurations for Oracle Service Bus .
 Databases other than the core set described in the preceding listing are also supported. However, for the core databases list ed
above, the XQ uery engine does a better recognition and mapping of data types to XQ uery types than it does for the non-core
databases—in some cases, a core database’s proprietary JDBC extensions are used when fetching data. For the non -core
databases, the XQ uery engine relies totally on the standard type codes provided by the JDBC driver and standard JDBC
resultset access methods.
 When designing your proxy service, you can enter XQ ueries inline as part of an action definition instead of entering them as
resources. Y ou can also use inline XQueries for conditions in If…T hen… actions in message flows. For information about using
the inline XQ uery editor, seeCreating Variable Structure M appings.
 T he message context is a set of variables that hold message context and information about messages as they are routed
through the O racle Service Bus. T ogether, the header, body, and attachments variables, (referenced as $header, $body and
$attachments in XQuery statements) represent the message as it flows through O racle Service Bus. T he canonical form of the
message is SOAP. Even if the service type is not SOAP, the message appears as SOAP in the O racle Service Bus message
context.
 In a M essage C ontext, $header contains a SOAP header element and $body contains a SOAP Body element. T he Header and
Body elements are qualified by the SOAP 1.1 or SOAP 1.2 namespace depending on the service type of the proxy service. A lso
Understanding the basic need of Service Oriented Architecture and getting started with Oracle Service Bus
Understanding the basic need of Service Oriented Architecture and getting started with Oracle Service Bus
Understanding the basic need of Service Oriented Architecture and getting started with Oracle Service Bus
Understanding the basic need of Service Oriented Architecture and getting started with Oracle Service Bus
Understanding the basic need of Service Oriented Architecture and getting started with Oracle Service Bus
Understanding the basic need of Service Oriented Architecture and getting started with Oracle Service Bus
Understanding the basic need of Service Oriented Architecture and getting started with Oracle Service Bus
Understanding the basic need of Service Oriented Architecture and getting started with Oracle Service Bus
Understanding the basic need of Service Oriented Architecture and getting started with Oracle Service Bus
Understanding the basic need of Service Oriented Architecture and getting started with Oracle Service Bus
Understanding the basic need of Service Oriented Architecture and getting started with Oracle Service Bus
Understanding the basic need of Service Oriented Architecture and getting started with Oracle Service Bus
Understanding the basic need of Service Oriented Architecture and getting started with Oracle Service Bus

More Related Content

What's hot

Webgen Technologies Pvt. Ltd.
Webgen Technologies Pvt. Ltd.Webgen Technologies Pvt. Ltd.
Webgen Technologies Pvt. Ltd.
Sagar Sarkar
 
Apq Qms Project Plan
Apq Qms Project PlanApq Qms Project Plan
Apq Qms Project Plan
Eng-Mohammad
 
Overview of different types of erp systems, architecture, and modules
Overview of different types of erp systems, architecture, and modulesOverview of different types of erp systems, architecture, and modules
Overview of different types of erp systems, architecture, and modules
Deepa Manoj
 
Assess Your SharePoint Maturity With The SharePoint Maturity Model - as prese...
Assess Your SharePoint Maturity With The SharePoint Maturity Model - as prese...Assess Your SharePoint Maturity With The SharePoint Maturity Model - as prese...
Assess Your SharePoint Maturity With The SharePoint Maturity Model - as prese...Sadalit Van Buren
 
SOA for Enterprise Architecture
SOA for Enterprise ArchitectureSOA for Enterprise Architecture
SOA for Enterprise Architecture
Yan Zhao
 
Performance and scale in cloud
Performance and scale in cloudPerformance and scale in cloud
Performance and scale in cloudjeffgaris
 
15 falko menge--_enterpise_service_bus
15 falko menge--_enterpise_service_bus15 falko menge--_enterpise_service_bus
15 falko menge--_enterpise_service_bus
lmphuong06
 
SOA Service-oriented Architecture Fundamentals IBM Certification
SOA Service-oriented Architecture Fundamentals IBM CertificationSOA Service-oriented Architecture Fundamentals IBM Certification
SOA Service-oriented Architecture Fundamentals IBM Certification
Jaguaraci Silva
 
Performance And Scale In Cloud Computing
Performance And Scale In Cloud ComputingPerformance And Scale In Cloud Computing
Performance And Scale In Cloud Computingdmasciorini
 
Performance And Scale In Cloud Computing 1
Performance And Scale In Cloud Computing 1Performance And Scale In Cloud Computing 1
Performance And Scale In Cloud Computing 1Scott Herson
 
Sample Project Requirements Document – Library Blog
Sample Project Requirements Document – Library BlogSample Project Requirements Document – Library Blog
Sample Project Requirements Document – Library BlogALATechSource
 
Introduction to integration
Introduction to integrationIntroduction to integration
Introduction to integration
Mindmajix Technologies
 
Integration intervention: Get your apps and data up to speed
Integration intervention: Get your apps and data up to speedIntegration intervention: Get your apps and data up to speed
Integration intervention: Get your apps and data up to speed
Kenneth Peeples
 
Vishal_Agarwal_webMethods_CV_2016
Vishal_Agarwal_webMethods_CV_2016Vishal_Agarwal_webMethods_CV_2016
Vishal_Agarwal_webMethods_CV_2016vishal agarwal
 
Web developnment
Web developnment Web developnment
Web developnment
AshutoshSharma734
 

What's hot (20)

Webgen Technologies Pvt. Ltd.
Webgen Technologies Pvt. Ltd.Webgen Technologies Pvt. Ltd.
Webgen Technologies Pvt. Ltd.
 
Apq Qms Project Plan
Apq Qms Project PlanApq Qms Project Plan
Apq Qms Project Plan
 
Overview of different types of erp systems, architecture, and modules
Overview of different types of erp systems, architecture, and modulesOverview of different types of erp systems, architecture, and modules
Overview of different types of erp systems, architecture, and modules
 
diwakar_singh (1)
diwakar_singh (1)diwakar_singh (1)
diwakar_singh (1)
 
General Proposal
General ProposalGeneral Proposal
General Proposal
 
Assess Your SharePoint Maturity With The SharePoint Maturity Model - as prese...
Assess Your SharePoint Maturity With The SharePoint Maturity Model - as prese...Assess Your SharePoint Maturity With The SharePoint Maturity Model - as prese...
Assess Your SharePoint Maturity With The SharePoint Maturity Model - as prese...
 
PraveenResume_TIBCO
PraveenResume_TIBCOPraveenResume_TIBCO
PraveenResume_TIBCO
 
SOA for Enterprise Architecture
SOA for Enterprise ArchitectureSOA for Enterprise Architecture
SOA for Enterprise Architecture
 
Performance and scale in cloud
Performance and scale in cloudPerformance and scale in cloud
Performance and scale in cloud
 
15 falko menge--_enterpise_service_bus
15 falko menge--_enterpise_service_bus15 falko menge--_enterpise_service_bus
15 falko menge--_enterpise_service_bus
 
SOA Service-oriented Architecture Fundamentals IBM Certification
SOA Service-oriented Architecture Fundamentals IBM CertificationSOA Service-oriented Architecture Fundamentals IBM Certification
SOA Service-oriented Architecture Fundamentals IBM Certification
 
Performance And Scale In Cloud Computing
Performance And Scale In Cloud ComputingPerformance And Scale In Cloud Computing
Performance And Scale In Cloud Computing
 
Performance And Scale In Cloud Computing 1
Performance And Scale In Cloud Computing 1Performance And Scale In Cloud Computing 1
Performance And Scale In Cloud Computing 1
 
Resume
ResumeResume
Resume
 
Sample Project Requirements Document – Library Blog
Sample Project Requirements Document – Library BlogSample Project Requirements Document – Library Blog
Sample Project Requirements Document – Library Blog
 
Introduction to integration
Introduction to integrationIntroduction to integration
Introduction to integration
 
PROPOSAL_FINAL
PROPOSAL_FINALPROPOSAL_FINAL
PROPOSAL_FINAL
 
Integration intervention: Get your apps and data up to speed
Integration intervention: Get your apps and data up to speedIntegration intervention: Get your apps and data up to speed
Integration intervention: Get your apps and data up to speed
 
Vishal_Agarwal_webMethods_CV_2016
Vishal_Agarwal_webMethods_CV_2016Vishal_Agarwal_webMethods_CV_2016
Vishal_Agarwal_webMethods_CV_2016
 
Web developnment
Web developnment Web developnment
Web developnment
 

Similar to Understanding the basic need of Service Oriented Architecture and getting started with Oracle Service Bus

whitepaper_workday_technology_platform_devt_process
whitepaper_workday_technology_platform_devt_processwhitepaper_workday_technology_platform_devt_process
whitepaper_workday_technology_platform_devt_processEric Saraceno
 
Enterprise Application integration (middleware) concepts
Enterprise Application integration (middleware) conceptsEnterprise Application integration (middleware) concepts
Enterprise Application integration (middleware) concepts
Shantanu Thakre
 
A research on- Sales force Project- documentation
A research on- Sales force Project- documentationA research on- Sales force Project- documentation
A research on- Sales force Project- documentation
Pasupathi Ganesan
 
Service oriented cloud computing
Service oriented cloud computingService oriented cloud computing
Service oriented cloud computing
Mandar Pathrikar
 
No SOA ROI - SOA is Dead? Getting SOA Value
No SOA ROI - SOA is Dead? Getting SOA ValueNo SOA ROI - SOA is Dead? Getting SOA Value
No SOA ROI - SOA is Dead? Getting SOA Value
Akiva Marks
 
Outsourcing SOA Implementation | Torry Harris Whitepaper
Outsourcing SOA Implementation | Torry Harris WhitepaperOutsourcing SOA Implementation | Torry Harris Whitepaper
Outsourcing SOA Implementation | Torry Harris Whitepaper
Torry Harris Business Solutions
 
What changes does the IT organization bring to cloud innovation?
What changes does the IT organization bring to cloud innovation?What changes does the IT organization bring to cloud innovation?
What changes does the IT organization bring to cloud innovation?
TD Web Services
 
Asymetric Modernization
Asymetric ModernizationAsymetric Modernization
Asymetric Modernization
Peter Presnell
 
Ibm bluemix—from idea to application by karim abousedera
Ibm bluemix—from idea to application by karim abousederaIbm bluemix—from idea to application by karim abousedera
Ibm bluemix—from idea to application by karim abousederaBill Duncan
 
Top 8 Trends in Performance Engineering
Top 8 Trends in Performance EngineeringTop 8 Trends in Performance Engineering
Top 8 Trends in Performance Engineering
Convetit
 
235429094 jobportal-documentation
235429094 jobportal-documentation235429094 jobportal-documentation
235429094 jobportal-documentation
sireesha nimmagadda
 
Project report
Project report Project report
Project report
Vikram Singh
 
From Components To Services
From Components To ServicesFrom Components To Services
From Components To Services
James Phillips
 
fusion-apps-new-standard-bus-wp-505097
fusion-apps-new-standard-bus-wp-505097fusion-apps-new-standard-bus-wp-505097
fusion-apps-new-standard-bus-wp-505097Carina Kordan
 
Can low-code overturn this wisdom?
Can low-code overturn this wisdom?Can low-code overturn this wisdom?
Can low-code overturn this wisdom?
LCDF
 
Web Application Architecture: A Comprehensive Guide for Success in 2023
Web Application Architecture: A Comprehensive Guide for Success in 2023Web Application Architecture: A Comprehensive Guide for Success in 2023
Web Application Architecture: A Comprehensive Guide for Success in 2023
stevefary
 
Software application architecture
Software application architectureSoftware application architecture
Software application architecture
anwitat
 
Project List for Students
Project List for StudentsProject List for Students
Project List for Students
Jessica Piikkila
 
A Comprehensive Guide to Web Application Architecture
A Comprehensive Guide to Web Application ArchitectureA Comprehensive Guide to Web Application Architecture
A Comprehensive Guide to Web Application Architecture
stevefary
 
Bank Management System Desktop Application
Bank Management System Desktop Application Bank Management System Desktop Application
Bank Management System Desktop Application
Ibadullah Khan
 

Similar to Understanding the basic need of Service Oriented Architecture and getting started with Oracle Service Bus (20)

whitepaper_workday_technology_platform_devt_process
whitepaper_workday_technology_platform_devt_processwhitepaper_workday_technology_platform_devt_process
whitepaper_workday_technology_platform_devt_process
 
Enterprise Application integration (middleware) concepts
Enterprise Application integration (middleware) conceptsEnterprise Application integration (middleware) concepts
Enterprise Application integration (middleware) concepts
 
A research on- Sales force Project- documentation
A research on- Sales force Project- documentationA research on- Sales force Project- documentation
A research on- Sales force Project- documentation
 
Service oriented cloud computing
Service oriented cloud computingService oriented cloud computing
Service oriented cloud computing
 
No SOA ROI - SOA is Dead? Getting SOA Value
No SOA ROI - SOA is Dead? Getting SOA ValueNo SOA ROI - SOA is Dead? Getting SOA Value
No SOA ROI - SOA is Dead? Getting SOA Value
 
Outsourcing SOA Implementation | Torry Harris Whitepaper
Outsourcing SOA Implementation | Torry Harris WhitepaperOutsourcing SOA Implementation | Torry Harris Whitepaper
Outsourcing SOA Implementation | Torry Harris Whitepaper
 
What changes does the IT organization bring to cloud innovation?
What changes does the IT organization bring to cloud innovation?What changes does the IT organization bring to cloud innovation?
What changes does the IT organization bring to cloud innovation?
 
Asymetric Modernization
Asymetric ModernizationAsymetric Modernization
Asymetric Modernization
 
Ibm bluemix—from idea to application by karim abousedera
Ibm bluemix—from idea to application by karim abousederaIbm bluemix—from idea to application by karim abousedera
Ibm bluemix—from idea to application by karim abousedera
 
Top 8 Trends in Performance Engineering
Top 8 Trends in Performance EngineeringTop 8 Trends in Performance Engineering
Top 8 Trends in Performance Engineering
 
235429094 jobportal-documentation
235429094 jobportal-documentation235429094 jobportal-documentation
235429094 jobportal-documentation
 
Project report
Project report Project report
Project report
 
From Components To Services
From Components To ServicesFrom Components To Services
From Components To Services
 
fusion-apps-new-standard-bus-wp-505097
fusion-apps-new-standard-bus-wp-505097fusion-apps-new-standard-bus-wp-505097
fusion-apps-new-standard-bus-wp-505097
 
Can low-code overturn this wisdom?
Can low-code overturn this wisdom?Can low-code overturn this wisdom?
Can low-code overturn this wisdom?
 
Web Application Architecture: A Comprehensive Guide for Success in 2023
Web Application Architecture: A Comprehensive Guide for Success in 2023Web Application Architecture: A Comprehensive Guide for Success in 2023
Web Application Architecture: A Comprehensive Guide for Success in 2023
 
Software application architecture
Software application architectureSoftware application architecture
Software application architecture
 
Project List for Students
Project List for StudentsProject List for Students
Project List for Students
 
A Comprehensive Guide to Web Application Architecture
A Comprehensive Guide to Web Application ArchitectureA Comprehensive Guide to Web Application Architecture
A Comprehensive Guide to Web Application Architecture
 
Bank Management System Desktop Application
Bank Management System Desktop Application Bank Management System Desktop Application
Bank Management System Desktop Application
 

Recently uploaded

Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
Peter Spielvogel
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
ThomasParaiso2
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 

Recently uploaded (20)

Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 

Understanding the basic need of Service Oriented Architecture and getting started with Oracle Service Bus

  • 1. 1. SERVICEORIENTED ARCHITECTURE What is SOA? Service Oriented Architecture. T his could be the basic definition of SO A. But why is the name SO A? SO A is an architectural approach for building business process with integration of loosely coupled applications/software (Service Orientation). M ost of you might be thinking what the hell does that mean? SO A originated with the concept of Service orientation. Service orientation is listening and understanding the customer (customer can be working on different platforms but they want to access application build on a different environment). T hat seems to be easy with words but I still did not get what does SOA means. Let us start with basic understanding of evolution of SO A. C onsider a so called problem definition with which we will try to:  A nalyze and understand problems faced with orthodox implementation of the software.  How did evolution of SO A happened  How would SO A implementation help business gain revenue? A ssume that you are a businessman which everyone in the IT industry thinks to be one day, planning/dreaming everyday to start a side business. T his is one typical example which is used everywhere, as we can find a lot of help with th is typical example. We have tried to make it a bit simple for beginners to understand with help online. So I being a small middle class IT guy I have a brilliant idea to start a small mortgage business where I lend money at low r ate of interest. I start with an online service where user can login and apply for a loan. With analysis we defined a problem definition for the service. P roblem definition: 1) If the rate of interest for the loan application is less than 5%, then the application for the loan has to go through a special approval from the management. Where the management would analyze the requirement of the applicant his needs and approve. 2) A ll other application can be directly sanctioned by the service, conditioned on having the details of the applicant. T hinking like a business man I start with thinking on how to save money, so what I plan to implementing the software all by yourself as I have the background of software after all my parents have spend so much of money it should be used somewhere. With all my knowledge and IT background I plan to start with the implementation. Basic and the most import thing for software is its architecture. So below is how I plan to implement my software:  First page of the screen (assuming will implement login later on) which accepts the user information and details of loan to b e sanctioned.  O nce the user enters the details, save the user details in a user details table and route the request to call appropriate methods, say requestWithRateBelowFive() and requestWithRateAboveFive().  C all these methods based on the request type i.e details and background information and capability to pay the EM I. A fter 6 long months of work and rigorous testing of my software, I plan to put my software live. With all the domain registration done my software is live. Now my project is live and is giving me a lot of profit. With the increased profit I want to have mor e functionality to be added in my software. Extension to problem definition:  Where I can retrieve the details of the user who are consistent with their EMIs and are loyal customer to the company. A t the same time with millions of dollars in as my liquid cash I have acquired a company which gives special offers to the user with auto loans with low rate of interest. P roblems:  With the current implementation of my project I will have to modify the entire implementation to include the new offer and merge the new companies’ software into my software.  T his will result in downtime for 2 days which is directly proportional to loss of significant amount of revenue and customers . T his implementation/architecture of project is called as point to point integration.
  • 2. T his is one of the oldest and original integration patterns. It derives its name from the direct, tightly bound connections that are made between applications and is the simplest of the integration architectures. T here are advantages with point to point integration:  P oint-to-Point solutions are often fast and efficient.  T he efficiency that derives from applications being tightly bound is one reason why at least a few P oint -to-Point solutions will continue to be utilized for the foreseeable future. What are the drawbacks with the current implementation/architecture of the product?  A s the number of applications increases so does the overall complexity of the environment.  High maintenance costs and a lack of flexibility, when it becomes necessary to make chang es. Conclusion: T he basic problem is the A rchitecture of the product, to be specific “Integration architecture”. 2. INTEGRATIONARCHITECTURE So what is Integration architecture and how is it significant for a fast growing business. C onsider an example of a well deigned building where all electrics and plumbing keep working no matter how many appliances are switched on or connected. T his building is capable enough for extension without tearing up the blueprint and start again with new electrical connection. T his is an example of good architecture. T he same applies to software systems. Software architecture is the backbone of any complex computer system. T he architecture encompasses all of the software elements, the relationships between the elemen ts and the user interfaces to those elements. T he performance and reliability of a software system are highly dependent upon the software architecture. Well-designed software architecture can be extended with relative ease to accommodate new applications without requiring extensive infrastructure development. Now question comes down to how can we eliminate this downtime and in future with new acquisitions integration. T here are many other types of INTEGRATION ARCHITECTURE: 3. HUB AND SPOKEINTEGRATIONARCHITECTURE T he earliest formal integration technologies worked on the principle that all information coming from the applications had to be processed within a single machine or server called a “hub”. A cting as a central point of control, the hub dealt with all message processing including routing, splitting and combining of messages, mapping, and so on. Hub and Spoke implementations decouple the sending and receiving applications. U nlike P oint -to-Point, the applications on either side of the hub can be modified independently of each other. Since applications no longer need to perform data mapping, centralized definition and control of business processes could be easily achieved for the first time. Hub and Spoke A rchitecture C entralized Integration P rocessing Hub What are the advantages of Hub and Spoke architecture? With Hub and Spoke, the integration environment becomes less complex. Whereas Point-to-Point becomes impossibly complicated as the number of connections increase, Hub and Spoke remains, in principle, simple since all the connections are to and from the hub. Hub and Spoke is the preferred architecture for achieving an easily controlled and managed environment in a medium sized integration project. What are the disadvantages of Hub and Spoke architecture? With Hub and Spoke, the initial setup of two-way communications can be challenging. T he hub has to coordinate messages flowing between applications, and at the same time applications on both sides of the hub need to work well in a decoupled fashion. Both the source and target applications need some knowledge of each other in order to process messages. T his sometimes makes it difficult to add or remove senders and receivers.
  • 3. Since the hub must control all of the integrated processes, it is a viable option only when both sender and receiver agree on which hub to use. T his will not be a problem for companies that are integrating internally, but may become a serious issue fo r Business to Business (B2B) and even cross-departmental integration projects. U nfortunately, with so much processing taking place in the central hub, Hub and Spoke exacts high overheads. P rocesses within the hub often require significant processing power and lots of disk space. A s the number and complexity of proce sses increase, performance can suffer and hubs often become difficult to manage, maintain, and extend. P ure Hub and Spoke implementations do not scale well. O ne solution is to create a Federated architecture, which is an extension of Hub and Spoke that allows for multiple hubs to provide load sharing and back-up in case of failure. 4. DISTRIBUTEDINTEGRATIONARCHITECTURE In distributed architecture: M essage translation, routing, splitting, and combining are performed closer to source and target system by using smaller computers called agents. A gent computers are connected to just one system and reduce the processing load on that system. A gents take information from the application they are connected to, process it, and send it to any target appli cation(s) interested in receiving that information. T his is also known as peer to peer integration architecture. What are the advantages of Distributed architecture? Distributed architecture is governed by centralized rules and the requirements of the bu siness flow. M ost of the processing is performed in agent processors located near the source and target applications. Besides gains in processing efficiency by distributing the workload among dedicated processors, a Distributed A rchitecture is able to grow relatively easily. What are the disadvantages of Distributed architecture? M any organizations have a mix of platforms and operating systems on which their business applications run, a situation that i s often the result of mergers and acquisitions. When it becomes necessary to change or expand the system architecture, it is unfortunately not simply a matter of choosing one of the distributed technologies and implementing it. O pting for one technology may only provide a distributed solution for half of your organization due to the mix of systems that are being used. Beyond these internal problems, there is also the issue of engaging in Business to Business (B2B) exchanges with other companies. T his is another case where an eclectic mix of systems and technolo gies between businesses can impede the use of Distributed Architecture. 5. SERVICEORIENTED ARCHITECTURE (SOA) Service Oriented A rchitecture (SOA) is the latest architectural approach, although it’s not really very new. Service Oriented A rchitecture is essentially an enhanced version of Distributed Architecture that uses loosely coupled software services to support the requirements of business processes and software users. It goes a step further than the previous architectures by providing an integrated environment which spreads out the workload, breaking down the different “silos” of business functionality and opening their processes to other applications. A pplications comprised of loosely bound Web Services. One way to think of SOA is like a Lego set. A Lego set is more than just the individual blocks; specialized bigger pieces for complex creations are also available. Similarly, with SO A, an application can customize and/or change the individual pieces o r “services” that it uses. U sing these concepts, vast and complex component based applications can be developed. T he breakthrough for SO A came with the acceptance of Web Services, where different vendors agree to a common communication a standard which is XML. A fter Web Services came Enterprise Service Bus (ESB) technology. Based on Web Services, and exhibiting all of the characteristics of the M essaging solutions previously supplied by the integration vendors, ESB has become the accepted standard for the creation of an organization’s Service Oriented A rchitecture. Without exception all of the integration vendors now provide an SO A architecture built on the concept of an Enterprise Service Bus (ESB). T o summarize the definition, SOA is an architecture pattern to integrate loosely coupled applications in to one system.
  • 4. IT companies have started to realize that the ultimate objective these days for building a system would be to automate business processes i.e. to develop applications that would provide a complete flow of the process from its end to the beginning. T here are many challenges that an IT company building the application would face. T wo of the basic challenges which lay the basic foundation of the developing business process are: 1) Every company does not have the same requirements. 2) C hanges are constantly incorporated in a business process to compete; the enterprise service has to be flexible enough to incorporate the changes. If you are still not clear with the definition you may say that this statement contradict with the basic requirement on which a service is build i.e. stability and availability to process as and when required. Here it goes again with very simple and cle ar words. SOA is aggregation of such stable services. Services are constructed to be stable and efficient while aggregations are designed to be agile or rather accept the changes. Hence these loosely coupled services (Service O riented) aggregations are much more open to changes rather than the orthodox monolithic services that require ages to incorporate even a small change in the service. Now the questions arises how are these independent stable services aggregated to design a loosely coupled system? How do we ensure that the stability of the service will be maintained if it is coupled with another se rvice which is constructed on a different platform? T he answer to the questions is standardization of the platform on which the services are coupled. T hese services remain stable by relying themselves on standard based interfaces and standard/defined messa ges (SOAP/Schemas). I hope the basic question of why SO A is introduced in IT industry and how would it look like in a top view of the system is clear. For a beginner there are millions of questions that needs to be answered with respect to the ingredients to coupling of services, how are these services deployed and on what platform do we couple or rather how do we incorporate the standardization to integrate this system. I hope the next upcoming section of SO A would answer their questions. 6. EXTENSIBLEMARKUPLANGUAGE What is XML? From definitions of W3C :  XM L stands for EXtensible M arkup Language.  XM L is a markup language much like HTML.  XM L was designed to carry and store data, not to display data.  XM L tags are not predefined. Y ou must define your own tags.  XM L is designed to be self-descriptive.  XM L is a W3C Recommendation. Example: <note> <to>T ove</to> <from>Jani</from> <heading>Reminder</heading> <body>Don’t forget me this weekend!</body> </note> Where: T he tags in the example above (like <to> and <from>) are not defined in any XM L standard. T hese tags are “invented” by the author of the XM L document. What is XM L namespace? XM L Namespaces provide a method to avoid element name conflicts. T he XM L namespace is a special type of reserved XM L attribute that you place in an XM L tag. T he reserved attribute is actually more like a prefix that you attach to any namespace you create. T his attribute prefix is “xmlns:”, which stands for XM L NameSpace. T he colon is used to separate the prefix from your names pace that you are creating.
  • 5. What is XML Schema? A n XM L Schema describes the structure of an XM L document. T he XM L Schema language is also referred to as XML Schema Definition (XSD). A n XM L Schema:  defines elements that can appear in a document  defines attributes that can appear in a document  defines which elements are child elements  defines the order of child elements  defines the number of child elements  defines whether an element is empty or can include text  defines data types for elements and attributes  Defines default and fixed values for elements and attributes. 7. WEB SERVICE DESCRIPTIONLANGUAGE What is WSDL?  WSDL stands for Web Services Description Language  WSDL is written in XM L  WSDL is an XM L document  WSDL is used to describe Web services  WSDL is also used to locate Web services and the operations (or methods) the service exposes.  WSDL is a W3C recommendation. T o start with any software we have client requirements. T hese requirements define the input and the output elements of the service. T he data types of the input and output messages in terms if whether the input message will have a U ser ID with a length defined of 8 characters and it shout be of string type. T hese requirements are like a contract between the provider of the service and the user of the service. T he user cannot access the service if it provides the input (U ser ID) with more than 8 characters and the provider of the service needs to th row a fault or make the service unavailable for the user with U s er ID more than 8 characters. T his contact is defined in a document called WSDL on which web service is constructed. Y ou can say that WSDL is the stilt of a web service. WSDL is definition of web service in its language i.e. XM L. It is a contract between the service provider and the user. It is a description of the web service. WSDL can be broken down to 4 critical chunks. 1. Interface information/ Operation information. 2. M essage Information/ Data type information. 3. Binding Information/ T ransport Information. 4. A ddress Information/ Location Information. With respect to constructing a WSDL it can be defined with 6 major elements: 1. definitions 2. types 3. message 4. portT ype 5. binding 6. service Y ou might be thinking why I have written the elements name in lower case. T his would sound a bit stupid but this is how the elements appear in the wsdl definition.
  • 6. Let us look at a sample WSDL now. <?xml version=”1.0″ encoding=”U TF-8″ standalone=”no”?> <wsdl:definitions xmlns:soap=”http://schemas.xmlsoap.org/wsdl/soap/” xmlns:tns=”http://www.example.org/NewWSDLFile/” xmlns:wsdl=”http://schemas.xmlsoap.org/wsdl/” xmlns:xsd=”http://www.w3.org/2001/XMLSchema” name=”NewWSDLFile” targetNamespace=”http://www.example.org/NewWSDLFile/”> <wsdl:types> <xsd:schema targetNamespace=”http://www.example.org/NewWSDLFile/”> <xsd:element name=”NewOperation”> <xsd:complexType> <xsd:sequence> <xsd:element name=”in” type=”xsd:string”/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name=”NewOperationResponse”> <xsd:complexType> <xsd:sequence> <xsd:element name=”out” type=”xsd:string”/> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:schema> </wsdl:types> <wsdl:message name=”NewOperationRequest”> <wsdl:part element=”tns:NewOperation” name=”parameters”/> </wsdl:message> <wsdl:message name=”NewOperationResponse”> <wsdl:part element=”tns:NewOperationResponse” name=”parameters”/> </wsdl:message> <wsdl:portT ype name=”NewWSDLFile”> <wsdl:operation name=”NewOperation”> <wsdl:input message=”tns:NewOperationRequest”/> <wsdl:output message=”tns:NewOperationResponse”/> </wsdl:operation> </wsdl:portT ype> <wsdl:binding name=”NewWSDLFileSOAP” type=”tns:NewWSDLFile”> <soap:binding style=”document” transport=”http://schemas.xmlsoap.org/soap/http”/> <wsdl:operation name=”NewOperation”> <soap:operation soapAction=”http://www.example.org/NewWSDLFile/NewOperation”/> <wsdl:input> <soap:body use=”literal”/> </wsdl:input> <wsdl:output> <soap:body use=”literal”/>
  • 7. </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name=”NewWSDLFile”> <wsdl:port binding=”tns:NewWSDLFileSOAP” name=”NewWSDLFileSOAP”> <soap:address location=”http://www.example.org/”/> </wsdl:port> </wsdl:service> </wsdl:definitions> In the WSDL described above all the 6 elements are highlighted in black. Y ou would by now have concluded that a WSDL is aggregation of these 6 elements. Let us now see what exactly these 6 elements consists of and why are they included in a WSDL definition. 1) definitions: It is the root element of all the WSDL document. It defines the name of the web service. <wsdl:definitions name=”NewWSDLFile” xmlns:soap=”http://schemas.xmlsoap.org/wsdl/soap/” xmlns:tns=”http://www.example.org/NewWSDLFile/” xmlns:wsdl=”http://schemas.xmlsoap.org/wsdl/” xmlns:xsd=”http://www.w3.org/2001/XMLSchema” targetNamespace=”http://www.example.org/NewWSDLFile/”> </wsdl:definitions> It defines various namespaces that is used through out the document. 2) types: It describes the data type of the message being exchanged. If the message exchange is only in terms of simple data types as string and integer then this types element would not be required. O ne more thing to notice is WSDL does not use any exclusive typing system, but if not declared it uses W3C XML schema specifications as the default choice. <wsdl:types> <xsd:schema targetNamespace=”http://www.example.org/NewWSDLFile/”> <xsd:element name=”NewOperation”> <xsd:complexType> <xsd:sequence> <xsd:element name=”in” type=”xsd:string”/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name=”NewOperationResponse”> <xsd:complexType> <xsd:sequence> <xsd:element name=”out” type=”xsd:string”/> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:schema> </wsdl:types> 3) messages: It provides the abstract of the message being transferred in a one-way transmission. It can contain one or more part elements which can refer to message parameters or return values. <wsdl:message name=”NewOperationRequest”> <wsdl:part element=”tns:NewOperation” name=”parameters”/>
  • 8. </wsdl:message> <wsdl:message name=”NewOperationResponse”> <wsdl:part element=”tns:NewOperationResponse” name=”parameters”/> </wsdl:message> 4) portType: portT ype combines multiple message elements defined above to complete the round trip of the operation. Each operation to complete its service needs to have a set of request and response message which is described in the message elements. Each portType can have multiple operations element. <wsdl:portT ype name=”NewWSDLFile”> <wsdl:operation name=”NewOperation”> <wsdl:input message=”tns:NewOperationRequest”/> <wsdl:output message=”tns:NewOperationResponse”/> </wsdl:operation> </wsdl:portT ype> Let us link up the 3 elements above and see where we have reached in terms of WSDL description. Starting from the bottom, each web service has an operation or it can have many operations to perform. Each operation during its service takes an input request and delivers an output response. T his operation is defined in portT ype element described above. T his input and output messages has multiple parameters or data types that is described in the element message. T he data type can be defined separately as a combination of many sub data types or elements which is describes under types element. 5) binding: T his element describes the concrete protocol/standard on which the service will be implemented. It describes the data format specification on which the message and operations are defined. WSDL has a build in extension for defining SO AP based services. Hence SOAP specific information goes under this element. <wsdl:binding name=”NewWSDLFileSOAP” type=”tns:NewWSDLFile”> <soap:binding style=”document” transport=”http://schemas.xmlsoap.org/soap/http”/> <wsdl:operation name=”NewOperation”> <soap:operation soapAction=”http://www.example.org/NewWSDLFile/NewOperation”/> <wsdl:input> <soap:body use=”literal”/> </wsdl:input> <wsdl:output> <soap:body use=”literal”/> </wsdl:output> </wsdl:operation> </wsdl:binding> 6) service: T his element describes the location or the address for invoking the service. It is used to aggregate a set of ports to retrieve the location to access the specific service. <wsdl:service name=”NewWSDLFile”> <wsdl:port binding=”tns:NewWSDLFileSOAP” name=”NewWSDLFileSOAP”> <soap:address location=”http://www.example.org/”/> </wsdl:port> </wsdl:service> So there it is we are done with the creation of a WSDL. A ll the elements defined here aggregated will let us define a web service contract. T his WSDL is a very important aspect of a web service. T his contract defines all the elements/parameters needed in the request and response of the operation and which is agreed upon by the provider and user of the web service.
  • 9. Based on the requirements from the client the elements are described in the messages. T he input that is received from the user to the operation is validated against the operation elements described in the WSDL. T heir input cannot violate the description of the input message in the WSDL, which is an important aspect of web -services security operations. 8. ORACLE SERVICE BUS A s explained earlier service bus is a solution to problems faced by poor integration architecture. 8.1. Bus, what Bus? T he use of a Service Bus pattern helps to decouple the pieces from each other, messages are passed between the components in the form of asynchronous event topics in a publish/subscribe pattern, that allows every part to be decoupled from the othe r part and we do not need to span transactions or hold connections between the internal components that would ultimately cause a degradation in the performance of the system. T he Service Bus should also perform the routing of messages between the components so no components would have to be dependent on the knowledge of the location of another component. C onnections between the user interface will and should be point to point as this is required for the component to perform its duty within the constraints that are imposed upon it, the same holds true for software architectures. T he reduction of dependency on other parts should be driven as far down into the architecture as is reasonable, as this will lead one down the path of flexibility and testability. Introduction: A proven, lightweight, configuration based, policy driven integration techno logy specifically designed for the task of integrating, virtualizing, scaling service management, and traditional message brokering across heterogeneous IT environments and managing services in a service-oriented architecture (SOA), O racle Service Bus enables you to achieve value more quickly with simple, code-free, configuration based service integration. Y ou will be able to move toward enterprise wide SOA deployments with a high-performance, highly scalable SOA integration backbone. T he O racle Service Bus (O SB) provides service bus capabilities for the entire company, again including standard functionality as transformation, routing, event delivery and payload validation. It’s main function is to decouple intra -application communication from inter-application. Endpoint changes will not affect the internals of composite applications. T he O SB is based on the A qualogic Service Bus, augmented with key features from the O racle ESB, especially JCA adapters, DVM, X -ref and JDev based design-time. A dvantages: Location transparency: Isolate from changes to service location. Backward compatibility: isolate from changes to service contact on the new service added. Service enablement: allow multiple protocols/messages to participate in SOA. Dynamic routing: U se business rules to determine destination service. Message enrichment: update the message using the response from another service. 8.2. Resources in Oracle Service Bus In O racle Service Bus world, all the artifacts are called the O SB resources. In a typical SOA environment, there will be a need to share the different resources across the projects. T he resources can be anything like WSDLs, XSDs, P roxy, Business service etc. We cannot create all kinds of resources in the O SB Configuration P roject. For example creating WSDL or XSD in configuration project will give the error. We can only create the Global Resources like Proxy Server, JNDI Provider and SM TP Server. A ll these resources that can be created in the O SB Configuration P roject can be accessed from different O SB projects present in the C onfiguration Project.
  • 10. 8.3. Proxy Services and Business Services O racle Service Bus provides intelligent message brokering between business services (such as enterprise services and databases) and service clients (such as presentation applications or other business services) through proxy services that you can configure using O racle Service Bus Console. P roxy services are O racle Service Bus definitions of intermediary Web services that O racle Service Bus implements locally on WebLogic Server. With O racle Service Bus message brokering, service clients exchange messages with an intermediary proxy service rather than working directly with a business service. O racle Service Bus allows you to implement proxy services independently and configure them dynamically, as driven by your business needs without requiring costly infrastructure development efforts. T he configuration functions are separated from the management functions in O racle Service Bus C onsole. A proxy service can route messages to multiple business services; you can choose to configure a proxy service with an interface that is independent of the business services with which the proxy service communicates. In such cases, you can configure a message flow definition to route a message to the appropriate business service and map the message data into the format required by the business service’s interface. Business services are O racle Service Bus definitions of the enterprise services that exchange messages during business processes. A business service and its interface can be defined and configured using the O racle Service Bus C onsole. T o configure a business service you must specify its interface, type of transport it uses, its security requirements, and other characteristics. A business service definition is similar to that of a proxy service, but it does not have a p ipeline. 8.4. Message Flows and Pipelines In O racle Service Bus, a message flow is the implementation of a proxy service. Y ou configure the logic for the manipulation of messages using proxy service message flow definitions. T his logic includes such activities as transformation, publishing, and reporting, which are implemented as individual actions within the stages of a pipeline. P ipelines are one-way processing paths that include no branching. A pipeline is a named sequence of stages containing actions, representing a non-branching one-way processing path. It is used to specify the message flow for service requests and responses. A stage is a user-configured processing step. M essages fed into the pipelines are accompanied by a set of message context variables that contain the message contents. T hey can be accessed or modified by actions in the pipeline stages. 8.5. Pipeline Pairs P ipeline pairs are request and response pipelines. T he request pipeline definition specifies the actions that O racle Service Bus performs on request messages to the proxy service before invoking a business service or another proxy service. T he response pipeline definition specifies the processing that O racle Service Bus performs on responses from the business or proxy service that the proxy service invokes before returning a response to a client. Each pipeline consists of a sequence of stages, each stage containing actions. However, a single service-level request pipeline might optionally branch out into operational pipelines (you can configure one default operational pipeline at most one per operation). T he determination of the operation is done through user-selected criteria. T he response processing starts with the relevant operation pipeline which then joins into a single service-level response pipeline. 8.6. Message Flow Components A message flow is composed of components that define the logic for routing and manipulating messages as they flow through a proxy service. Nodes are configured to route messages through the message flow, and stages and actions contain rules for processing and transforming messages. M ost of the processing logic in a message flow is handled in pipelines. A pipeline is a named sequence of stages representing a non-branching one-way processing path. P ipelines belong to one of the following categories:  Request pipelines process the request path of the message flow.  Response pipelines process the response path of the message flow.  Error pipelines handle errors for stages and nodes in a message flow as well as errors at the level of the message flow (service). T o implement the processing logic of a proxy service, request and response pipelines are paired together in pipeline pair nodes. T hese pipeline pair nodes can be combined with other nodes into a single-rooted tree structure to control overall flow.
  • 11. T able 3-1 describes the components available for defining message flows. Component Type Summary Start node Every message flow begins with a start node. A ll messages enter the message flow through the start node, and all response messages are returned to the client through the start node. T here is nothing to configure in a start node. P ipeline pair node A pipeline pair node combines a single request pipeline and a single response pipeline in one top -level element. A pipeline pair node can have only one direct descendant in the message flow. During request processing, only the request pipeline is executed when O racle Service Bus processes a pipeline pair node. T he execution path is reversed when O racle Service Bus processes the response pipeline. Stage Request pipelines, response pipelines, and error handlers can contain stages, where you configure actions to manipulate messages passing through the pipeline. Error handler A n error handler can be attached to any node or stage, to handle potential errors at that location. Branch node A branch node allows processing to proceed along exactly one of several possible paths. O perational branching is supported for WSDL -based services, where the branching is based on operations defined in the WSDL. C onditional branching is supported for conditions define d in an XP ath-based switch table. Route node A route node performs request/response communication with another service. It represents the boundary between request and response processing for the proxy service. When the route node dispatches a request mess age, the request processing is considered complete. When the route node receives a response message, the response processing begins. T he route node supports conditional routing as well as request and response transformations. Because a route node represents the boundary between request and response processing, it cannot have any descendants in the message flow. 8.7. Building a Message Flow T he only components required in a message flow are a start node and a route node. No restrictions exist on what other components can be chained together in the message flow. Y ou could create a single route node that contained all the logic for the flow. O r, you could link two pipeline pair nodes without a branch node in between. If you use branch nodes, eac h branch node could start with a different element. O ne branch could terminate with a route node, another could be followed by a pipeline pair, and yet another could have no descendant. (When a branch with no descendants is executed at run time, response processing begins immediately.) However, in general, a message flow is likely to be designed in one of the following ways:  For non-operational services (services that are not based on WSDLs with operations), the flow consists of a single pipeline pair at the root followed by a route node.  For operational services, the flow consists of a single pipeline pair at the root, followed by a branch node based on an operation, with each branch consisting of a pipeline pair followed by a route node. 8.8. Message Execution T able below describes how message are processes in a typical message flow: M essage Flow Node What happens during message processing? Request P rocessing Start node Request processing begins at the start node. P ipeline pair node Executes the request pipeline only. Branch node Evaluates the branch table and proceeds down the relevant branch. Route node P erforms the route along with any request transformations. In the message flow, regardless of whether routing takes place or not, the route node represents the transition from processing a request to processing a response. A t the route node, the direction of the message flow is reversed. If a request path does not have a route node, the response processing is initiated in the reverse direction without waiting for any response. Response P rocessing Skips any branch nodes and continues with the node that preceded the branch Route node Executes any response transformations.
  • 12. Branch node Skips any branch nodes and continues with the node that prec eded the branch P ipeline pair node Executes the response pipeline Start node Sends the response back to the client 8.9. Branching in Message Flows T wo kinds of branching are supported in message flows: operational branching, configured in an operational branch node, and conditional branching, configured in a conditional branch node. 8.9.1. Operational Branching When message flows define WSDL-based proxy services, operation-specific processing is required. When you create an operational branch node in a message flow, you can build branching logic based on the operations defined in the WSDL. Y ou must use operational branching when a proxy service is based on a WSDL with multiple operations. Y ou can consider using an operational branch node to handle messages separately for each operation. 8.9.2. Conditional Branching U se conditional branching to branch based on a specified condition, for example the document type of a message. C onditional branching is driven by a lookup table with each branch tagged with simple, unique string values, for example, Q uantityEqualToOrLessThan150 and Q uantityMoreThan150. Y ou can configure a conditional branch to branch based on the value of a variable in the message context (declared, for example, in a stage earlier in the message flow), or you can configure the condition to branch based on the results of an XP a th expression defined in the branch itself. A t run time, the variable or the expression is evaluated, and the resulting value is used to determine which branch to follow. If no branch matches the value, the default branch is followed. A branch node may have several d escendants in the message flow: one for each branch, including the default branch. Y ou should always define a default branch. Y ou should design the proxy service in such a way that the value of a lookup variable is set before reaching the branch node. For example, consider the following case using a lookup variable. A proxy service is of type any SOAP or any XM L, and you need to determine the type of the message so you can perform conditional branching. Y ou can design a stage action to identify the message type and then design a conditional branching node later in the flow to separate processing based on the message type. Now consider the following case using an XP ath expression in the conditional branch node. Y ou want to branch based on the quantity in an order. T hat quantity is passed via a variable that can be retrieved from a known location in $body. Y ou could define the following XP ath expression to retrieve the quantity: declare namespace openuri=”http://www.openuri.org/&#8221;; declare namespace com=”oracle.com/demo/orders/cmnCust”; ./openuri:processCust/com:cmnCust/com:Order_Items/com:Item/com:Quantity T he condition (for example, <500) is then evaluated in order down the message flow against the expres sion. Whichever condition is satisfied first determines which branch is followed. If no branch condition is satisfied, then the default branc h is followed. Y ou can use conditional branching to expose the routing alternatives for the message flow at the top level flow view. For example, consider a situation where you want to invoke service A or service B based on a condition known early in the message flow (for example, the message type). Y ou could configure the conditional branching in a routing table in th e route node. However, that makes the branching somewhat more difficult to follow if you are just looking at the top level of the flo w. Instead, you could use a conditional branch node to expose this branching in the message flow itself and use simple rout e nodes as the subflows for each of the branches. C onsider your business scenario before deciding whether you configure branching in the message flow or in a stage or route node. When making your decision, remember that configuring branches in the message flow can be awkward in the design interface if a large number of branches extend from the branch node. 8.10. Configuring Actions in Stages and Route Nodes A ctions provide instructions for handling messages in pipeline stages, error handler stages, and route nodes. T he context determines which actions are available in the O racle Service Bus C onsole or in the O racle Service Bus Plug -ins for Workshop for WebLogic, as described in the following sections:  C ommunication A ctions  Flow C ontrol Actions
  • 13.  M essage P rocessing A ctions  Reporting A ctions 8.10.1. Communication Actions C ommunication actions control message flow: A ction U se A vailable in Dynamic publish P ublish a message to a service specified by an XQ uery expression  P ipeline stage  Error handler stage  Route node P ublish Identify a statically specified target service for a message and to configure how the message is packaged and sent to that service  P ipeline stage  Error handler stage P ublish table P ublish a message to zero or more statically specified services. Switch- style condition logic is used to determine at run time which services will be used for the publish  P ipeline stage  Error handler stage Routing options M odify any or all of the following properties in the outbound request: U RI, Q uality of Service, M ode, Retry parameters, M essage P riority  P ipeline stage Service callout C onfigure a synchronous (blocking) callout to an O racle Service Bus- registered proxy or business service.  P ipeline stage  Error handler stage T ransport headers Set the header values in messages  P ipeline stage  Error handler stage 8.10.2. Flow Control Actions Flow controls actions implement conditional routing, conditional looping, and error handling. Y ou can also use them to notify the invoker of success or to skip the rest of the actions in the stage: Action Use to. Available in For each Iterate over a sequence of values and execute a block of actions  P ipeline stage Error handler stage If… then… P erform an action or set of actions conditionally, based on the Boolean result of an XQ uery expression  P ipeline stage  Route node Error handler stage Raise error Raise an exception with a specified error code (a string) and description  P ipeline stage Error handler stage Reply Specify that an immediate reply be sent to the invoker. T he reply action can be used in the request, response or error pipeline. Y ou can configure it to result in a reply with success or failure. In the case of reply with failure where the inbound transport is HT TP, the reply action specifies that an immediate reply is sent to the invoker  P ipeline stage Error handler stage Resume Resume message flow after an error is handled by an error handler. T his action has no parameters and can only be used in error handlers  Error handler stage Skip Specify that at run time, the execution P ipeline stage
  • 14. of this stage is skipped and the processing proceeds to the next stage in the message flow. T his action has no parameters and can be used in the request, response or error pipelines  Error handler stage 8.10.3. Message Processing Actions T he actions in this category process the message flow. T able 3-5 describes the message processing actions. A ction U se Location A ssign A ssign the result of an XQ uery expression to a context variable. P ipeline stage Error handler stage Delete Delete a context variable or a set of nodes specified by an XP ath expression. P ipeline stage Error handler stage Insert Insert the result of an XQ uery expression at an identified place relative to nodes selected by an XP ath expression. P ipeline stage Error handler stage Java callout Invoke a Java method, or EJB business service, from within the message flow. P ipeline stage Error handler stage M FL transform C onvert message content from XM L to non-XML, or vice versa, in the message pipeline. A n M FL is a specialized XML document used to describe the layout of binary data. It is an O racle proprietary language used to define rules to transform formatted binary data into XML data, or vice versa. P ipeline stage Error handler stage Rename Rename elements selected by an XP ath expression without modifying the contents of the element. P ipeline stage Error handler stage Replace Replace a node or the contents of a node specified by an XP ath expression. T he node or its contents are replaced with the value returned by an XQ uery expression. A replace action can be used to replace simple values, elements and even attributes. A n XQuery expression that returns nothing is equivalent to deleting the identified nodes or making them empty, depending upon whether the action is replacing entire nodes or just node contents. T he replace action is one of a set of U pdate actions. P ipeline stage Error handler stage V alidate V alidate elements selected by an XP ath expression against an XM L schema element or a WSDL resource. Y ou can validate global elements only; Oracle Service Bus does not support validation against local elements. P ipeline stage Error handler stage
  • 15. 8.10.4. Reporting Actions Y ou use the actions in this category to log or report errors and generate alerts if required in a message flow within a stage. T able 3-4 describes the reporting actions. A ction U se to… A vailable in A lert Generate alerts based on message context in a pipeline, to send to an alert destination. U nlike SLA alerts, notifications generated by the alert action are primarily intended for business purposes, or to report errors, and not for monitoring system health. A lert destination should be configured and chosen with this in mind. If pipeline alerting is not enabled for the service or enabled at the domain level, the configured alert action is bypassed during message processing. P ipeline stage Error handler stage Log C onstruct a message to be logged and to define a s et of attributes with which the message is logged. P ipeline stage Error handler stage Report Enable message reporting for a proxy service. P ipeline stage Error handler stage 8.11. Configuring Transport Headers in Message Flows T he transport header action is a communication type action, and it is available in pipeline stages and error handler stages. 8.11.1. Configuring Global Pass Through and Header-Specific Copy Options for Transport Headers T he following options are available when you configure a transport headers action:  T he Pass all Headers through Pipeline option specifies that at run time, the transport headers action passes all headers through from the inbound message to the outbound message or vice versa. Every header in the source set of headers is copied to the target header set, overwriting any existing values in the target header set.  T he Copy Header from Inbound Request option and the Copy Header from Outbound Response options specifies that at run time, the transport headers action copies the specific header with which this option is associated from the inbound message to the outbound message or vice versa. U se the options in a way that best suits your scenario. Both options result in the headers in the source header set being copied to the target header set, overwriting any existing value in the target set. Note that the Pass all Headers through Pipeline option is executed before the header-specific Copy Header options. In other words, for a given transport headers action configuration, if you select Pass all Headers through Pipeline, there is no need to select theCopy Header option for given headers. However, you can select Pass all Headers through Pipeline to copy all headers, and subsequently configure the action such that individual headers are deleted by selecting Delete Header for specific headers. WARNING: Because transport headers are specific to the transport types, it is recommended that the pass -through (or copy) options only be used to copy headers between services of the same transport type. P assing (or copying) headers between services of different transport types can result in an error if the header being passed is not accepted by the target transport. For the same reasons, be careful when you specify a header name using the Set Header option. 8.11.1.1. Understanding How the Run Time Uses the Transport Headers Settings A s described above, you can use transport header actions to configure the values of the transport headers for outbound requests (the messages sent out by a proxy service in route, publish, or service callout actions) and inbound responses (the response messages a proxy service sends back to clients). In general, the header values can be:  Specified using an XQ uery expression  P assed through from the source to the target service  Deleted while going from the source to the target service T he transport headers action allows you to set, delete, or pass -through the headers in $inbound or $outbound. If you set or delete these headers and then log $inbound or $outbound, you can see the effects of your changes. However, when the message is sent out, the O racle Service Bus binding layer may modify or remove some headers in $inbound or $outbound and
  • 16. the underlying transport may in turn, ignore some of these headers and use its own values. A n important distinction is that any modifications done by the binding layer on a header are done directly to $inbound and $outbound, whereas modifications done by the transport affects only the message’swire format. For example, although you can specify a value for the outbound C ontent-Length header, the binding layer deletes it from $outbound when sending the message. C onsequently, the modification is visible in the response path (for example, you can see the modified value if you log $outbound). If you set t he U ser-Agent header in $outbound, the HT TP transport ignores it and use its own value—however, the value in $outbound is not changed. T able 3-7 describes the transport headers that are ignored or overwritten at run time and other limitations that exist for specific transport headers. T ransport Description of Limitation… T ransport Headers A ffected By Limitation… O utbound Request Inbound Response HT TP O racle Service Bus run time may overwrite these headers in the binding layer when preparing the message for dispatch. If these headers are modified, $inbound and $outbound are updated accordingly. C ontent-Type C ontent-Type T he underlying transport may ignore these headers and use different values when sending the message. A ny changes done by the transport will not be reflected in $inbound or $outbound. A ccept C ontent-Length C onnection Host U ser-Agent C ontent-Length Date T ransfer-Encoding JM S C an only be set when the request is with respect to a one- way service or a request/response service based on JM SMessageID correlation. If sending to a request/response service based on JM SCorrelationID correlation, these headers are overwritten at run time. JM SCorrelationID JM SCorrelationID Should be set to the message time-to-live in milliseconds. T he resulting value in the message received is the sum of the time-to-live value specified by the client and the GM T at the time of the send or publish1. JM SExpiration JM SExpiration T he O racle Service Bus run time sets these headers. In other words, any specifications you make for these headers at design time are overwritten at run time. JM SMessageID JM SRedelivered JM STimestamp JM SXDeliveryCount JM SXUserID JM S_IBM_PutDate2 JM S_IBM_PutTime 2 JM S_IBM_PutApplType 2 JM S_IBM_Encoding 2 JM S_IBM_Character_Set2 JM SMessageID JM SRedelivered JM STimestamp JM SXDeliveryCount JM SXUserID JM S_IBM_PutDate 2 JM S_IBM_PutTime 2 JM S_IBM_PutApplType 2 JM S_IBM_Encoding 2 JM S_IBM_Character_Set 2 Because IBM MQ does not allow certain properties to be set by a client application, if you set these headers with respect to an IBM M Q destination, a run-time exception is raised. JM SXDeliveryCount JM SXUserID JM SXAppID JM SXDeliveryCount JM SXUserID JM SXAppID T hese headers cannot be deleted when the P ass all Headers through P ipeline option is also specified. JM SDeliveryMode JM SExpiration JM SMessageID JM SRedelivered JM STimestamp JM SXDeliveryCount  JM SDeliveryMode  JM SExpiration  JM SMessageID  JM SRedelivered  § JM STimestamp  § JM SXDeliveryCount  JM SCorelationID—if the inbound message has the correlation ID se example, if the inbound response c from a registered JMS business se FT P No limitations. In other words you can set or delete the header(s)3for File and FT P transports and your specifications are honored by the O racle Service Bus run time. File E-mail T he O racle Service Bus run time sets these headers. In other C ontent-Type C ontent-Type
  • 17. words, any specifications you make for these headers at design time are overwritten at run time. O racle Service Bus does not use these headers for outbound requests. If you set them dynamically (that is, if you set them in the $outbound headers section), O racle Service Bus ignores them. T hese headers are received in $inbound. Date is the time the mail was sent by the sender. From is retrieved from incoming mail headers. From (Name) Date  For example, if you set the JM SExpiration header to 1000, and at the time of the send, GM T is 1,000,000 (as a result of System.currentTimeMillis()), the resulting value of the JM SExpiration property in the JM S message is 1,000,1000  Header names with the JM S_IBM prefix are to be used with respect to destinations hosted by an IBM MQ server  For FT P and file proxies, there is an transport request header ‘fileName’. T he value of this request head er is the name of the file being polled. Note T he same limitations around setting certain transport headers and metadata are true when you set the inbound and outbound context variables, and when you use the O racle Service Bus T est C onsole to test your proxy or business services. 8.12. Performing Transformations in Message Flows T ransformation maps describe the mapping between two data types. O racle Service Bus supports data mapping that uses the XQ uery and the eXtensible Stylesheet Language T ransformation (XSLT) standards. XSLT maps describe XM L-to-XML mappings. XQ uery maps can describe XML-to-XML, XM L to non-XML, and non-XML to XM L mappings. T he point in a message flow at which you specify a transformation depends on whet her:  T he message format relies on target services—that is, the message format must be in a format acceptable by the route destination. T his applies when the transformation is performed in a route node or in one of the publish actions. P ublish actions identify a target service for a message and configure how the message is packaged and sent to that service. O racle Service Bus also provides publish table actions. A publish table action consists of a set of routes wrapped in a switc h- style condition table. It is a shorthand construct that allows different routes to be selected, based upon the results of a single XQ uery expression.  Y ou perform the transformation on the response or request message regardless of the route destination. In this case, you can configure the transformations in the request or response pipeline stages. 8.13. Transformations and Publish Actions When transformations are designed in publish actions, the transformations have a local copy of the $outbound variable and message-related variables ($header, $body, and $attachments). A ny changes you make to an outbound message in a publish action affect only the published message. In other words, the changes you make in the publish action are rolled back before the message flow proceeds to any actions that follow the publish action in your message flow. For example, consider a message flow that deals with a large purchase order, and you have to send the summary of the purchase order, through e-mail, to the manager. T he summary of the of the purchase order is created in the SOAP body of the incoming message when you include a publish action in the request pipeline. In the publish action, the purchase order data is transformed into a summary of the purchase order—for example, all the attachments in $attachments can be deleted because they are not required in the summary of the purchase order. 8.14. Transformations and Route Nodes Y ou may need to route messages to one of two destinations, based on a WS -addressing header. In that case, content-based routing and the second destination require the newer version of the document in the SO AP body. In this situation, you can configure the route node to conditionally route to one of the two destinations. Y ou can configure a transformation in the rou te node to transform the document for the second destination. Y ou can also set the control elements in the outbound context variable ($outbound) to influence the behavior of the system fo r the outbound message (for example, you can set the Q uality of Service). See Inbound and O utbound Variables and C onstructing M essages to Dispatch for information about the sub-elements of the inbound and outbound variables and how the content of messages is constructed using the values of the variables in the message context.
  • 18. 8.15. Constructing Service Callout Messages When O racle Service Bus makes a call to a service via a service callout action, the content of the message is constructed using the values of variables in the message context. T he message content for outbound messages is handled differently depending upon the type of the target service. How the message content is created depends on the type of the target service and whether you choose to configure the SO AP body or the payload (parameters or document), as described in the following topics:  SO AP Document Style Services  SO AP RPC Style Services  XM L Services  M essaging Services 8.16. SOAP Document Style Services M essages for SO AP Document Style services (including EJB document and document-wrapped services), can be constructed as follows:  T he variable assigned for the request document contains the SOAP body.  T he variable assigned for the SO AP request header contains the SOAP header.  T he response must be a single XML document—it is the content of the SO AP body plus the SOAP header (if specified) T o illustrate how messages are constructed during callouts to SOAP Document Style services, consider a service callout action configured as follows:  Reques t Document V ariable: myreq  Response Document V ariable: myresp  SO AP Request Header: reqheader  SO AP Response Header: respheader A ssume also that at run time, the request document variable, myreq, is bound to the following XM L. Listing 3-1 Content of Request Variable (myreq) <sayHello xmlns=”http://www.openuri.org/”&gt; <intV al>100</intVal> <string>Hello</string> </sayHello> A t run time, the SO AP request header variable, reqheader, is bound to the following SO AP header. Listing 3-2 Content of SOAP Request Header Variable (reqheader) <soap:Header xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/ xmlns:wsa=”http://schemas.xmlsoap.org/ws/2003/03/addressing”&gt; <wsa:A ction>…</wsa:A ction> <wsa:T o>…</wsa:T o> <wsa:From>…</wsa:From> <wsa:ReplyT o>…</wsa:ReplyTo> <wsa:FaultT o>…</wsa:FaultTo> </soap:Header> In this example scenario, the full body of the message sent to the external service i s shown inListing 3-3 (the contents of the myreq and reqheader variables are shown in bold). Listing 3-3 Message Sent to the Service as a Result of Service Callout Action <?xml version=”1.0″ encoding=”U TF-8″?> <soapenv:Envelope xmlns:soapenv=”http://schemas.xmlsoap.org/soap/envelope/”&gt; <soap:Header xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/ xmlns:wsa=”http://schemas.xmlsoap.org/ws/2003/03/addressing”&gt ; <wsa:Action>…</wsa:Action> <wsa:To>…</wsa:To> <wsa:From>…</wsa:From> <wsa:ReplyTo>…</wsa:ReplyTo> <wsa:FaultTo>…</wsa:FaultTo> </soap:Header> <soapenv:Body> <sayHello xmlns=”http://www.openuri.org/”&gt; <intVal>100</intVal> <string>Hello</string> </sayHello> </soapenv:Body> </soapenv:Envelope> Based on the configuration of the service callout action described above, the response from the service is assigned to the myresp variable. T he full response from the external service is shown inListing 3-4. Listing 3-4 Response Message From the Service as a Result of Service Callout Action
  • 19. <?xml version=”1.0″ encoding=”U TF-8″?> <env:Envelope xmlns:env=”http://schemas.xmlsoap.org/soap/envelope/&#8221; xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221; xmlns:soapenc=”http://schemas.xmlsoap. org/soap/encoding/” xmlns:xsd=”http://www.w3.org/2001/XMLSchema”&gt; <env:Header/> <env:Body env:encodingStyle=”http://schemas.xmlsoap.org/soap/encoding/”&gt; <m:sayHelloResponse xmlns:m=”http://www.openuri.org/”&gt; <result xsi:type=”xsd:string”>T his message brought to you by Hello and the number 100 </result> </m:sayHelloResponse> </env:Body> </env:Envelope> In this scenario, the myresp variable is assigned the value shown in Listing 3-5. Listing 3-5 Content of Response Variable (myresp) as a Result of Service Callout Action <m:sayHelloResponse xmlns:m=”http://www.openuri.org/”&gt; <result ns0:type=”xsd:string” xmlns:ns0=”http://www.w3.org/2001/XMLSchema-instance”&gt; T his message brought to you by Hello and the number 100 </result> </m:sayHelloResponse> 8.17. SOAP RPC Style Services M essages for SO AP RPC Style services (including EJB RPC services) can be constructed as follows:  Request messages are assembled from message context variables. o T he SO AP body is built based on the SO AP RPC format (operation wrapper, parameter wrappers, and so on). o T he SO AP header is the content of the variable specified for the SO AP request header, if one is specified. o P art as element—the parameter value is the variable content. o P art as simple type—the parameter value is the string representation of the variable content. o P art as complex type—the parameter corresponds to renaming the root of the variable content after the parameter name. Response messages are assembled as follows:  T he output content is the content of SOAP header, if a SO AP header is specified.  P art as element—the output content is the child element of the parameter; there is at most one child element.  P art as simple/complex type—the output content is the parameter itself. T o illustrate how messages are constructed during callouts to SOAP RPC Style services, look at this example with the followin g configuration:  A message context variable input1 is bound to a value 100.  A message context variable input2 is bound to a string value: Hello.  A service callout action configured as follows: o Request Parameter intval: input1 o Request Parameter string: input2 o Response Parameter result: output1 In this scenario, the body of the outbound message to the service is shown in Listing 3-6. Listing 3-6 Content of Outbound Message <?xml version=”1.0″ encoding=”U TF-8″?> <soapenv:Envelope xmlns:soapenv=”http://schemas.xmlsoap.org/soap/envelope/”&gt; <soapenv:Body> <sayHello2 xmlns=”http://www.openuri.org/”&gt; <intV al>100</intVal> <string >Hello</string> </sayHello2> </soapenv:Body> </soapenv:Envelope> T he response returned by the service to which the call was made is shown in Listing 3-7. Listing 3-7 Content of Response Message From the helloWorld Service <?xml version=”1.0″ encoding=”U TF-8″?> <env:Envelope xmlns:env=”http://schemas.xmlsoap.org/soap/envelope/&#8221; xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221; xmlns:soapenc=”http://schemas.xmlsoap.org/soap/encoding/&#8221; xmlns:xsd=”http://www.w3.org/2001/XMLSchema”&gt; <env:Header/> <env:Body env:encodingStyle=”http://schemas.xmlsoap.org/soap/encoding/”&gt; <m:sayHello2Response xmlns:m=”http://www.openuri.org/”&gt; <result xsi:type=”n1:HelloWorldResult” xmlns:n1=”java:”> <message xsi:type=”xsd:string”>
  • 20. T his message brought to you by Hello and the number 100 </message> </result> </m:sayHello2Response> </env:Body> </env:Envelope> T he message context variable output1 is assigned the value shown in Listing 3-8. Listing 3-8 Content of Output Variable (output1) <message ns0:type=”xsd:string” xmlns:ns0=”http://www.w3.org/2001/XMLSchema-intance”&gt; T his message brought to you by Hello and the number 100</message> 8.18. XML Services M essages for XM L services can be constructed as follows:  T he request message is the content of the variable assigned for the request document.  T he content of the request variable must be a single XML document.  T he output document is the response message. T o illustrate how messages are constructed during callouts to XM L services, ta ke for example a service callout action configured as follows:  Request Document Variable: myreq  Response Document Variable: myresp A ssume also that at run time, the request document variable, myreq, is bound to the following XM L. Listing 3-9 Content of myreq Variable <sayHello xmlns=”http://www.openuri.org/”&gt; <intV al>100</intVal> <string>Hello</string> </sayHello> In this scenario:  T he outbound message payload is the value of the myreq variable, as s hown in T able 3-9.  T he response and the value assigned to the message context variable, myresp, is shown inListing 3-10. Listing 3-10 Content of myresp Variable <m:sayHelloResponse xmlns:m=”http://www.openuri.org/”&gt; <result xsi:type=”xsd:string”>T his message brought to you by Hello and the number 100 </result> </m:sayHelloResponse> 8.19. Messaging Services In the case of M essaging services:  T he request message is the content of the request variable. T he content can be simple text, XM L, or binary data represented by an instance of <binary-content ref=…/> reference XM L.  Response messages are treated as binary, so the response variable will contain an instance of <binary -content ref= … /> reference XM L, regardless of the actual content received. For example, if the request message context variable myreq is bound to an XM L document of the following format: <hello>there</hello>, the outbound message contains exactly this payload. T he response message context variable (myresp) is bound to a reference element similar to the following: <binary-content ref=” cid:1850733759955566502-2ca29e5c.1079b180f61.-7fd8″/> 8.20. Handling Errors as the Result of a Service Callout Y ou can configure error handling at the message flow, pipeline, route node, and stage level. T he types of errors that are received from an external service as the result of a service callout include transport errors, SOAP faults, responses that do not conform to an expected response, and so on. T he fault context variable is set differently for each type of error returned. Y ou can build your business and error handling logic based on the content of the fault variable. T o learn more about $fault, see Fault V ariable. 8.21. Transport Errors When a transport error is received from an external service and there is no error response payload returned to O racle Servic e Bus by the transport provider (for example, in the case that an HT TP 403 error code is returned), the service callout action
  • 21. throws an exception, which in turn causes the pipeline to raise an error. T he fault variable in a user -configured error handler is bound to a message formatted similarly to that shown in Listing 3-11. Listing 3-11 Contents of the Oracle Service Bus fault Variable—Transport Error, no Error Response Payload <con:fault xmlns:con=”http://www.bea.com/wli/sb/context”&gt; <con:errorC ode>BEA-380000</con:errorCode> <con:reason>Not Found</con:reason> <con:details> ……. </con:details> <con:location> <con:node>P ipelinePairNode1</con:node> <con:P ipeline>P ipelinePairNode1_request</con:Pipeline> <con:Stage>Stage1</con:Stage> </con:location> </con:fault> In the case that there is a payload associated with the transport error—for example, when an HT TP 500 error code is received from the business service and there is XML payload in the response —a message context fault is generated with the custom error code: BEA -382502. T he following conditions must be met for a BEA -382502 error response code to be triggered as the result of a response from a service—when that service uses an HT TP or JM S transport:  (HT TP) T he response code must be any code other than 200 or 202.  (JM S) T he response must have a property set to indicate that it is an error response—the transport metadata status code set to1 indicates an error.  T he content type must be text/xml.  If the service is AnySoap or WSDL -based SOAP, then it must have a SO AP envelope. T he body inside the SOAP envelope must be XM L format; it cannot be text.  If the service type is AnyXML, or a messaging service of type text returns XML content with a non -successful response code (any code other than 200 or 202). If the transport is HTTP, the ErrorResponseDetail element will also conta in the HTTP error code returned with the response. T he ErrorResponseDetail element in the fault contains error response payload received from the service. Listing 3-12 shows an example of the ErrorResponseDetail element. Listing 3-12 Contents of the Oracle Service Bus fault Variable—Transport Error, with Error Response Payload <ctx:Fault xmlns:ctx=”http://www.bea.com/wli/sb/context”&gt; <ctx:errorC ode>BEA-382502<ctx:errorCode> <ctx:reason> Service callout has received an error response from the server</ctx:reason> <ctx:details> <alsb:ErrorResponseDetail xmlns:alsb=”http://www.oracle.com/…”&gt; <alsb:detail> <! [C DATA[ . . . ]]> </alsb:detail> <alsb:http-response-code>500</alsb:http-response-code> </alsb:ErrorResponseDetail> </ctx:details> <ctx:location>. . .</ctx:location> </ctx:Fault> Note: T he XM L schema for the service callout-generated fault is shown in XM L Schema for the Service C allout-Generated Fault Details. 8.22. SOAP Faults In case an external service returns a SOAP fault, the O racle Service Bus run time sets up the context variable $fault with a custom error code and description with the details of the fault. T o do so, the contents of the 3 elements under the <SOAP- ENV:Fault> element in the SO AP fault are extracted and used to construct an O racle Service Bus fault element. T ake for example a scenario in which a service returns the following error. Listing 3-13 SOAP Fault Returned From Service Callout <SO AP-ENV:Envelope xmlns:SOAP-ENV=”http://schemas.xmlsoap.org/soap/envelope/”&gt; <SO AP-ENV:Body> <SO AP-ENV:Fault> <faultcode>SOAP-ENV:Client</faultcode> <faultstring>Application Error</faultstring> <detail> <message>That’s an Error!</message> <errorcode>1006</errorcode> </detail> </SO A P-ENV:Fault>
  • 22. </SO A P-ENV:Body> </SO A P-ENV:Envelope> T he <faultcode>, <faultstring>, and <detail> elements are extracted and wrapped in an<alsb:ReceivedFault> element. Note that the faultcode element in Listing 3-15 contains a Q Name—any related namespace declarations are preserved. If the transport is HTTP, the ReceivedFault element will also contain the HT TP error code returned with the fault response. T he generated <alsb:ReceivedFault> element, along with the custom error code and the error string are used to construct the contents of the fault context variable, which in this example takes a format similar to that shown in Listing 3- 14. Listing 3-14 Contents of the Oracle Service Bus Fault Variable—SOAP Fault <ctx:Fault xmlns:ctx="http://www.bea.com/wli/sb/context"> <ctx:errorCode>BEA-382500<ctx:errorCode> <ctx:reason> service callout received a soap Fault response</ctx:reason> <ctx:details> <alsb:ReceivedFault xmlns:alsb="http://www.oracle.com/..."> <alsb:faultcode xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">SOAP-ENV:Clien </alsb:faultcode> <alsb:faultstring>Application Error</alsb:faultstring> <alsb:detail> <message>That’s an Error! </message> <errorcode>1006</errorcode> </alsb:detail> <alsb:http-response-code>500</alsb:http-response-code> </alsb:ReceivedFault> </ctx:details> <ctx:location> </ctx:location> </ctx:Fault> Note: T he unique error code BEA-382500 is reserved for the case when service callout actions receive SOAP fault responses. 8.23. Unexpected Responses When a service returns a response message that is not what the proxy service run time expects, a message context fault will be generated and initialized with the custom error code BEA -382501. T he details of the fault include the contents of the SO AP- Body element of the response. If the transport is HTTP, the ReceivedFault element will also contain the HTTP error code returned with the fault response. T he XM L schema definition of the service callout-generated fault details is shown in Listing 3-15. Listing 3-15 XML Schema for the Service C allout-Generated Fault Details <xs:complexType name=”ReceivedFaultDetail”> <xs:sequence> <xs:element name=”faultcode” type=”xs:QName”/> <xs:element name=”faultstring” type=”xs:string”/> <xs:element name=”detail” minO ccurs=”0″ > <xs:complexType> <xs:sequence> <xs:any namespace=”##any” minO ccurs=”0″ maxOccurs=”unbounded” processContents=”lax” /> </xs:sequence> <xs:anyAttribute namespace=”##any” processContents=”lax” /> </xs:complexType> </xs:element> <xs:element name=”http-response-code” type=”xs:int” minOccurs=”0″/> type=”xs:int” minO ccurs=”0″/> </xs:sequence> </xs:complexType> <xs:complexType name=”U nrecognizedResponseDetail”> <xs:sequence> <xs:element name=”detail” minOccurs=”0″ type=”xs:string” /> </xs:sequence> </xs:complexType> <xs:complexType name=”ErrorResponseDetail”> <xs:sequence>
  • 23. <xs:element name=”detail” minOccurs=”0″ type=”xs:string” /> </xs:sequence> </xs:complexType> 8.24. Handling Errors in Message Flows T he process described in the next paragraph constitutes an error handling pipeline for the stage of an error handler. In addition, an error pipeline can be defined for a pipeline (request or response) or for an entire proxy service. T he error handler at the stage level is invoked for handling an error; If the stage -level error handler is not able to handle a given type of error, the pipeline error handler is invoked. If the pipeline -level error handler also fails to handle the error, the service-level error handler is invoked. If the service-level error handler also fails, the error is handled by the system.The following table summarizes the scope of the error handlers at various levels in the message flow. Level Scope Stage Handles all the errors within a stage. P ipeline Handles all the errors in a pipeline, along with any unhandled errors from any stage in a pipeline. Service Handles all the errors in a proxy service, along with any unhandled errors in any pipeline in a service. Note: All WS-Security errors are handled at this level. System Handles all the errors that are not handled any where else in a pipeline. Note: T here are exceptions to the scope of error handlers. For example, an exception thrown by a non -XM L transformation at the stage level is only caught by the service-level error handler. Suppose a transformation occurs that transforms XM L to M FL for an outgoing proxy service response message, it always occurs in the binding layer. T herefore, for example, if a non-XM L output is missing a mandatory field at the stage level, only a service -level error handler can catch this error. For more information on error messages and error handling, see P roxy Services: Error Handlers inUsing the Oracle Service Bus Console. Y ou can handle errors by configuring a test that checks if an assertion is true and use the reply action configured false. Y ou can repeat this test at various levels. A lso you can have an error without an error handler at a lower level and handle it throug h an error handler at an higher level in message flow. In general, it is easier to handle specific errors at a stage level of the message flow and use error handlers at the higher level for more general default processing of errors that are not handled at the lower levels. It is good practice to explicitly handle anticipated errors in the pipelines and allow the service-level handler to handle unanticipated errors. Note: Y ou can only handle WS-Security related errors at the service level. 8.25. Generating the Error Message, Reporting, and Replying A predefined context variable (the fault variable) is used to hold information about any error that occurs during message processing. When an error occurs, this variable is populated with information be fore the appropriate error handler is invoked. T he fault variable is defined only in error handler pipelines and is not set in request and response pipelines, or in route o r branch nodes. For additional information about $fault, see P redefined C ontext V ariables . In the event of errors for request/response type inbound messages, it is often necessary to send a message back to the originator outlining the reason why an error occurred. Y ou can accomplish this by using a Reply with Failure action after configuring the message context variables with the response you want to send. For example, when an HT TP message fails, Reply with Failuregenerates the HTTP 500 status. When a JM S message fails, Reply with Failure sets the JM S_BEA_Error property to true. T he O racle Service Bus error actions are discussed in P roxy Services: Error Handlers in Using the Oracle Service Bus Console. A n error handling pipeline is invoked if a service invoked by a proxy service returns a SOAP fault or transport error. A ny received SOAP fault is stored in $body, so if a Reply with Failure is executed without modifying $body, the original SOAP fault is returned to the client that invoked the service. If a reply action is not configured, the system error handler generates a new SO AP fault message. T he proxy service recognizes that a SOAP fault is returned because a HT TP error status is set, or the JM S property SERVER_Error is set to true. Some use cases require error reporting. Y ou can use the report action in these situations. For example, consider a scenario i n which the request pipeline reports a message for tracking purposes, but the service invoked by the route node fails after the reporting action. In this case, the reporting system logged the message, but there is no guarantee that the message was processed successfully, only that the message was successfully received. Y ou can use the O racle Service Bus Console to track the message to obtain an accurate picture of the message flow. T his allows you to view the original reported message indicating the message was submitted for processing, and also the subsequent reported error indicating that the message was not processed correctly. T o learn how to configure a report action and use the data reported at run time, see P roxy Services: A ctions in Using the Oracle Service Bus Console.
  • 24. 8.26. Example of Action Configuration in Error Handlers T his example shows how you can configure the report and reply actions in error handlers. T he message flow shown in Figure 3- 2 includes an error handler on the validate loan application stage. T he error handler in this case is a simple message flow with a single stage configured—it is represented in the O racle Service Bus C onsole as shown in Figure 3-2. Figure 3-2 Error Handler M essage Flow T he stage is, in turn, configured with actions (replace, report, and reply) as shown in Figure 3-3. Figure 3-3 Actions in Stage Error Handler T he actions control the behavior of the stage in the pipeline error handler as follows:  Replace—T he contents of a specified element of the body variable are replaced with the contents of the fault context variable. T he body variable element is specified by an XP ath expression. T he contents are replaced with the value returned by an XQ uery expression—in this case $fault/ctx:reason/text()  Report— M essages from the reporting action are written to the O racle Service Bus Reporting Data Stream if the error handler configured with this action is invoked. T he JMS Reporting Provider reports the messages on the O racle Service Bus Dashboard. O racle Service Bus provides the capability to deliver message data to one or more reporting providers. M essage data is captured from the body of the message and from any other variables associated with the message, such as header or inbound variables. Y ou can use the message delivered to the reporting provider for functions such as tracking messages or regulatory auditing.  When an error occurs, the contents of the fault context variable are reported. T he key name is errorCode, an d the key value is extracted from the fault variable using the following XP ath expression: ./ctx:errorCode. Key/value pairs are the key identifi ers that identify these messages in the Dashboard at run time.  T o configure a report action and use the data reported at run time, see P roxy Services: A ctions in Using the Oracle Service Bus Console.  Reply— A t run time, an immediate reply is sent to the invoker of the loanGateway3 proxy service (see Figure 3-3) indicating that the message had a fault T he reply is With Failure.  For configuration information, see P roxy Services: Error Handlers in Using the Oracle Service Bus Console.  When you do not know the service you need to invoke from the proxy service you are creating, you can use dynamic routing.  For any given proxy service, you can use one of the following techniques to dynamically route messages:  In a message flow pipeline, design an XQuery expression to dynamically set the fully qualified service name in O racle Service Bus and use the dynamic route or dynamic publish actions.  Note:  Dynamic Routing can be achieved in a route node, whereas dynamic publishing can achieved in a stage i n a request pipeline or a response pipeline.  With this technique, the proxy service dynamically uses the service account of the endpoint business service to send user names and passwords in its outbound requests. For example, if a proxy service is routing a request to Business Service A , then the proxy service uses the service account from Business Service A to send user names and passwords in its outbound request. See Implementing Dynamic Routing.  C onfigure a proxy service to route or publish messages to a business service. T hen, in the request actions section for the ro ute action or publish action, add a Routing O ptions action that dynamically specifies the U RI of a service.  With this technique, to send user names and passwords in its outbound requests, the proxy service uses the service account of the statically defined business service, regardless of the U RI to which the request is actually sent.  For information on how to use this technique, see Implementing Dynamic Routing.  Note:  T his technique is used when the overview of the interface is fixed. T he overview of the interface includes message types, port types, and binding, and excludes the concrete interface. T he concrete interface is the transport U RL at which the service is located.  Implementing Dynamic Routing  Y ou can use dynamic routing to determine the destination during the runtime of a proxy service. T o achieve this you can use a routing table in an XM L file to create an XQ uery resource.  Note:  Instead of using the XQuery resource, you can also directly use the XM L file from which the resource is created.  A n XM L file or the Xquery resource can be maintained easily. A t runtime you provide the entry in the routing table that will determine the routing or publishing destination of the proxy service.T he XM L file or the XQ uery resource contains a routing table, which maps a logical identifier to (such as the name of a company) to the physical identifier (the fully qualified nam e of the service in O racle Service Bus). T he logical identifier, which is extracted from the message, maps on to the physical identifier, which is the name of the service you want to invoke.  Note:  T o use the dynamic route action, you need the fully qualified name of the service in O racle Service Bus.  In a pipeline the logical identifier is obtained with an XP ath into the message.You assign the XM L table in the XQ uery resource to a variable. Y ou implement a query against the variable in the routing table to extract the physical identifier based on th e corresponding logical identifier. U sing this variable you will be able to invoke the required service. T he following sections describe how to implement dynamic routing.
  • 25.  Sample XM L File.  C reating an XQuery Resource From the Sample XML  C reating and C onfiguring the P roxy Service to Implement Dynamic Routing 8.27. Using Dynamic Routing 8.28. Sample XML File Y ou can create an XQuery resource from the following XM L file. Save this as sampleXquery.xml. Listing 3-16 Sample XML File <routing> <row> <logical>Sample</logical> <physical>default/goldservice</physical> </row> <row> <logical>ABC Corp</logical> <physical>default/silverservice</physical> </row> </routing> 8.29. Creating an XQuery Resource From the Sample XML  In an active session, select P roject Explorer from the left navigation panel. T he P roject V iew page is displayed.  Select the project to which you want to add the XQ uery resource.  In the P roject V iew page, select the XQuery resource from the Select Resource Type drop-down list. T he C reate XQuery page is displayed.  In the Resource Name field, enter the name of the resource. T his is a mandatory.  In the Resource Description field, provide the a description for the resource. T his is optional.  In the XQ uery field, provide the path to the XM L you are using as an XQ uery resource. C lick on Browse to locate the file. O ptionally, you can copy and paste the XML in the XQ uery field. T his is mandatory.  Save the XQ uery resource.  A ctivate the session.  In an active session, select P roject Explorer from the left navigation panel. T he P roject V iew page is displayed.  Select the project to which you want to add the proxy service.  In the P roject V iew page, select the P roxy Service resource from the Select Resource T ype drop-down list. T he General C onfiguration page is displayed.  In the Service Name field of the General C onfiguration page, enter the name of the proxy service. T his is mandatory.  Select the type of service by clicking on the button adjacent to various types of services available under Service T ype. For more information on selecting the service type, see P roxy Services: A ctions.  C lick Finish. O n the Summary page, click Save to save the proxy service.  O n the P roject View page, click the Edit M essage Flow icon against the newly created proxy service in the Resource table. T he Edit M essage Flow page is displayed.  C lick on the message flow to add a pipeline pair to the message flow.  C lick on Request P ipeline icon select A dd Stage from the menu.  C lick on the Stage1 icon to and select Edit Stage from the menu. T he Edit Stage C onfiguration page appears.  C lick A dd Action icon. C hoose A dd an A ction item from the menu.  C hoose the A ssign action from M essage P rocessing.  C lick on Expression. T he XQuery Expression Editor is displayed.  C lick on XQ uery Resources. T he browser displays the page where you can import the XQ uery resource. C lick on the Browse to locate the XQuery resource.  C lick on V alidate to validate the imported XQuery resource.  Save the imported XQ uery resource on successful validation.  O n the Edit Stage C onfiguration page, enter the name of the variabl e in the field.  T his assigns the XQuery resource to this variable. T he variable now contains the externalized routing table.  C lick on the A ssign action icon to add another assign action.  Note:  T o do this repeat step 11 to step 13 .  Enter the following Xquery:
  • 26.  <ctx: route> <ctx: service isProxy=’false’> {$routingtable/row[logical/text()=$logicalidentifier]/physical/text()} </ctx: service> </ctx: route>  In the above code, replace $logicalidentifier by the actual XPath to extract the logical identifier from the mes sage (example from $body).  C lick on V alidate to validate the Xquery.  Save the Xquery on successful validation.  O n the Edit Stage C onfiguration page, enter the name of the variable (for example, routeresult) in the field.  T his extracts the XM L used by the dynamic route action into this variable.  C lick on the message flow to add a route node to the end of the message flow.  C lick on the Route Node icon and select Edit from the menu.  C lick the A dd Action icon. C hoose Add an A ction item from the menu.  C hoose the Dynamic Route action.  C lick on Expression. T he XQuery Expression Editor is displayed.  Enter the variable from step 22 (for example, $routeresult)   O racle Service Bus provides read-access to databases from proxy services without requiring you to write a custom EJB or custom Java code and without the need for a separate database product like Oraclce Data Service Integrator. Y ou can use the execute-sql() function to make a simple JDBC call to a database to perform simple database reads. A ny SQL query is legal, from a query that gets a single tax rate for the supplied location to a query that does a complex join to obtain an order’s current status from several underlying database tables.  A database query can be used to get data for message enrichment, for routing decisions, or for customizing the behavior of a proxy service. T ake for example a scenario in which an O racle Service Bus proxy service receives “request for quote” messages. T he proxy service can route the requests based on the customer’s priority to one of a number of quotation business services (say, standard, gold, or platinum level services). T he proxy service can then perform a SQ L-based augmentation of the results that those services return—for example, based on the selected ship method and the weight of the order, the shipping cost can be looked up and that cost added to the request for quote message.  fn-bea:execute-sql() describes the syntax for the function and provides examples of its use. T he execute -sql() function returns typed data and automatically translates values between SQL/JDBC and XQ uery data models.  Y ou can store the returned element in a user-defined variable in an O racle Service Bus message flow.  T he following databases and JDBC drivers are supported using the execute-sql() function:  IBM DB2/NT 8  M icrosoft SQL Server 2000, 2005  O racle 8.1.x  O racle 9.x, 10.x  P ointbase 4.4, 5.x  Sybase 12.5.2 and 12.5.3  WebLogic T ype 4 JDBC drivers  T hird-party drivers supported by WebLogic Server  U se non-XA drivers for datasources you use with the fn-bea:execute-sql() function—the function supports read-only access to the datasources.  WARNING:  In addition to specifying a non-XA JDBC driver class to use to connect to the database, you must ensure that you disable global transactions and two-phase commit. (Global transactions are enabled by default in the WebLogic Server console for JDBC data sources.) T hese specifications can be made for your data source via the WebLogic Server A dministration C onsole. See C reate JDBC Data Sources in the WebLogic Server Administration Console Online Help.  For complete information about database and JDBC drivers support in O racle Service Bus, see Supported Database C onfigurations in Supported Configurations for Oracle Service Bus .  Databases other than the core set described in the preceding listing are also supported. However, for the core databases list ed above, the XQ uery engine does a better recognition and mapping of data types to XQ uery types than it does for the non-core databases—in some cases, a core database’s proprietary JDBC extensions are used when fetching data. For the non -core databases, the XQ uery engine relies totally on the standard type codes provided by the JDBC driver and standard JDBC resultset access methods.  When designing your proxy service, you can enter XQ ueries inline as part of an action definition instead of entering them as resources. Y ou can also use inline XQueries for conditions in If…T hen… actions in message flows. For information about using the inline XQ uery editor, seeCreating Variable Structure M appings.  T he message context is a set of variables that hold message context and information about messages as they are routed through the O racle Service Bus. T ogether, the header, body, and attachments variables, (referenced as $header, $body and $attachments in XQuery statements) represent the message as it flows through O racle Service Bus. T he canonical form of the message is SOAP. Even if the service type is not SOAP, the message appears as SOAP in the O racle Service Bus message context.  In a M essage C ontext, $header contains a SOAP header element and $body contains a SOAP Body element. T he Header and Body elements are qualified by the SOAP 1.1 or SOAP 1.2 namespace depending on the service type of the proxy service. A lso