Professional Documents
Culture Documents
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
Oracle Service Bus 12c: Design
& Integrate Services
Activity Guide
D88521GC10
Edition 1.0 | July 2015 | D92012
Learn more from Oracle University at oracle.com/education/
Author Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
Iris Li Disclaimer
publish, license, post, transmit, or distribute this document in whole or in part without
Greg Fichtenholtz the express authorization of Oracle.
Chad Schoettger
The information contained in this document is subject to change without notice. If you
James Mills find any problems in the document, please report them in writing to: Oracle University,
500 Oracle Parkway, Redwood Shores, California 94065 USA. This document is not
Takyiu Liu warranted to be error-free.
Matthew Slingsby
Restricted Rights Notice
Armando Hernandez
Robert Wunderlich If this documentation is delivered to the United States Government or anyone using
the documentation on behalf of the United States Government, the following notice is
Mike Muller applicable:
ui
license agreement and/or the applicable U.S. Government contract.
Aishwarya Menon a il ฺ
Trademark Notice
tm ent G
Nikita Abraham
h o d its affiliates. Other names
@ t uand/or
Oracle and Java are registered trademarks of Oracle
5 S
7
may be trademarks of their respective owners.
Graphic Designer
r z a m
e t his
Kavya Bellur
e s to o us
o (n se t
ran licen
Publishers
Michael Sebastian b
Z am rable
Jayanthy Keshavamurthy
s t or sfe
Jobi Varghese
Ne -tran
non
Table of Contents
Course Practice Environment: Security Credentials ....................................................................................I-1
Course Practice Environment: Security Credentials.......................................................................................I-2
Practices for Lesson 1: Introduction ..............................................................................................................1-1
Practices for Lesson 1....................................................................................................................................1-2
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ
c o m deฺ
Practice 4-2: Creating a new pipeline using a pipeline template ....................................................................4-10
a il ฺ
G
Practice 4-3: Debugging a Service Bus Application in JDeveloper ................................................................4-21 ui
h otm dent
Practices for Lesson 5: Validating Messages and Error Handling ..............................................................5-1
5 @ Stu
Practices for Lesson 5: Overview ...................................................................................................................5-2
7
Practice 5-1: Importing Template Resources and Creatingm
r z a ausing this ............................................5-3
Business Service
e
e s to..........................................................................................6-1
Practice 5-2: Creating the pipeline that validates messages
o us
the Pipeline Template .............................5-8
Practices for Lesson 6: Transforming Messages
( n t
a n o e n se
Practices for Lesson 6: Overview ...................................................................................................................6-2
r using XQuery
bFile
Practice 6-1: Transforming Data c Transformation.....................................................................6-3
liProxy
m
Practice 6-2: Configuring
Z a l e
a nXSDraTransformation
b
Adapter with nXSD Transformation....................................................6-21
t o r
Appendix: Building the
f e from the Beginning .................................................................6-32
esfor Lesson
Practices
a s
n7: Routing Messages ...................................................................................................7-1
N t r
for-Lesson 7: Overview ...................................................................................................................7-2
Practices n
no7-1: Static Routing Messages using Conditional Branching .............................................................7-3
Practice
Practice 7-2: Dynamic Routing Messages using XQuery-based Policy .........................................................7-10
Practices for Lesson 8: Enriching Messages ................................................................................................8-1
Practices for Lesson 8: Overview ...................................................................................................................8-2
Practice 8-1: Enriching the Message by Calling a Pipeline Service (Session ID Generation) ........................8-3
Practice 8-2: Enriching the Message by Calling a Business Service (ValidateCreditCard) ............................8-17
Practices for Lesson 9: Processing Messages with Concurrent Calls .......................................................9-1
Practices for Lesson 9: Overview ...................................................................................................................9-2
Practice 9-1: Processing Messages with Static Split-Join ..............................................................................9-3
Practices for Lesson 10: Adapters and Transports ......................................................................................10-1
Practices for Lesson 10: Overview .................................................................................................................10-2
Practice 10-1: Calling a SOA Service using SOA-Direct Protocol ..................................................................10-3
Practice 10-2: Exposing a SOAP Service as a REST Service .......................................................................10-9
Practices for Lesson 11: Reliable Messaging................................................................................................11-1
Practices for Lesson 11..................................................................................................................................11-2
Oracle Service Bus 12c: Design & Integrate Services Table of Contents
iii
Practices for Lesson 12: Service Bus Security .............................................................................................12-1
Practices for Lesson 12: Overview .................................................................................................................12-2
Practice 12-1: Configuring the Security Environment .....................................................................................12-3
Practice 12-2: Securing Back-end Web Service and Attaching Security Policy to Business Service .............12-9
Practice 12-3: Applying a Security Policy to Proxy Service ............................................................................12-14
Practices for Lesson 13: Advanced Topics ...................................................................................................13-1
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
Oracle Service Bus 12c: Design & Integrate Services Table of Contents
iv
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ
s a
) h a
c o m d e ฺ
a il ฺ u i
Course Practice
m t G
h ot den
Environment:
5@ s StuSecurity
7
r z am e thi
Credentials
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
For product-specific credentials used in this course, refer to the following table:
Product-Specific Credentials
User Type Username Password
WebLogic Server administrator weblogic welcome1
WebLogic Server user that is joe s welcome1
a
authenticated by WLS default ) h a
authenticator c o m d e ฺ
a il ฺ u i
m t G
` h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
s a
) h a
c o m d e ฺ
a il ฺ u i
Practices for m t G
h ot Lesson
d e n 1:
5@ s Stu
Introduction
7
r z am e1 thi
Chapter
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
General Notes
There are no notes.
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
s a
) h a
c o m d e ฺ
a il ฺ u i
Practices form t G
h ot Lesson
d e n 2:
Introducing
7 tu
5@ s SOracle Service
r z am e thi
Bus
es to Chapter
o us2
( n t
a n o e n se
m br le lic
Z a rab
r
e sto ansfe
N -tr
non
In JDeveloper, the WebLogic Integrated Server is preconfigured with the preceding SOA Suite
runtime components and JavaDB. JavaDB is a development database that allows you to start
development with SOA Suite without the need to run the repository creation utility (RCU).
Your lab machine is preinstalled with the Quick Start distribution. In this lesson’s practices, you
will configure the Integrated WebLogic Server default domain.
Your environment looks like the following on the host server when you have finished:
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
In this practice, you will launch JDeveloper and configure the Integrated WebLogic Server's
default domain in JDeveloper.
Tasks
1. Setup
a. For Quick Start distribution, all software is installed in the single middleware home
directory: /u01/app/oracle/fmw_dev/12.1.3.0
An environment variable is set to this home directory. To verify, open a terminal
window, and enter the following command: a
>echo $FMW_DEV_HOME
h a s
You should see the above home directory in the output. )
m deฺ
c o
il ฺ ui
Note: For this course, $FMW_DEV_HOME serves as $ORACLE_HOME, where your
a G
Oracle Fusion Middleware products are installed.
h otm dent
5@ s Stu
b. Increase JDeveloper PermMemory size.
7
1) In a terminal window, enter the following commands:
r z am e thi
cd $FMW_DEV_HOME/jdeveloper/jdev/bin/
e s to o us
(n se t
gedit jdev.conf
o
2) In gedit editor, locate the following entry:
b ran licen
AddVMOptionHotspot -XX:MaxPermSize=320M
am rable
3) Modify the MaxPermSize value to 512M.
Z
s t or sfe
AddVMOptionHotspot -XX:MaxPermSize=512M
Ne 4) -Save
t r anyour edit and close gedit.
n Increasing the memory size can help avoid “low memory” warning or “out of
noNote:
memory” error that you might encounter while developing and deploying projects.
c. Set the JDEV_USER_DIR environment variable to define the location of the default
domain. This will also determine where to save new applications created in Oracle
JDeveloper.
Open a terminal window, and enter the following commands:
>export JDEV_USER_DIR=$HOME/domains/DefaultDomain
Note: If you do not set JDEV_USER_DIR, the domain is created at the following
default location:
$HOME/.jdeveloper/system12.1.3.x.x.x.xxxx/DefaultDomain
b. When prompted for role, select Studio Developer as your role, deselect the “Always
prompt for role selection on startup” option, and click OK.
c. When prompted, say No to import preferences from a previous JDeveloper installation.
d. When prompted about Oracle Usage Tracking, check whether or not you want Oracle
JDeveloper to send automated usage reports to Oracle, and then press OK.
JDeveloper has fully launched at this point.
3. Create a desktop shortcut for JDeveloper.
a. Right click at a blank location on your desktop, and select Create Launcher.
b. In the Create Launcher dialog box, select Application in Terminal as the Type.
c. Enter JDeveloper as the name. s a
) h a
Note that this name appears as the caption for the desktop icon.
c o m deฺ
d. In the Command field text area, enter:
a i l ฺ u i
G
gnome-terminal --title "Start JDev" -e
"/home/oracle/labs_DI/resources/Scripts/startjdev.sh" h otm dent
e. In the Create Launcher dialog box, click OK.75
@ Stu
This should have created a "JDeveloper"
r z amiconeonththeisdesktop
4. Creating Default Domain and launching
e s to theoIntegrated
us WebLogic Server
a. From the main menu under n
( JDeveloper, t
e select Window > Application Servers.
b. In the Applicationra n o
Servers view, n s
e expand the Application Servers node, and you should
b l i cintegrated
see a domain
image: Za
m ble
unconfigured WebLogic server, as shown in the following
t o r f e ra
s s
Ne -tran
non
c. Right-click the IntegratedWeblogicServer node, and from the context menu, select
Create Default Domain.
d. In the Create Default Domain wizard, on the Configuration tab page, retain the default
Administrator ID, refer to “Course Practice Environment: Security Credentials” for the
password, and accept the defaults for all other fields. Click OK.
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
7 5@ s Stu
e. The domain creation process startsrand z thi minutes.
aitmtakeseseveral
s o us window pane. This window should
in tthe Messages
You can monitor the progress
n e t o
automatically open at the(bottom ofethe JDeveloper screen. If it is not there, you can
open it by selecting
r a o >eLog
nWindow c ns from the main menu.
f. When you seem l e li messages appear in the log, the default domain has been
bthe following
a rab
t o r Zsuccessfully.
created
f e
s s
Ne -tran
non
5. In the Application Servers view, right-click the IntegratedWeblogicServer node, and from
the context menu, select Start Server Instance. This will take a few minutes. You should
see an “SOA Platform is running and accepting requests” message in the Running:
IntegratedWebLogicServer–Log window.
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
7 5@ s Stu
r z am e thi
e s to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
on
c.n You can expand SOA > service-bus and SOA > soa-infra > default. At this point, both
folders are empty.
s a
) h a
c o m deฺ
a il ฺ
G ui
otmLesson
Practices for e n t 3:
Getting @ h
Started
t udwith Service
5 S
7Applications
r zBus
a m
e this
es to Chapter
o us3
( n t
a n o e n se
m br le lic
Z a rab
r
e sto ansfe
N -tr
non
In these practices, you create a virtualized end-point for an existing SOAP style service. In
addition, you learn how to build a team development environment by using MDS.
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
WebLogic server, and then initiate and test an instance in the Enterprise Manager Fusion
Middleware Control (EM) console. This ValidatePayment will be used as the underlying service
throughout the rest of the labs.
Assumption
The integrated WebLogic Server is up and running.
Tasks
High-level steps:
• Deploying the ValidatePayment composite application using a command s a
• Testing and examining the deployed composite ) h a
c o m deฺ
Deploying the composite a il ฺ
G ui
1. In a terminal window, enter the following commands:
h otm dent
>cd $HOME/labs_DI/lessons/lesson035@
7 S tu
>ls –l
r z am e this
e s to o us
>$HOME/labs_DI/resources/Scripts/deploy.sh
(n swill
sca_ValidatePayment_rev1.0.jar
e t
2. The build and deployment
a o n
n andcedeploying
information be displayed in the console. You should see a
r
b le li
message showing both build executed successfully.
m
a rthe
Testing and o r Z
examining
f e abdeployed composite
t
es transcomposite, all available credit cards are stored in the database, including
For ValidatePayment
N
n o n- card number, expiry date, card name, and daily limit.
payment type,
The validation process includes three steps:
1) First, the payment information is retrieved from the database, using the credit card
number quoted in the order message as the key. If there is no data available with this
credit card number, payment is denied.
2) If data for the credit card number is available, the expiry date in the database record is
compared to the expiry date listed in the order message. If they are not the same, the
payment is also denied.
3) The last check compares whether the total order amount is less than the daily limit on
the credit card in the database.
If all tests are successful, the payment is authorized. Otherwise it is denied.
3. Examine the SOA composite application.
a. Go to the Fusion Middleware Control console:
http://localhost:7101/em
b. In the Target Navigation panel, expand SOA > soa-infra > default. Now you should see
the deployed ValidatePayment [1.0] composite application.
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
7 5@ s Stu
z a m thi
o r
Here you can see that the implementation
t e service uses a BPEL process to
ofsthis
u
receive the incoming payment s
e information,
toin retrieve the credit card data from the
(ntests e
r a n cens
database, and performothe outlined step two.
m b le li
a
t o r Z ferab
s s
Ne -tran
non
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
b. Make sure that the Request tab is selected and scroll down to the Input Arguments
section.
To enter XML payload data, you have the option of selecting Tree View (default) or
XML View.
• Tree View: Displays a graphical interface of text fields in which to enter
information.
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
7 5@ s Stu
r z am e thi
es to o us
o (n se t
c. Select XML View. n should
raYou n the web service invocation payload in XML format.
cesee
b l i
measilybcopy-and-paste
Tip: You a
Z can
a le your data into the XML View.
d. To
s t r the Test
oload s f ermessage, click “Browse” next to the Load Payload field, and select the
Ne thorized.xml
- t r an message.
/home/oracle/labs_DI/resources/sample_input/PaymentInfoSample_Au
n
noThis message already includes the SOAP envelope needed for the web service test.
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
7 @ Sthe
e. Click Test Web Service. When the composite completes,
5(similar tuscreen switches to the
Response tab and the returned value is shown
a m t h is to the screenshot below).
s t orz use
( n e to
no cens e
r a
b le li
a m
t o r Z ferab
s s
Ne -tran
non
f. Review the response message, and you should see that the payment status is
Authorized.
Note: You can also switch to Tree View to view the result.
service to handle higher volumes of requests and provide resiliency for the service, if it needs to
be taken down for routine maintenance.
Start by creating a business service to register the composite URI. Then, add a simple pipeline
and proxy. Pipelines can contain actions performed on the Service Bus; typically reporting, data
transformation, and validation; before invoking the backend service. Consumers of the
validatePayment service will invoke via a proxy rather than connect directly to the
composite, allowing more agility and flexibility in managing change.
After completing this practice, the Service Bus application will look like the following screenshot:
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
e s to o us
o (n se t
b ran licen
High-Level Steps Z am rable
s
In this lab, t or accomplish
you s fe the following tasks:
e
N• Create n
traa new Service Bus application and project.
n -
• noDefine a folder structure for the Service Bus project.
• Create a business service to call the endpoint web service (SOAP-based),
ValidatePayment, and review its properties.
• Generate a simple pass-through proxy service.
• Test and debug the end-to-end application.
Assumptions
ValidatePayment [1.0] has been deployed and is running on the SOA server.
Tasks
d. Under Items, select Service Bus Application with Service Bus Project
e. Click OK.
The Create Service Bus Application with Service Bus Project dialog box opens.
f. Specify the application name to PaymentValidationServiceBusApp.
g. Enter /home/oracle/labs_DI/lessons/lesson03/
PaymentValidationServiceBusApp for the directory.
h. Click Next.
You are prompted to create a new project.
i. Set the project name to PaymentValidation
s a
j. Click Finish.
) h a
c o m d e ฺ
Now your Project Explorer should look like the image below, showing Service Bus
il ฺ u i
application and Service Bus project. The project folder contains two files: pom.xml and
a
m t G
project overview file. h ot den
PaymentValidation. PaymentValidation, with the same name as your project, is called
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
2.
non
Double-click the project overview file, PaymentValidation.
The Services Bus Overview Editor opens on the right.
Note: The Overview Editor is a new view for Service Bus in 12c, and it is modeled on the
SOA Composite Editor. This view allows construction of Service Bus projects using a top-
down, drag-and-drop approach.
3. Take a few moments to browse the Applications pane on the left side of the window and the
component palette on the right.
• In the component palette, notice that the resources category contains pipeline and
Split-Join icons. These are the components for a Service Bus application.
Note: In 12c, the pipeline has been split from the proxy to allow it to be a re-usable
component.
• Other palette categories—Technology, Applications, and Advanced—contain adapters
and transports for building business services (External References) and proxies
(Exposed Services).
applications, you are encouraged to create folders that align with the default folders in the
composite application. Folders will not be automatically created in Service Bus applications, so
that backward compatibility of Service Bus projects imported from previous releases is
maintained.
For this practice, you keep the structure simple, because there are only a few artifacts to
manage. As the projects grow, you can add folders for categorizing artifacts into business
service, proxy, and templates.
4. Create two folders.
a. Right-click the PaymentValidation project folder, and select New > From Gallery.
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
s a
5. Import Artifacts. This step is to register the WSDL for the ValidatePayment service
) a
h that you
will abstract with the business service.
c o m deฺ
a. Right-click the WSDLs folder in the Project Explorer, and selecta ฺ ui the
il ImportGfrom
context menu.
h otm dent
The Import dialog box is displayed.
7 5@ s Stu
b. Select Service Bus Resources.
r z am e thi
e s to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
c. Click OK.
The Import Service Bus resources wizard is displayed. The title bar of the wizard dialog box
shows the step number.
d. Complete the steps in the wizard by following the instructions in the table below:
Step Page Choices or Values
Description
1) Type Select resources from URL.
Click Next.
2) Source Click the Browse icon next to the Source URL field.
In the Select WSDL dialog box, select File System in the top box,
navigate to the /home/oracle/labs_DI/resources/WSDLs folder,
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
Click Next.
3) Configuration Accept the default.
Make sure that you see the Schemas folder at the same level as the
WSDLs folder containing CanonicalOrder.xsd. This directory structure is
required to successfully import the WSDL.
Click Finish. s a
) h a
The Applications pane resembles the following:
c o m deฺ
il
Service Bus supports the ability to import and export artifacts and projects
a ฺ i
at aufine-grain
level. You may import artifacts individually, such as a WSDLtor mschema, n G
tor whole projects.
You may control whether dependencies are included. ho e
5 @ S t ud to import all
m 7
By default, when importing individual artifacts, Service Bus will attempt
is includes a schema, the
a
dependencies declared in the artifact. For example, if tahWSDL
r z e
to areorelative.
schema will also be imported if the paths
e s t us
o n
Also note that you can control(whether
s
environmental
e settings, security policies, and
credentials are preserved
r a non import.
c e n For example, if you are bringing artifacts from a
production environment
m li and editing, you may not want all the same policies
b forletesting
applied in the a
r Z ferab
development environment.
t o sand Schema files
N es WSDL
Inspecting
r a n
n -t the ValidatePayment-concrete.wsdl file in the WSDLs folder. The
6. Double-click
o
n editor opens and presents the design view of the WSDL document.
WSDL
In this graphical overview of the WSDL file, you can explore the structure and relationship
of the elements.
7. You should see the contents of Port Types, Bindings / Partner Link Types and Services.
The WSDL document contains the portType element, a set of operations (in this case, an
operation named validate), and the abstract messages (input and output) involved with
those operations. Click the “Show Contents” icon on the Message tag.
s
Message part can be seen to represent a parameter in the operation request or response. a
A message can consist of multiple parts. ) h a
c o m d e ฺ
Note: In general, it is recommended to stick with single-part messages because they are
a il ฺ u i
m t G
less complex and less likely to have you run into tool limitations.
ot den
9. Click the Source tab at the bottom of the WSDL editor. The source view of the WSDL
h
document presents.
7 5@ s Stu
r z am e thi
Note that the WSDL has both binding and service definition.
es to o us
10. Locate the <types> section. The type definitions can contain XSD-style elements or import
o (n se t
one or more external XSD documents. In this case, the WSDL document imports message
definitions using an external XSD document, CanonicalOrder.xsd.
b ran licen
Z am rable
s t or sfe
Ne -tran
non
Or
b. Double-click the file in the project’s Schemas folder:
12. The XSD editor opens and presents the design view of the XSD document. You can view
the UML class model and entity relationship.
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
Note that the WSDLs of ValidatePayment composite only contain the elements
PaymentInfo and PaymentStatus to define data structure.
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
7 5@ s Stu
r z am e thi
e s to o us
o (n se t
b ran licen
Z am rable
s t or sfe
e tran
NNote:
n o nIn-the previous practice, the test file
(PaymentInfoSample_Authorized_soap.xml) contained one PaymentInfo element.
14. Click the Source tab at the bottom of the XSD editor to view the source code of the XSD
document.
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
7 5@ s Stu
r z am e thi
e s to service
Upon dropping, the Create business o uswizard pops up.
n
(for business t
a n o
b. Enter the required details
e n se by following the instructions in the table below:
m br le lic
Step Window/Page Choices or Values
a
Z erab
Description
o r
e t sf Service Name the service PaymentValidationBS.
s 1) aCreate
n
N -tr Click Next.
o n
n 2) Type 1) Select WSDL for Service Type.
2) Click the Browse WSDLs icon to the right of the WSDL
choice.
3) In the Select WSDL dialog box, click Application, navigate
and select ValidatePayment-concrete.wsdl as shown
below:
6) Click Next.
3) Transport Verify that http is selected in the Transport field.
The Endpoint URI is populated as:
http://localhost:7101/soa-
infra/services/default/ValidatePayment/validatepaymentprocess_clie
nt_ep
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
By default, a sample payload will be generated for you; however, you will test it with a
specific file.
b. Click the Choose File button.
c. Navigate to /home/oracle/labs_DI/resources/sample_input/, and select
PaymentInfoSample_Authorized.xml
d. Click Open.
e. On the Test Console, click the Execute button.
The next screen, in the Response Document section, indicates that the payment has
been authorized.
Click Next.
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
Now you should see proxy and pipeline components in the Service Bus Overview Editor
and their files (PaymentValidationPS.proxy, PaymentValidationPP.pipeline) added in the
project folder.
18. To wire the pipeline to invoke the business service, select PaymentValidationPP and
drag the arrow to PaymentValidationBS.
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
You can add some actions to the pipeline, such as validation, transformation and so on.
These will be covered in the subsequent labs.
20. Save your work.
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
s a
) h a
c o m deฺ
a il ฺ
G ui
d. Click the Launch Test Console button next to the proxy h tm ent
oservice.
The Test Console opens. 5 @ S t ud
7
e. Click Browse button next to the Payload
r z a m
field.
e this
The File Upload window opens. to
n e s to us
f. Select File System, navigate
o ( to /home/oracle/labs_DI/resources/sample_input/,
s e but this
time, for payload, use n n
the PaymentInfoSample_Denied.xml
ctheeExecute button. file in the folder.
g. On the Testm bra lclick
Console, e l i
Z ascreenrinathe
b
t o rdenied.fe
The next Response Document section indicates that the payment has
s an
been s
Nh. e Close
- trthe test console window.
n
no the endpoint URI
23. Verify
a. In Service Bus console, select PaymentValidationPS, click Transport tab on the Proxy
Service Definition page.
The Endpoint URI is what service consumers will use to access your
PaymentValidation service.
b. To verify:
1) Copy Endpoint URI on the page.
2) Open another tab in Firefox browser, and type the following in the URL:
http://localhost:7101/<paste_Endpoint_URI_here>?wsdl
The wsdl of the PaymentValidationPS proxy service is displayed.
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
3. In the IDE Connections panel, expand SOA-MDS. You should see the automatically
s a
created (when creating a SOA composite) connection named
) h a
c o m d e ฺ
SOA_DesignTimeRepository and the /apps folder in the repository. At this point, the
folder is empty.
a il ฺ u i
m t G
4.
ot den
Right-click the SOA_DesignTimeRepository connection, and select Properties.
h
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
7 5@ s Stu
r z am e thi
e s to o us
o (n se t
r a n cen
The default SOA-MDSm b li name is SOA_DesignTimeRepository. The default
connection
l e
a b
t o r Z folder
repository root
f e risa/home/oracle/labs_DI/lessons/soamds/.
5. ClicksBrowse.nThe
e folder a s Choose Directory dialog box is displayed. You can see that there is an
Napps - t r in the default repository root folder. This folder is automatically created.
n
noconnection name cannot be changed, but the default repository location can be
The
modified to point to another folder or source control location.
Leave this dialog box open; you will use it shortly.
>cd $HOME/labs_DI/resources/
>cp –r Schemas/ WSDLs/ $HOME/labs_DI/apps/PaymentValidation/
7. Go back to JDeveloper and, in the Choose Directory dialog box that you opened earlier,
select $HOME/labs_DI folder, and click OK.
8. The Resources window is updated with the new MDS repository content and the artifacts
from the resource folder.
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
7 5@ s Stu
r z am e thi
9. To verify:
e s to o us
n sethet WSDLs folder, and select Import from the
a. In Application Navigator, (right-click
o
context menu. ran
b l i c en
The Import m boxle
Z a dialogBus
a b is displayed.
s t or sfer
b. Select Service Resources.
Ne -tran
non
c. Click OK.
The Import Service Bus resources wizard is displayed. The title bar of the wizard dialog
box shows the step number.
d. For Type, select Resources from URL, and click Next.
e. For Source, click the browse button next to the Source URL field.
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
7 5@ s Stu
r z am into
You should see the artifacts that you copied
e thiMDS Repository.
the
to asoyou
g. Click Cancel for all the open windows
e s usalready selected File System as the
source of the WSDL files. n
( t
10. When you are done, close
a n o n se and all open windows of this project.
the application
e
m br le lic
Z a rab
r
e sto ansfe
N -tr
non
s a
) h a
c o m d e ฺ
a il ฺ u i
Practices for m t G
h ot Lesson
d e n 4:
Basics
7 5@ S tu
of Message Flow
r z am e4 this
Chapter
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
other projects. In these practices, you will create a log pipeline template, and use it to implement
a concrete pipeline.
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
Tasks
1. Open JDeveloper if it is not open. (You can use the JDeveloper shortcut on the desktop.)
2. In the Applications pane, click Open Application (or you can select File > Open).
s a
) h a
c o m deฺ
a il ฺ
G ui
3. In the Open Application(s) dialog box, navigate to the
h o tm ent
@
~/labs_DI/lessons/lesson04/PaymentValidation_Log_ServiceBusApp/
5 S t ud
7 is
directory, and open the PaymentValidation_Log_ServiceBusApp.jws
m file.
a t h
4.
orz andusyou
Expand the folders in Application Navigator,
resembling the image below: s t e should see the folder structure
( n e to
no cens e
r a
b le li
a m
t o r Z ferab
s s
Ne -tran
non
To save your time, the application and project are pre-created and artifacts are imported
into the folders for you.
s a
) h a
c o m deฺ
a il ฺ
G ui
oalltm e n t
You have to choose this option as you are going to create
@ h t u d
of your Proxy Services based
on a WSDL. 7 5 s S
9. Click Finish and verify that a new pipeline m
a et
template h
has
i
been created and is opened as a
o r z
separate tab as shown below.
n est to us
o ( se
a n e n
m br le lic
Z a rab
r
e sto ansfe
N -tr
non
a. Drag Pipeline Pair from the Nodes section in the Components palette and drop it onto
the yellow circle below the Start node in the template editor.
Note: Yellow circles appear indicating valid places to drop the component in the
pipeline.
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
7 5@ s Stu
r z am e thi
e s to o us
o (n se t
b ran licen
Z am rable
s t
You orshouldssee
fe the Pipeline Pair node being added to the start node as shown below.
e n
tra and Pair
N The-Pipeline comprises of a Request Pipeline and a Response Pipeline. The
no n
Request Response pipelines have stages that can contain action nodes.
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
Note: When you add components to the editor, 7 5@ tu
icons areSdisplayed on the editor to
a
represent the components. The relationshipsm among
t h i s
the components are shown with
lines and bounding boxes r z
to o us e
e s t
o (n Log s e
b. Add the Log action by
r a n dragging
c e n activity from the Reporting section and dropping it
into Stage 1 onbthe Request
m l e li Pipeline.
a
t o r Z ferab
s s
Ne -tran
non
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
7 5@ s Stu
r z am e thi
e s to o us
o (n se t
11. Add a Stages template r n cenThe placeholders allow people to customize the
aplaceholder.
m b
pipeline to do additional e
work
i as transformations and message enrichment while
lsuch
a b l
t o r Zconcrete
creating the
f e rapipeline.
a. sDrag Stagesnsthefromyellow
Ne drop-titraonto
the Template Placeholders section in the Components palette and
circle above the Stage 1 node in the Request Pipeline.
n o n
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
7 5@ s Stu
r z am e thi
e s to o us
o (n se t
Routing node always
b randepictsl i c ethen end of the message flow and you cannot place any
Z amActions
other activities
r a b lenode.
after this
t o r
b. Observe the
f e placeholder, which allows you to place any type of activity while
esdesigning
a s
nmessage flow for your concrete pipelines.
N
13. Save n t r
- project.
your
nothis, you are done with pipeline template and can proceed with creation of pipelines
With
using this template.
Tasks
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ
• 3) In 7
the
@ WSDL
5Select S tudialog box, click Application,
m
a et
navigate and h i
select
s
ValidatePayment-concrete.wsdl, as
o r z
n est to us
shown below:
o ( se
a n e n
m br le lic
Z a rab
r
e sto ansfe
N -tr
non
• 4) Click OK.
• 5) Back in the Create Business Service window, you
should see the WSDL and port fields populated with the
information based on the WSDL you chose.
• 6) Click Next.
3) Transport Verify that http is selected in the Transport field.
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
e. ClickrOK Z atom a b le
r Create Pipeline Service window, and click Next.
go back to
t o
s ascreen, s f e
Nf. e 1)In Type
t r n use the same WSDL of the business service for the pipeline service:
-Select service type WSDL.
no2)n Click the Browse WSDLs icon on the right.
3) The Select WSDL dialog box pops up.
4) Navigate to Application > PaymentValidation_Log > WSDLs directory, and
select ValidatePayment-concrete.wsdl.
5) Click OK.
Back in the wizard, you should see the fields populated with the WSDL file and
port.
6) Keep "Expose as a Proxy Service" checked for creating Proxy Service along with
pipeline.
7) Change the Proxy Service name to PaymentValidation_LogPS.
8) Change the Proxy Location to
~/labs_DI/lessons/lesson04/PaymentValidation_Log_ServiceBusApp/
PaymentValidation_Log.
s a
) h a
c o m deฺ
a il ฺ
G ui
9) Click Finish.
h otm dent
@ Stu
The pipeline editor is opened in a separate tab5window.
7
g. Verify both pipeline and Proxy Service a are s Explorer.
mshowntinhiProject
r z e
to Thisoallindicates
Notice that the background is grey. s that you are working with a pipeline
e
derived from a template, which s t
inherits
u
placeholders, names, and properties from
the pipeline template. o
n seDesigner
The( Template has made some items editable and
others not.
b ran licen
Z am rable
s t odor the following
Edit the pipeline
s fe to the message in the pipeline:
Youe will n
N• Add-tanraassign action to define a variable.
on
• n Use the log action to log the request payload.
• Route the message to the business service.
3. Add an Assign action.
When a pipeline template defines a template placeholder of a particular type, a concrete
pipeline can add zero or more nodes of the same type to the template placeholder. So here
you can add stage node in this concrete pipeline because you have defined a couple of
template placeholders for stages while creating the template. Each stage can, in turn,
contain actions.
To add Assign action, you first need to add a stage to the stage placeholder:
a. Drag a Stage node and drop it onto the Your Request Stages placeholder.
You should see a stage node where the name Stage2 appears. This stage can contain
actions.
s a
) h a
c o m deฺ
a il ฺ
G ui
m ent
otneed
Note: Notice the red flags–these indicate areas thath still dto be filled in to have a
5 @ t u
m 7out. is S So it will help you keep
valid Pipeline. Service Bus has strong design-time validation.
rza use th
track of when the Pipeline is completely filled
c. Assign the total order amount to taovariable
(
1) Click the Assign action. n es to
a n o ewindow,
n se click the XQuery Expression Builder icon to
launch m
r Expression
2) In the Assign-Properties
thebXQuery lic
Z a rab l e Builder window.
s t or sfe
Ne -tran
non
Note: If the Property inspector is not visible, you can make it appear by going to
the main menu and selecting Windows->Properties. The window should appear,
usually at the bottom right corner. Move to the bottom centre of your screen for
easiest access.
3) In the Variables tree, navigate to body > validate > $body – request >
PaymentInfo, select AuthorizationAmount.
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
7 5@ s Stu
r z am e thi
es to o us
o (n se t
ran XQuery n
ceExpression
5) Click OK to
m b close
e l i Builder window
a l
ab - Properties window, enter AuthAmount as the variable name.
t o r Z in the
6) Back
f e rAssign
s s
Ne -tran
non
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
e s to o us
o (n se t
b ran licen
Z am rable
r OKftoe close XQuery Expression Builder window.
4)toClick
s n sthe Log-Properties window, select Warning for Severity.
Ne 5) -Back
t r a in
n o n
s a
) h a
c o m deฺ
a il ฺ
G ui
b. Click Routing. In the Routing Properties window, select
h tm ent
oPaymentValidation_LogBS for
service. @ t u d
m 75 is S
r z a e th
o
st to us
( n e
a n o e n se
m br le lic
Z a rab
r
e sto ansfe
N -tr
non
http://localhost:7101/sbconsole
Once logged in, Service Bus Control is displayed with all projects, folders, and
resources in the Project Navigator in a tree view on the left.
b. In the Project Navigator, select PaymentValidation_Log to view the project definition on
the right.
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
c. Click the Launch Test Console button (green arrow) next to the proxy service.
The Test Console opens.
d. Click Browse button next to the Payload field.
The File Upload window opens.
e. Select File System, navigate to
/home/oracle/labs_DI/resources/sample_input/, and select
PaymentInfoSample_Authorized.xml
f. Click Open.
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
e s to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
on
k.n Once you are done, stop the tail command (ctrl-c).
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
e s to o us
o (n se t
b ran licen
Z am rable
s t
Youorshouldsbefeable to see the payload in the log file.
Ne Tip:-tUse
r ana key word search to find the information quickly.
non
Tasks
1. Start debugging.
a. In the JDeveloper window, open the PaymentValidation_Log’s pipeline in editor.
b. Right-click the Assign action icon and select Toggle Breakpoint.
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
e s to o us
(n right-click
e t
a o
c. In application Overview Editor,
n cen s the Proxy Service, and select Debug.
r
b le li
a m
t o r Z ferab
s s
Ne -tran
non
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
b. Expand $body > $PaymentInfo (by clicking the small plus icon in the Name column),
examine the incoming values of the request.
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
e s to o us
o (n se t
b ran licen
Z am rable
c. On t r JDeveloper
othe fe main menu toolbar, click Step Over or press F8.
e s n s
N -tra
non
Note that the breakpoint moves to Stage 1.
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5 @ Stu
e. In the Data tab, navigate back to the rootm
a level.eYou is your defined variable
thsee
$AuthAmount appear in the list. r z
to o us
e s
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
s a
c. Enter 2000 in the Modify Value dialog that appears.
) h a
d. Click OK.
c o m d e ฺ
il ฺ
You see that the value of $AuthorizationAmount is updated to 2000.
a u i
m t G
4. ot den
Go directly to the end of message flow (by using F9) or click the Resume button on the
h
main menu bar.
7 5@ s Stu
r z am e thi
e s to o us
(nsee thate t
5. Go to Test Console, youn
a o
should
e n s the status returned is Denied as opposed to
Authorized. r
b le li c
a m
t o r Z ferab
s s
Ne -tran
non
6. On completion of debugging, on the JDeveloper menu toolbar, click the Terminate icon, and
select the project’s debugger process.
s a
) h a
c o m d e ฺ
8.
a il ฺ
When you are done, close the application and all open windows of the project
u i
in
JDeveloper.
m t G
h ot den
7 5@ s Stu
r z am e thi
e s to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
s a
) h a
c o m d e ฺ
a il ฺ u i
Practices for m t G
h ot Lesson
d e n 5:
Validating
7 S tu
5@ sMessages and
r zError thi
am eHandling
es to Chapter
o us5
( n t
a n o e n se
m br le lic
Z a rab
r
e sto ansfe
N -tr
non
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
7 5@ s Stu
r z am e thi
e s to o us
o (n se t
b ran licen
Z amsupports
a b e ability to import and export artifacts and projects at a
lthe
Service
s t
fine-grain
Bus
or level. s f erYou may import artifacts individually, such as a WSDL or schema, or
Ne whole
- t r an You may control whether dependencies are included or not.
projects.
noByndefault, when importing individual artifacts, Service Bus will attempt to import all
dependencies declared in the artifact. For example, if a WSDL includes a schema, the
schema will also be imported if the paths are relative.
Also note that you can control whether environmental settings, security policies, and
credentials are preserved on import. If you are bringing artifacts from a production
environment for testing and editing, you may not want all the same policies applied in
the development environment, for example.
You will accept all defaults in this case.
k. Click Finish.
• 4) Click OK.
• 5) Back in the Create Business Service window, you
s a
should see the WSDL and binding fields populated with the
h a
information based on the WSDL you chose.
)
• 6) Click Next. c o m deฺ
a ฺ
il field.
G ui
ot as: dent
3) Transport Verify that http is selected in them
Transport
h
The Endpoint URI is populated
7 5@ s Stu
http://localhost:7101/soa-
r z am e thi
infra/services/default/ValidatePayment/validatepaymentprocess_clie
nt_ep to
n e sFinish.to us
o (
Click
e the deployed endpoint of a Composite. One
scheck
a
Note: There are severaln wayse n
to
brEM lconsole
way is to visit the
m e lic (http://localhost:7101/em) and navigate to the composite.
Z
Click the aTest icon b the top right of window. This will bring up a Web Service test
near
radeployed
t
pageo rthat listsfe
the endpoint.
e sIf needed,n s
N -tra the endpoint URI can be updated as you review the business service
n n
oproperties on the Transport tab.
e. Business Service is created on the External Services lane and its file resides under the
project folder.
f. Link the business service to the endpoint:
1) Double-clicking the PaymentValidation_ValidateMsgBS.bix file.
2) In the configuration window, select the Transport tab.
5. Deploy and test your business service using the Run command.
You can refer to the instructions of Deploy and Test the Business Service in Practice 3-2.
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
Tasks
Ne -tran
4) Click OK.
non
Back in the wizard, you should see the fields populated with the wsdl file and
binding.
5) Keep "Expose as a Proxy Service" checked for creating Proxy Service along with
pipeline.
6) Change Proxy Service name to PaymentValidation_ ValidateMsgPS, and the
default directory of the proxy service to the project folder:
/home/oracle/labs_DI/lessons/lesson05/PaymentValidation_
ValidateMsgServiceBusApp/PaymentValidation_ValidateMsg. Leave
the rest values to their defaults.
7) Click Finish.
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
This Pipeline has all kinds of good stuff already built for you–Data Validation,
Routing, Error Handling–all you need to do is fill in the blanks.
Notice the ‘Your Request Stages’. This is where the Template Designer has left a
placeholder for you to customize the Pipeline to do any additional work like
transformations, message enrichment before the data Validation action will be
performed, likewise on the Response Pipeline.
You will validate the incoming payload against the canonical PaymentInfo element type
that the ValidatePayment service is expecting. By validating in Service Bus, you save
precious resources in the backend that are actually processing good payment
authorization requests.
b. The body location has already been provided by the template designer, you need to
specify the element that need validation using XPath. Click .
The XPath Expression Builder opens.
c. Navigate to body > validate > body – request, and select PaymentInfo element.
d. Click Insert Into Expression button. a
a s
You should see that the Expression field is populated with the XPath that you selected.
h
m ) ฺ
ฺ c o i d e
a il G u
m
ot den t
h
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen 2
Z am rable
s t or sfe
Ne -tran
non 1
e. Click OK.
f. Select Static for Schema.
g. Click the browse button on the right to bring up the XML Schema/WSDL chooser.
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
i. es torOK.nsfe
Click
n tra
N The-Properties inspector is updated as shown below:
n o
• XPath: Click on the little icon to the right to pop-up the expression editor.
In the XPath Expression Builder, set the expression as follow:
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
b. Click OK.
The Report Properties inspector is updated with the values that you specified.
s a
) a
hvalue.
When there is an error, the message body content will be replaced by fault
c o m deฺ
b. Click Report action.
a il ฺ
G ui
h otm dent
7 5@ s Stu
r z am e thi
e s to o us
o (n se t
b ran licen
Z am rable
t
The
r action
oreport fe will provide the reason for the error.
e s n s
ra action.
Nc. Click-tAlert
n
no
When an error occurs in the pipeline, an alert will be sent to the alert logging (defined
in the AlertDestination.alert file) with a severity level of Critical.
non
definition on the right.
c. Click the Launch Test Console button next to the proxy service.
The Test Console opens.
10. Test a “happy” path to view the result.
a. Click the Browse button next to the Payload field.
The File Upload window opens.
b. Select File System, navigate to
/home/oracle/labs_DI/resources/sample_input/, and select
PaymentInfoSample_Authorized.xml
c. Click Open.
d. Click Execute.
On the next screen, in the Response Document section, you see that the payment is
authorized.
e. In order to view message reports, you need to perform a search for the reports. To
retrieve the most recent messages:
1) Click the For the last radio button
2) In the hr:mm fields, select 1 hour.
3) Click Search.
s a
) h a
c o m deฺ
You can click the PaymentStatus=Authorized link to view a ฺ
l details.
ithe G ui
12. Now let’s test a scenario with error to view the result.
h otm dent
a. Go back to Test Console and make sure that you 5 thetu
@are at S Proxy Service Testing
home page. 7
m this
r z a e
b. Click the Browse button next to the
s t o Payloadusfield.
The File Upload window opens.
( n e to
c. Select File System,n o etons
navigate
e
b r a l ic
/home/oracle/labs_DI/resources/sample_input/, and select
a m
Z erab l e
PaymentInfoSample_InvalidCardNum.xml
t
d. Clicko rOpen. f
e s n s
ra
Ne. Click-tExecute.
n
noOn the next screen, in the Response Document section, you see that an error is raised
and the response body shows the error details including errorCode, Reason, details,
and Location.
13. View the error report in EM.
a. Go back to EM Console.
b. On the Message Reports page, click Search (using the same search criteria). You
should see the new entry with error code added to the report.
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
b. Click the Alert History tab. sto us
n e
c. Select Pipeline Alerts for( Alert Type. t o
n e
oto the elastnsone
b r a
d. Set the search criteria
l i c hour, and click Search.
You shouldm le alert that is thrown from the service.
Z a see raacritical
b
s t or sfe
Ne -tran
non
15. When you are done, close the application and all open windows of the project in
JDeveloper.
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
s a
) h a
c o m d e ฺ
a il ฺ u i
Practices for m t G
h ot Lesson
d e n 6:
5@ s StuMessages
Transforming
7
r z am e6 thi
Chapter
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
Tasks
1. Open Service Bus project s a
a. In JDeveloper, select File > Open from the main menu.) h a
c o m
b. In the Open Application(s) dialog box, navigate to the d e ฺ
a il ฺ u i
m t G
$HOME/labs_DI/lessons/lesson06/PaymentValidation_XQueryTransform
ot den
ServiceBusApp/ directory, and open the
h
5@ s Stu
PaymentValidation_XQueryTransformServiceBusApp.jws file.
7
r z
resembling the image below:
am e thi
c. Expand the folders in Application Navigator, and you should see the folder structure
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
To save your time, the project folder structure is pre-created and source WSDL and
Schema files are imported into the project for you. In addition, the business service that
invokes the backend ValidatePayment SOA service is also created. You can see it in
the application Overview Editor.
2. Inspecting WSDL and Schema files of partner
a. Double-click the partnerValidatePayment.wsdl file in the WSDLs folder. The
WSDL editor opens and presents the design view of the WSDL document.
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
c. Click the Source tab at the bottom of the WSDL @
7 5 editor.s The
S tusource view of the WSDL
document presents.
amschema i
thsource
t o r
Note that the namespace and referencedz s e file are different from
ValidatePayment-concrete.wsdl.
es to u
( n e
r a no cens
m b le li
a
t o r Z ferab
s s
Ne -tran
n on
d. Double-click the partnerPayment.xsd file in the Schemas folder in Project Explorer.
The XSD editor opens and presents the design view of the XSD document.
e. Expand the PaymentInfo element and review the content.
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
7 5@ s Stu
r z am e thi
e s to o us
o (n se t
Note: This is theb an licuse
rsimplified encase for lab purpose. In the real world, the
Z am could
transformation a b lemore complicated.
be
s t or sfer
CreateeXQuerya
N t r n
transformation map
-
nonthat is accepted by the ValidatePayment endpoint.
You use XQuery Mapper to transform the data of payment validation request from the partner to
the format
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
4. Under File Name, enter partnerPayment2mainPayment.xqy for the XQuery map file.
The file must have a .xqy extension.
5. Leave the default directory name as is.
6. Define an XQuery function
a. Make sure that Generate Function is selected. This will create a function in the XQuery
file.
b. Under Function Name, enter transPaymentStatus.
a. Under the Sources section, click the Add Source button identified by the green plus
sign (+).
The Function Parameter dialog box appears.
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
s o
tfunction us name.
b. Enter partnerPayment as ethe t o parameter
o ( n se
a n e n
m br le lic
Z a rab
r
e sto ansfe
N -tr
non
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
Use the XML Schema tab to specify an XML schema type as the data type for the
function parameter. The Untyped tab can be used to specify an untyped (non-XML
schema based) form of the parameter. You use an XML schema type in this lab.
1) Click the button to the right of Schema Object Reference to select a schema object
as the data type.
The Type Chooser dialog box appears.
You can choose from Application Schema Files, XML Schema Simple Types, and
schemas embedded in Application WSDL Files. You use Application Schema Files
in this lab.
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
7 5@ s Stu
r z am e thi
e s to o us
n Chooser
(Type e t
3) Click OK to close
a othe
n cen s dialog box.
r
b Parameter
In the Function li Type dialog, the Possible Sequence Type Form,
a
Schema
Z m l
Location, e
b ObjectPrefix
and are automatically populated depending on your
r fe r a
s4)toUnder
choice of Schema Reference.
e n s
N -tra Occurrence, keep the default value: Exactly One.
non
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
a. Click the button to the right of Schema Object Reference to select a schema object as
the data type.
The Type Chooser dialog box appears.
b. Select PaymentType in the CanonicalOrder.xsd file as shown below:
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
9. Under the Options section, make sure that the Generate XQuery version line and Use
schema type annotations are selected.
10. Click OK.
The newly created XQuery map opens up in the XQuery Mapper graphical view. You see
the map file appear in the XQuery folder under Project Explorer.
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
7 5@ s Stu
z am
This is very simple, basic mapping, and rthere is noe thito use XQuery Functions, XQuery
need
Constructs, and XQuery Operators.sto us
n e
12. Manually map the leaf nodes ((Drag the e t o
element in the source column and drop it onto the
n o n s
name in source m
ra
element in the target column).
andbtarget:e li
ce in the table below are the ones that have different
Elements
Z a rabl Target
s t or sfe
Source
e tran
NccNumber cardNum
-
non
ccName cardName
13. Verify and save your work.
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am
d. To replace b lemessage payload to the transformed message, do as follows:
the request
a
r Xpath:
r thefesource
1)toSelect s
s
Ne -a)traInn the Replace Properties inspector, for Location, select body.
non b) Click next to <XPath> to open XPath Expression Builder.
c) Navigate to body > validate > body – request, select PaymentInfo element.
d) Click the Insert Into Expression button.
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
7 5@ s Stu
r z am e thi
es to o us
o (n se t
e) Click OK.
b ran licen
2) Select
Z am r a b le
the replacement.
s t oa)r <expression>
In theeReplace
s f Properties inspector, click the triangle shape next to
Ne -tran to view the drop-down menu, and select Xquery Resources.
non
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
d) Click OK. h ot den
5@withsyour
The XQuery Resource field is populated S u
tselection.
7
r z am e thi
e s to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
7 5@ s Stu
r z am e thi
es to o us
o (n se t
Thisa
b r step
Query l i enthe transformation
n is tocspecify
to perform
PaymentInfo as the input document to give to the
upon.
a m b l e
t o r Ziii) fClick
e raOK.
s f) Thes Replace Properties window is updated with your selection.
Ne -tran
non
partnerPaymentInfoSample.xml
d. Click Open.
e. On the Test Console, click the Execute button.
The next screen in the Response Document section indicates that the payment has
been Denied.
19. When you are done, close the application and all open windows of the project.
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
You can extend and add a new interface so that legacy systems may place orders without
impacting the backend application. Service Bus can provide protocol and data translation to
minimize any disruption to the backend business logic of ProcessOrder. To do that, you add a
new file order channel for the ProcessOrder SOA service. The new proxy handles incoming
orders by file and translates common-delimited format with nXSD.
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
Tasks
Setup
Before you create Service Bus application, you need to deploy and test the ProcessOrder
composite.
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
no6)n Click OK.
You see the new DB connection appear under the IDE folder.
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
7 5@ s Stu
r z am e thi
e s to o us
o (n se t
b ran licen
Z am rable
s t or sfe
- t r anthe table, and select Open Object Viewer from the context menu. You
Nc. e Right-click
n see the new order record saved in the database.
noshould
6. Import project.
h. Select File > Import from the menu.
i. In the Import dialog, select Service Bus Resources.
j. Click OK.
The Import Service Bus Resources wizard is displayed.
k. Select Configuration Jar.
l. Click Next.
The wizard advances to step two.
s a
m. Click the Browse icon to the right of Jar Source.
) h a
The Configuration Jar chooser is displayed. ฺ
c o m d e
il ฺ i
n. Navigate to /home/oracle/labs_DI/lessons/lesson06/, select
a u
ProcessOrder_Resources.jar. m t G
o. Click Open. h ot den
p. Click Next. 7 5@ s Stu
z am e thi
The wizard advances to step three.
r
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
r. Click Finish.
b ran licen
Z am rable
s t or sfe
Ne -tran
non
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
7 5@ s Stu
Add file adapter proxy and wire to pipeline r z am e thi
You use the File Adapter wizard to add e s to o us proxy for ProcessOrder. The new File
a new File-based
o
proxy will transform a comma-delimited(n filestoe atvalid Order xml which the ProcessOrder pipeline
service can use, validate r n call ctheenbackend ProcessOrder SOA service.
it,aand
m b yourle
li
a
At the end of this practice, ProcessOrder_nXSD project should resemble the following:
t o r Z ferab
s s
Ne -tran
non
Note: In SOA Suite 12c, the Adapter wizards are shared between SOA and Service Bus.
7. Double-click the project overview file ProcessOrder_nXSD to open it in the Overview editor.
8. Locate the File Adapter icon in the Component Palette, and drag it onto the Service Bus
Overview editor in the Proxy Services lane.
File Adapter Configuration Wizard opens.
Click Next.
b. Adapter Accept the default value: Define from operation and schema (specified
Interface later).
Click Next.
c. File Server Accept the default value: eis/FileAdapter.
Connection Click Next.
d. Operation Select the Read File radio button.
Type Click Next.
s a
e. File a
Use the Browse button to specify the Directory for Incoming Files:
) h
Directories /home/oracle/labs_DI/tmp/input
c o m deฺ
Accept the rest default configurations
a il ฺ
G ui
Click Next.
h otm dent
f. File Filtering Include Files with Name Pattern:
7 5@ *.csv S tu
Click Next.
r z am e this
g. File Polling Polling Frequency:
e s to 20o seconds
us
( n t
a
Click Next.
n o e n se
h. Messages
m br Inthelthis
enXSD
ic translation
lstep, you have a choice. You can proceed to Appendix–Build
to create the nXSD from scratch or you may
Z a raselectb
t o r f e an nXSD that has been provided for you, which will convert
s s comma-delimited orders in valid canonical XML format.
Ne -tran Build nXSD from
non
scratch
Select pre-built
nXSD file
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
Click OK.
7 @ Stu
5populated
a m
Notice that the URL field is
t h is with the schema file that you
s t o z usElement
selected and therSchema e is set to Order.
( n e to
no cens e
r a
b le li
a m
t o r Z ferab
s s
Ne -tran
n on Click Next.
i. Finish Click Finish.
The Adapter Configuration wizard closes.
Your Overview editor should resemble the following:
10. Wire your new proxy service to the existing ProcessOrderPP pipeline (Click the small green
arrow on your new proxy and drag over to the ProcessOrderPP pipeline.)
non
a. In JDeveloper, go back to the E2E_1201_ORDERS table’s Object Viewer tab window.
b. Click the Refresh button. You should see the new order entry in the table as shown
below:
This new order is received from the file adapter, transformed using nXSD, and then
processed by the ProcessOrder SOA service.
16. When you are done, close the application and all open windows of the project in
JDeveloper.
NThee Native t r n
aFormat
o n - Builder Welcome page is displayed.
n Next.
2. Click
3. Name the file order_nxsd.xsd.
4. Click Next.
The Choose Type page is displayed.
s a
) h a
c o m d e ฺ
6. Click Next.
a il ฺ u i
m t G
The File Description page is displayed.
h ot den
7. Enter the following values:
7 5@ s Stu
• Click Browse and select FileOrderSample.csv.
z a m thi
• Root element: Order t o r u se
n es to
• Target namespace: http://www.oracle.com/soasample.
( e
r a no cens
m b le li
a
t o r Z ferab
s s
Ne -tran
non
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
7 5@ s Stu
r z am e thi
e s to o us
o (n se t
8. Click Next. b ran licen
am rscreen
The Design Schema
Z a b leis displayed. We will now create the complex types for data
r e
sto antosfaddress,
corresponding
foreaddress.
billing, shipping, and item. You start by creating Complex type
NAdd a new
- trcomplex type.
9.
o n
a.n Select the Order element.
b. Click the Add Complex Type icon.
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
s a
) h a
c o m deฺ
a ฺ
ilnames G i
uare
otm dent
g. Rename the auto-generated elements C1,C2,…C7 to element that
expected in the generated xml. h tuthe Edit Field Details
5@
Select each of the elements and click the Pencil
7 S
icon to open
r z e thiseach field.
amto configure
screen. Use the values in the table below
field Field Name
e s to o uTerminated
Style s By
n
FirstNameo ( terminated
t
C1
a n e n se ,
C2 br le lic terminated ,
LastName
m
C3 Z aAddressLine
rab terminated ,
t o r f e
s anCity s
Ne C4 - t r terminated ,
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
z a m thi
h. Verify your work.
t o r u se
n es to
( e
r a no cens
m b le li
a
t o r Z ferab
s s
Ne -tran
non
s a
) h a
c o m deฺ
10. Create the complex type for BillingType.
a il ฺ
G ui
The BillingType consists of Credit Card Information and othe t
tmBillingenAddress.
a. Select the Order element in the left pane and click@ h t ud Type.
Add Complex
7 5 S
b. Name it BillingType.
r z a m
e t his
c. Select BillingType and drag the
e s to firstolineusof data from the Sample File pane onto the
Billing Type.
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
C2 CardNum terminated ,
C3 ExpireDate terminated ,
C4 CardName terminated ${eol}
g. Verify your work.
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or fieldsftoethis list.
11. Add another
an selected, click the Green button (plus sign) to add a new element.
Na. e With-tBillingType
r
non
s a
) h a
e. Click OK to close the Edit Filed Details dialog box.
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
e s to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
nonthe type information for the order line item.
12. Create
a. Select Order.
b. Create a new complex type called ItemType.
s a
d. Add another element, and name it ShippingSpeed.
) h a
e.
c o m d e ฺ
Select the ShippingSpeed element, and click the pencil icon on the top to edit the
element.
a il ฺ u i
m t G
ot den
The Edit Field Details screen is displayed.
h
f.
5@ s Stu
Select terminated as the style.
7
am e thi
g. Add Terminated By as Comma (,) manually.
r z
to o us
es
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
h. Click OK.
You return to the Design Schema screen.
14. Create another complex type with the name ItemsType.
a. Select Order element.
b. Select ItemsType.
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
i. o n OK.
n Click
You are returned to the Design Schema screen.
15. Create the elements.
a. Select the Order element.
b. Click the Add Element icon.
c. Create four elements: Billing, Shipping, Email, and items.
d. Verify your work.
e. Click OK.
f. Click OK again (in the Element Details window).
You return to the Design Schema dialog box.
g. Click Next.
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
19. Save your project.
s a
) h a
c o m d e ฺ
a il ฺ u i
Practices for m t G
h ot Lesson
d e n 7:
Routing
7 tu
5@Messages
S
r z am e7 this
Chapter
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
Express based on the credit card name, element, and value sent in the payload.
Tasks
Setups
1. Deploy the two payment validation composites.
a. In a terminal window, enter the following commands:
>cd $HOME/labs_DI/lessons/lesson07
>ls –l
s a
>$HOME/labs_DI/resources/Scripts/deploy.sh
sca_ValidatePaymentVISA_rev1.0.jar ) h a
c o m d e ฺ
>$HOME/labs_DI/resources/Scripts/deploy.sh
a il ฺ u i
sca_ValidatePaymentAMEX_rev1.0.jar
m t G
h ot den
Make sure you see that both builds are successful.
5@ s Stu
b. Open EM console. In Target Navigation panel, expand SOA > soa-infra > default. Now
7
r z am e thi
you see the newly deployed two composite applications in the folder.
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
2.
non
Open Service Bus project
a. In JDeveloper, select File > Open from the main menu.
b. In the Open Application(s) dialog box, navigate to the
$HOME/labs_DI/lessons/lesson07/PaymentValidation_RoutingServiceB
usApp/ directory, and open the
PaymentValidation_RoutingServiceBusApp.jws file.
To save your time, the application and project folder structure is pre-created and
source WSDL and Schema files are imported into the project for you.
s a
3. Create the business services.
) h a
c o m deฺ
There are two credit card services (two endpoints), and you will create business services
for each of them.
a il ฺ
G ui
otm dent
a. In Application navigator, double-click PaymentValidation_Routing to open it in Service
Bus Overview editor. h
5@ s Stu
b. Drag the HTTP component from the Technology section in the Component palette and
7
r z am e thi
drop it onto the External Services lane.
e s to o us
c. Enter the required details for business by following the instructions in the table below:
Step Window/Page
o (n se t Choices or Values
Description n
ra lice n
1)
b
Create am Namele the service AmexBS.
Z a b
s t or sferClick Next.
Service
e
2) N Typetra
n 1) Select WSDL for Service Type.
-
non 2) Click the Browse WSDLs icon to the right of the WSDL choice.
3) In the Select WSDL dialog box, click Application, navigate to
Application > PaymentValidation_Routing > WSDLs, and select
ValidatePayment-concrete.wsdl.
4) Click OK.
5) Back in the Create Business Service window, you should see the WSDL
and port fields populated with the information based on the WSDL that
you chose.
6) Click Next.
3) Transport Verify that http is selected in the Transport field.
Replace the Endpoint URI with the URL of validatePaymentAmex SOA service
that you deployed earlier. It should look like the following:
http://localhost:7101/soa-
infra/services/default/ValidatePaymentAMEX/validatepayment_client_amex
Click Finish.
non
Now you should see proxy and pipeline components in the Service Bus Overview Editor
and their files (PaymentValidationPS.proxy, PaymentValidationPP.pipeline) added in the
project folder.
5. Configure pipeline to add a conditional branching
a. Open the pipeline in the Pipeline editor.
s a
) h a
c o m d e ฺ
c. Select BranchNode1. ฺ
ail t Gu i
d. In Conditional Flow Property window, make the followingtm
selections:
h o den
7 5@ s Stu
r z am e thi
e s to o us
o (n se t
b ran licen
Z am rable
e. es
tor Branch1.
Select a n sfe
Nf. In Branch
- tr Property window, do the following:
n
no• Enter IsAmexCard as name.
• Click the XQuery Expression Builder icon, type “AMEX” in the Expression field.
• Click OK.
Your Branch Property window should now resemble the following image:
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
Note that this behavior automatically creates the
7 5 @ tuRouteNode1, along with
route node,
S
the routing action.
z a m this
h. Select Routing.
t o r u se
i. In the Routing Property window, n s
e selecttoAmexBS.bix as the routing target business
service.
(
o ense
a n
r configuration
Now you complete b
m the
l e lic for the American Express card branch. Next, you do
a Visaracard.
the same for the
Z b
j. Add t o r
a routingfe
action to the Default branch.
s s
Ne -tran
non
k. Select Routing.
d. Similarly, select
/home/oracle/labs_DI/resources/sample_input/PaymentInfoSample_Visa.xml for
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
coming from an incoming request to the actual service. Then, you create a pipeline that
performs this lookup and routes to the correct service.
In this case, we have two credit card companies, American Express and Visa. Here is the
routing rule:
xquery version "1.0" encoding "utf-8";
<Configuration>
<CardName value ='AMEX'>
<Service>PaymentValidation_Routing/AmexBS</Service>
</CardName>
s a
) h a
<CardName value ='VISA'>
c o m deฺ
a il ฺ
<Service>PaymentValidation_Routing/VisaBS</Service> G ui
</CardName>
h otm dent
</Configuration>
7 5@ s Stu
Here is the dynamic routing expression:
r z am e thi
<ctx:route>
e s to o us
<ctx:service (n e t
o s
ran licen
isProxy='false'>{$varConfig/CardName[@value=$varCardName]/Servic
b
am rable
e/text()}</ctx:service>
Z
or sfe
<ctx:operation>{$operation}</ctx:operation>
s t
Ne -tran
</ctx:route>
n
notasks
The key you perform are:
• Configure a pipeline with a proxy service that handles dynamic requests
• Determine where to route an incoming request
Tasks
1. Create a new Service Bus project. s a
) h a
a. In JDeveloper, select File > New > Project from the main menu.
b. Select Service Bus Project. c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
c. Click OK.
d. Name the project PaymentValidation_DynamicRouting, and click Finish.
You see that a new project folder is added in Application Navigator.
e. In the project folder, add a new folder, and name it XQuery.
Click Next.
3) Configuration Accept the default.
Click Finish.
You see that the selectCCard.xqy file is added in the XQuery folder.
e. Right-click selectCCard.xqy and select Open to open it in the editor.
Note that dynamic routing uses the physical identifier of the Business service to route
the request. The physical identifier is expressed as:
<project_name>/<business_service>
The project and business services are pointing to those created in the previous
practice as you reuse them for this dynamic routing project.
3. Reuse the business services created in the previous project:
s a
) h a
a. Right-click in the External Services lane, and select Choose > Business Service from
the drop-down menu.
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
s a
Create and configure the pipeline to implement dynamic routing
) h a
c o m
4. To create the pipeline and proxy service, do as follows:
d e ฺ
il ฺ u i
a. In the PaymentValidation_DynamicRouting Overview Editor, drag and drop the
a
m t G
ot den
Pipeline component from the Components palette to the Pipeline /Split Joins lane.
h
5@ s Stu
The Create Pipeline Service wizard pops up.
7
r z am e thi
b. In step one (Create Service), name the Pipeline Service
PaymentValidation_DynamicRoutingPP.
c. Click Next. es to o us
o (n se t
d. In step two (Type), use the same WSDL of the business service for the pipeline
service:
b ran licen
am rable
1) Select the service type WSDL.
Z
s t or sfe
2) Click the Browse WSDLs icon on the right.
Ne -tran
3) The Select WSDL dialog box pops up.
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
7 5@ s Stu
z
You use this Assign activity to load rthe
m resource
aXQuery e thi and store the content in a
variable.
e s to o us
(n inspector,
1) In the Assign Properties e t click the triangle shape to view the drop down
o n s
b ran XQuery
menu, and select
l i ceResources.
Z am rable
s t or sfe
Ne -tran
non
s a
) h a
c o m deฺ
4) Click OK. a il ฺ
G ui
tm ent
The XQuery Resource field is populated with youroselection.
h
5) Click OK. 5 @ S t ud
m 7you seeisthat the Value field is updated
Back in the Assign Properties inspector,
too. r z a e th
o
t o uass the name of the variable.
svarConfig
e
6) In the Variable field, enter
( n t
o s e
b ran licen
Z am rable
s t or sfe
Ne -tran
non
This assigns the XQuery resource to this variable.
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
7 5@ s Stu
r z am e thi
e s to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne You-tuse
r anthis Assign activity to store the value of the CardName element in the payload
n
noin a variable.
1) In the Assign Properties inspector, click the XQuery Expression Builder icon .
The XQuery Expression Builder window opens.
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
3) Append /text()
b i ceofnthe expression as shown below:
ratonthe lend
Z am rable
s t or sfe
Ne -tran
non This way you make sure to get the string from the context element.
4) Click OK.
Back in the Assign Properties inspector, you see that the Value field is populated
with value that you defined.
5) In the Variable field, enter varCardName as the name of the variable.
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
2) Click Dynamic Routing.
3) In Dynamic Routing Properties inspector, click the XQuery Expression Builder
icon.
The XQuery Expression Builder window opens.
4) In the Expression field, type the dynamic routing expression as follows:
Note: You can find the code in the DynamicRoutingExpression.txt file in the
~/labs_DI/lessons/lesson07 directory.
The attribute is Proxy has to be set to ‘true’ if you are routing the request to proxy
service or ‘false’ if you are routing the request to business service. Operation name is
optional as business service might not always be WSDL service.
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
e s to o us
o (n se t
b r an licen
7.
Z am rclose
When you are done,
a b l ethe application and all open windows of the project.
t o r f e
s s
Ne -tran
non
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
s a
) h a
c o m d e ฺ
a il ฺ u i
Practices for m t G
h ot Lesson
d e n 8:
Enriching
7 tu
5@ sMessages
S
r z am e8 thi
Chapter
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
To pass the Session ID between the calling and callee services, you have two options:
• Use request/response messages.
• Shared variable
You use shared variable in this practice.
In the second practice, you use service callout to call a external service via the business
service, and then pass the response to the next service.
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
Overview
The high-level steps of this practice are: s a
) h a
• Create the business service, proxy service, and pipeline. m deฺ
c o
• Create the pipeline to generate the session ID.
a il ฺ
G ui
session ID, and route it to the business service. h otm dent
• In the main pipeline, add the service callout to invoke the pipeline that generates the
7 5@ s Stu
r z am e thi
Tasks
e s to o us
1. Open Service Bus project. (n e t
o s
en from the menu bar.
ranFileli>cOpen
a. In JDeveloper, select
b
b. In the Openm le dialog box, navigate to the
Z a Application(s)
a b
s t s f erand open the ProcessOrder_EnrichmentServiceBusApp.jws
or directory,
$HOME/labs_DI/lessons/lesson08/ProcessOrder_EnrichmentServiceBus
Ne file.-tran
App/
c.no
n
Expand the folders in Application Navigator, and you see the folder structure
resembling the image below:
4. Create the proxy service with the pipeline using the following information:
• Proxy service name: ProcessOrder_sessionIDPS
• Transport: HTTP
• Generate pipeline with name: ProcessOrder_sessionIDPP
• WSDL file: ProcessOrder-concrete.wsdl
After you are done, the service bus Overview Editor should resemble the image below:
s a
) h a
c o m deฺ
a il ฺ
G ui
5. Create a new pipeline that generates session ID. h otm dent
5Bus@function
S u
textension,
You will use function fn-bea:uuid(), a Service
m 7 i s to generate a
universally unique identifier. The generated
r z a et
UUID is a h
string with over 20 characters, but
the length of the sessionID, defined ino ustheshould
st tothetruncate
schemas, be no more than 20. So you will
use another function fn:substringn e
( shows t o UUID to 20 characters or less. The
o
n cen
image below (for your reference) s ethe sessionID element definition in XSD:
r a
b le li
a m
t o r Z ferab
s s
Ne -tran
non
a. Drag-and-drop the Pipeline component in the center lane of the Overview Editor.
b. Name the pipeline genSessionID.
c. For Service Type, use the default value Any XML.
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
e. Click Finish.
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
6. Add two XQuery functions to the pipeline.
a. Open genSessionID in the editor.
b. Add a shared variable.
1) Right-click the genSessionID start node, and select Add Shared Variable.
c o m d e ฺ
3) ฺ i
Insert the uuid function in the Expression field.
a il u
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
7 5@ s Stu
r z am e thi
e s to o us
o (n se t
b ran licen
Z am rable
s t or sfe
t r anthe function in the Expression field, and set the value as shown below:
Ne 3) -Insert
non
Note: You can use just one Assign action to get a substring of uuid. The XQuery
expression should be:
fn:substring(fn-bea:uuid(), 1, 18)
7. Save your work.
8. Configure the main pipeline, ProcessOrder_sessionIDPP.
In this pipeline, you will add a Service Callout action to call the genSessionIDPipeline
s
service. On getting the sessionID value, you need to insert the <SessionID> element into
a
) h
$body as it is not included in the original request payload.
a
a. Open the ProcessOrder_sessionIDPP editor c o m d e ฺ
a il ฺ u i
m t G
b. Add the shared variable using the same steps for genSessionID:
h ot den
1) Right-click the ProcessOrder_EPP start node, and select Add Shared Variable.
7 5@ s Stu
2) Specify the name as POsessionID.
z am e thi
3) Click the arrow next to the start node, and you should see the newly added shared
r
es to o us
variable as shown below:
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
c. Add a Pipeline Pair node after the ProcessOrder_sessionIDPP start node.
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
7 5@ s Stu
r z am e thi
e s to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne. e under an Callout Properties window, click Browse, and select genSessionID
In therService
- t
n o n Resource Chooser for Service.
f. The property window is updated with the service that you selected and variables to be
configured.
g. Type dummy in both Request Payload and Response Payload fields.
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
7 5@ s Stu
r z am e thi
e s to o us
o (n se t
b ran licen
Z amProperties
i. In the Insert
r a b lewindow, set the values as follows:
r
1)toClick sfe
s next to the Value field to open XQuery Expression Builder.
an the Variables tab, select POsessionID and insert it into the Expression field.
Ne 2) -Under
t r
non
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
7 5@ s Stu
r z
3) To add element tag for $POsessionID,amyoueneed thi to know the namespace prefix
and element name. You can
es tofind it oby unavigating
s to body > process > $body -
( n t
a n o ense
request > Order > SessionID.
m br le lic
Z a rab
r
e sto ansfe
N -tr
non
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
e s to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
n bus project should look like the image below in the Overview Editor:
noservice
Your
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
3) Right-click the table, and select Open Object Viewer from the context menu. You
see that the latest order entry in the database includes a sessionID.
Tasks
Setups
1. Deploy the credit card validation composite service.
a. In a terminal window, enter the following commands:
>cd $HOME/labs_DI/lessons/lesson08
>ls –l
>$HOME/labs_DI/resources/Scripts/deploy.sh
s a
sca_ValidateCCard_rev1.0.jar
) h a
Make sure you see that the build is successful.
c o m d e ฺ
il ฺ u i
b. Open EM console. In the Target Navigation panel, expand SOA > soa-infra > default.
a
m t G
ot den
Now you should see the newly-deployed two composite applications in the folder.
h
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
This service only checks the credit card number and expiration date. It won’t compare
the total order amount with the daily limit.
2. You can test this service as follows:
a. On the ValidateCreditCard [1.0] home page, click Test.
b. On the Test Web Service page, accept all default settings. Note down the URL of the
service. You will use it later in this practice.
c. On the Request tab, click Browse, and select
/home/oracle/labs_DI/resources/sample_input/CCard_Valid.xml
message.
s a
) h a
e. Click Test Web Service.
c o m deฺ
il
f. Review the response message, and you should see that the payment
a ฺ ui is “Valid”.
status
G
3. Create a new Service Bus project.
h otm dent
a. In JDeveloper, select File > New > Project from@
7 5 S tu
the main menu.
b. Select Service Bus Tier > Service Bus m
r z a Project.
e this
e s to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
c. Click OK.
d. Name the project: ProcessOrder_EnrichStatusUpdate.
e. Click Finish.
You see that a new project folder is added in Application Navigator.
4. Double-click ProcessOrder_EnrichStatusUpdate to open Service Bus Overview Editor.
Z m
a rab validateCCard_client_ep
r
e sto ansfe Click Finish.
N -tr
non
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
7 5@ s Stu
b. Under the Resource Chooser, navigate to
ProcessOrder_EnrichSessionID, and r zselect e thi >
amApplication
ProcessOrder_EBS.bix.
e s to o us
c. Click OK.
o n se t
(the
7. Create the proxy servicen
r a with
c n using the following information:
pipeline
e
m l e li
b ProcessOrder_StatusUpdatePS
• Proxy service name:
a rab
t o r Z HTTP
• Transport:
f e
• s s with name: ProcessOrder_StatusUpdatePP
Generatenpipeline
N• e WSDL r a
-t file: ProcessOrder-concrete.wsdl
o n
n you are done, the service bus Overview Editor should resemble the image below:
After
8. Configure the pipeline by adding a Service Callout action to invoke the ValidateCCardBS
business service and pass the Service Callout response to the ProcessOrder business
service.
a. Double-click the pipeline to open its editor.
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
ot youdselected
The property window will be updated with the service that
h e n and the
u
75@ is St
variables to be specified.
e. Create two variables inside the messagem flow.
1) Click the Request Payload field,rz and type e th
a validateCCReqMsg.
o
st field,tand s
utype
2) Click the Response Payload
( n e o validateCCRespMsg.
no cens e
r a
b le li
a m
t o r Z ferab
s s
Ne -tran
non
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
7 5@ s Stu
r z am e thi
es
b. In the Assign Properties window,toset theovalue
us to the validateCCReqMsg variable:
( n t
1) Click n
to open
a o n se Builder.
XQuery Expression
e
m br le lic
Z a rab
r
e sto ansfe
N -tr
non
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
7 5@ s Stu
r z am e thi
e s to o us
o (n se t
b ran licen
Z am ValidateCreditCard
a b le
rpayload, so you need
t o r request
3) However,
f e SOA service expects the PaymentInfo element in
s anthe s to wrap the content of Billing element in the
Ne -PaymentInfo
t r element. To do so, add the following code(underlined in red) in the
n
no Expression field:
Note: You can also create an XQuery/XSLT transformation to convert from the
Billing element to the PaymentInfo element.
4) Click OK to close XQuery Expression Builder.
10. Use Service callout response message, add it to pipeline request message, and pass it
to the target service.
a. Drag an If Then action from the Flow Control seciton in Components palette and drop
it below Response Action of Service Callout. Use the following image as a guide:
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
b. Select If: <Condition>.
c. In the If Properties window, Click to open XQuery Expression Builder.
1) Type $validateCCRespMsg="Invalid" in the Expression field.
2) Click OK.
The If Properties window is updated as shown in this image:
s a
) h a
c o m d e ฺ
a il ฺ u i
e. In the Insert Properties window, set the values as follow:
m t G
1) Click ot deBuilder.
next to the Value field to open XQueryhExpression
n
2) Type the following code in the Expression 7 @ Stu
5field.
r z am e this
e s to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
3) Click OK to close XQuery Expression Builder.
4) In the Position field, select “as last child of” from the drop-down menu.
5) In the Location field, select body from the drop-down menu.
6) Click to open XPath Expression Builder.
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
e s to o us
o (n se t
b ran licen
Z am rable
r
8)toClick OK.fe
e s n s
N -Now
n tra your Insert Property window should look like the image below:
no
8) Click OK.
11. Add a Routing action below PipelinePairnode1, and select ProcessOrder_EBS.bix business
service as the destination service.
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
7 5@ s Stu
r z am e thi
e s to o us
o (n se t
b ran licen
Z am rable
s t or sfe
t r an the table, and select Open Object Viewer from the context menu. You
Ne 3) -Right-click
non should see the latest order entry in the database with a status of SendtoFulfillment.
You can use the BadOrderSample.xml file to test an invalid credit card scenario,
and view the result.
14. When you are done, close the application and all open windows of the projects.
s a
) h a
c o m d e ฺ
a il ฺ u i
Practices form t G
h ot Lesson
d e n 9:
Processing
7 tu
5@ s SMessages with
r z am e thi Calls
Concurrent
es to Chapter
o us9
( n t
a n o e n se
m br le lic
Z a rab
r
e sto ansfe
N -tr
non
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
s a
) h a
c o m deฺ
a il ฺ
G ui
Tasks
h otm dent
Setups 7 5@ s Stu
1. Open Service Bus project. r z am e thi
a. In JDeveloper, select File > Opene s tofromotheumenu
s bar.
n
( dialogsbox, t
e navigate to the
b. In the Open Application(s)
a n o e n
pp/ directory, bandr open
l e licProcessOrder_SplitJoinServiceBusApp.jws file.
$HOME/labs_DI/lessons/lesson09/ProcessOrder_SplitJoinServiceBusA
m the
Z a rabin the Application Navigator, and you see that the folder structure
c. Expandr the folders
to nsthefeimage below:
e sresembles
N -tra
non
To save your time, the application and project folder structure is pre-created and the
source WSDL and Schema files are imported into the project for you.
e s to o us 6) Click Next.
c) Transport t is selected in the Transport field.
(nVerify sthate http
o n the Endpoint URI to point to the ValidateCreditCard
b ran liChange
c e
composite:
Z am rable http://localhost:7101/soa-
s t or sfe infra/services/default/ValidateCreditCard/
e
N -tra n validateCCard_client_ep
no n Click Finish.
d. Repeat the above mentioned steps to create another business service for
ProcessOrder SOA service. Two things you need to do differently include:
• Name the service ProcessOrderBS.
• Select ProcessOrder-concrete.wsdl for WSDL file.
• The Endpoint URI should point to the ProcessOrder composite, which is:
http://localhost:7101/soa-
infra/services/default/ProcessOrder/receiveorder_client_ep
Now you should see two business services created in the External Services lane in
Overview Editor.
Add Split-Join
3. To create a Split-Join and proxy service:
a. In the project Overview Editor, drag Split-Join into the middle swim lane from the
Resources section in the Components palette.
b. In step one (Create Service), name the Split-Join service ReceiveOrderSplitJoin.
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
7 5@ s Stu
r z am e thi
3) Click OK.
e s to o us
Back in the wizard, you
o (nshouldseseet the fields populated with the wsdl file.
4) Keep "Expose r aasn a Proxyc n
eService" checked for creating Proxy Service along with
b l i
Z amtherProxy
the pipeline.
a b le
t o r
5) Change
f e Service name to ReceiveOrderPS. Leave the rest of the values
s an to theirsdefaults.
Ne. e Click-tFinish.
r
n
noYou see that both Split-Join and proxy service are added in Overview Editor.
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
7 5@ s Stu
r z am e thi
es to o us
t
n seconstructing
(elements
You see that the primary
a n o e n a message flow in a split-join:
• A start node, r which contains
boperation lic the request and response variables introspected from
m
a rab
the WSDL
Z l e
r fenode, to receive incoming request messages
e s•• toAA receive
n s
a node, to send response messages
N -trreply
n
noNote that request and response are global variables.
b. Add Parallel flow control activity after Receive activity in split-join. The Parallel activity
allows you to invoke different services concurrently.
To invoke two services from this split-join, you need only two branches in parallel flow.
s a
d. Add an Invoke Service activity in the ProcessOrder branch. Invoke activity
) a
his used to
call business service.
c o m deฺ
il ฺ
e. Configure the Invoke Service activity to invoke ProcessOrderabusiness
G ui
service.
otm dent
1) Modify the name of the invoke activity to InvokeProcessOrder.
h
5@ s Stuas the target service.
2) In Invoke Properties inspector, select ProcessOrderBS
7
r z am e thi
e s to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
7 5@ s Stu
r z am e thi
e s to o us
o (n se t
b ran licen
Create variablesZ am rable
You s t or two svariables,
create fe one local variable in ValidateCreditCardScope and one global
e
Nvariable:-tra n
• no
n
The local variable will store the content of the Billing element from the order, which will
be used as the request for ValidateCreditCard service.
• The global variable will store the response from the ValidateCreditCard service.
5. To create the local variable:
a. Right-click the ValidateCreditCardScope, and then select Create Variable.
The Create Variable Alias dialog appears.
b. Enter CreditCard as the name for the variable.
c. Select the WSDL Message as variable type.
d. Click Browse next to the variable type.
The Type chooser dialog appears.
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
f. Click OK to close Type Chooser. 7 5@ s Stu
g. Click OK to close Create Variable. rza
m thi
The new variable appears ine s u se in the Variables box.
o of variables
tlist
( n the
e to
6. o ens
To create the global variable:
a. Right-click the b ranNodeli(ReceiveOrderSplitJoin),
Start c and then select Create Variable.
Z m
a rab l e
r
e sto ansfe
N -tr
non
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5 @ Stu
f. Click OK to close Type Chooser.
z a m this
g. Click OK to close Create Variable.o
t r u se
The new variable appears n ine
s o
the list oftvariables in the Variables box.
7. o ( s e
To assign Billing contentnto the localnvariable:
a. Add an Assignb
ra liceValidateCreditCardScope.
activity in the
Z am rable
s t or sfe
Ne -tran
non
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
f. no
n
Click OK.
Back in the Assign Properties inspector, you see that the Value field is populated with
value you defined.
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
e s to o us
o (n se t
b ran licen
Z am rable
b. s t or the sname
Modify fe of Replace to Replace Response.
e
Nc. In the a n
trReplace
o n - Properties inspector, do as follows:
n 1) Select respone.ack as Location.
2) Click XQuery Expression Builder icon next to the Value field.
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
e s to o us
o (n se t
b r an licen
4) Click OK.
Z m ble
athe
t o r
5) Keep
f e raof the field values unchanged.
rest
s s
Ne -tran
non
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
7 5@ s Stu
r z am e thi
e s to o us
o (n se t
b ran licen
Z am rable
s t or sfe
- t r anthe table, and select Open Object Viewer from the context menu. You
Nc. e Right-click
n see the new order entry added in the database.
noshould
13. When you are done, close the application and all open windows of the project.
s a
) h a
c o m d e ฺ
a il ฺ u i
Practices for m t G
h ot Lesson
d e n 10:
Adapters
7 5@ and
S tuTransports
r z am e10 this
Chapter
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
• Provide a REST interface to SOAP service, so it handles requests from mobile devices
as well as future systems that use REST/XML and REST/JSON
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
Tasks
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
7 5@ s Stu
Note that the composite provides o
twor z am e one
interfaces,
thi is Direct Binding, and the other is
the SOAP web service.
n e st to us
3. o ( fromsthe
You cannot access direct binding e EM console, so do as follows to get the SOA-
a n e n
m br ltab,
DIRECT Endpoint URI:
e ic
land
a. Open a new
Z a rab
browser entr the URL below:
s t or sfe
http://localhost:7101/soa-infra
Ne -tran
non
s a
) h a
c o m deฺ
a il ฺ
G ui
m ent
otlink.
c. Click View WSDL for the validatepayment_client_direct
@ h t uwillduse in later stage.
d. Note down or copy the service endpoint location7 5 which S
you
r z a m
e this
e s to o us
o (n se t
n cen
raproject
4. b
Open the Service Bus
m l e li
a rab File > Open from the main menu.
t o r Z feselect
a. In JDeveloper,
b. sIn the Openn sApplication(s) dialog box, navigate to the
Ne $HOME/labs_DI/lessons/lesson10/PaymentValidation_SOADirectServic
r a
-t directory, and open the
o n
n PaymentValidation_SOADirectServiceBusApp.jws file.
eBusApp/
Click Finish.
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
s a
) h a
c o m deฺ
a il ฺ
G ui
h o tm ent
@
Note that the business service is set with synchronous client
t d in a synchronous
urole
7 5 S
this
invocation of an SOA composite.
z a m
Create a proxy service to invoke the r
tobusiness e
usservice
n e s t o
6. Create Proxy Service.
o ( e
sthe
a. In Overview Editor, a n
drag and e n
drop HTTP component from the Components palette
to the Proxym br llane.
Services e l i c
Z a ProxyraService
b
t o r
The Create
f e wizard pops up.
b. s s
an (Create
Ne • -Service
In step one Service), fill up the details for Proxy Service:
t r Name: PaymentValidation_SOADirectPS
no• n Keep “Generate Pipeline” checked to create pipeline along with Proxy Service.
• Change the pipeline name to PaymentValidation_SOADirectPP.
Click Next.
c. In step two (Type), use the same WSDL of the business service for the proxy service:
• Select service type WSDL.
• Click the Browse WSDLs icon on the right.
The Select WSDL dialog box pops up.
• Navigate to Application > PaymentValidation_SOADirect > WSDLs directory, and
select ValidatePayment-concrete.wsdl.
• Click OK.
Back in the wizard, you should see the fields populated with the wsdl file and binding
information.
Click Next.
d. In step three (Transport), you should see the populated endpoint URI depending on
your configuration in previous steps. Keep it unchanged and click Finish.
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
s a
) h a
c o m deฺ
a i l ฺ u i
Assumptions tm ent G
h o
5 S t ud 3.
You completed Practice 2 - Virtualizing Service with Service Bus of Lesson
@
1. Open the ValidatePayment Service Bus project 7
a. In JDeveloper, select File > Open from r z e this
mmain menu.
athe
b. In the Open Application(s) dialoge s tobox, navigate
o us to the
( n t
directory, and open a the
o e se
$HOME/labs_DI/lessons/lesson03/PaymentValidationServiceBusApp/
n n file.
b r l i c
PaymentValidationServiceBusApp.jws
c. Expand the
Z am a b e
folders in lApplication Navigator, and you should see the folder structure
s t or sfer
resembling the image below:
Ne -tran
non
s a
) h a
The Create REST binding wizard appears.
c o m d e ฺ
b. Name the service PaymentValidationRS. a il ฺ u i
m t G
ot deSOA
c. Add a description, for example “RestService to ValidatePayment
h n service.”
7 5@ icon.S tu
am e this
d. Select the validate operation and click the edit
r z
to o us
e s
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
n pipeline you expose is WSDL based and has an underlying “CanonicalOrder”
noTheschema as its structure. Your binding automatically takes this shape.
f. Click the HTTP Verb drop-down list. Note that you can create bindings for all of the
standard verbs. Retain GET HTTP verb for this lab.
g. Remove some of the auto-created parameters for the purposes of this lab. You will not
use all of them.
h. Remove all parameters besides CardNum, CardName, ExpireDate, and
AuthorizationAmount. (You can hold down the CTRL key and click the items in the list
to choose them)
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b r an licen
Z amrenamed
Even with the
b l eCardNumber parameter, it still maps to the same underlying
fera tab.
expression.
j. es torthe nResponse
Click s
tra is also based on the same underlying schema.
N The-response
n
k.noRetain the status code of 200 for HTTP status code.
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
7 5@ s Stu
r z am e thi
e s to o us
o (n se t
b ran licen
Z am rable
m. s t
You orcan click
s feGenerate Sample Payload to view a sample of the selected response
e tra
N payload. n
n -
no
Once you are satisfied with your Operation binding, click OK.
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
n. Click OK.
Now you have two proxy services for the same pipeline to support SOAP/XML,
REST/XML, and REST/JSON using the same backend service.
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
d.no
n
Click Execute.
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
e. o n Back.
n Click
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
g. Click Execute.
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
4. e s to and
When you are done, close the application o uallsopen windows of this project.
( n t
a n o e n se
m br le lic
Z a rab
r
e sto ansfe
N -tr
non
s a
) h a
c o m d e ฺ
a il ฺ u i
Practices for m t G
h ot Lesson
d e n 11:
Reliable
7 tu
5@Messaging
S
r z am e11 this
Chapter
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
General Notes
There are no notes.
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
s a
) h a
c o m d e ฺ
a il ฺ u i
Practices for m t G
h ot Lesson
d e n 12:
Service
7 5@BusS tu
Security
r z am e12 this
Chapter
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
Tasks
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ
1. Create a user in WebLogic Server (WLS) by using Enterprise Manager. The Service Bus
proxy uses the WLS default authenticator to authenticate the username and password in
the WS-Security SOAP Headers received from the client. The user created using Enterprise
Manager is available to the WLS default authenticator.
a. In the Enterprise Manager console, right-click DefaultDomain and select Security >
Users and Groups.
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
c. Click Create Map.
s a
d. Add the following name: oracle.wsm.security, and click OK. ) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
t or the oracle.wsm.security
e. Select
s s fe map and click Create Key.
e
N -tra n
non
f. On the Create Key page, specify the following options and then click OK.
Map: oracle.wsm.security
s a
) h a
c o m deฺ
a il ฺ
G ui
tm hasenbeen
You should see the message: “The credential key, joe-key,
o t created.”
g. Expand oracle.wsm.security and you should see@ h
joe-key.tud
7 5 s S
m h i
t o rza use t
( n es to
a n o ense
m br le lic
Z a rab
r
e sto ansfe
N -tr
non
following steps:
• Protect the ValidatePayment web service by using the
oracle/wss10_saml_token_service_policy service Oracle WSM policy.
• Update and attach the business service in Oracle Service Bus with the
oracle/wss10_saml_token_client_policy client Oracle WSM policy.
Tasks
1. Add an SAML service Oracle WSM policy to the ValidatePayment web service.
a. In the Target Navigation panel of EM console, expand SOA > soa-infra > default, and a
select ValidatePayment [1.0].
h a s
)
b. On the ValidatePayment home page, select Policies tab.
m ฺ
ฺ c o i d e
a il
c. Click the Attach To/Detach From drop-down menu, and select
G u
validatePaymentprocess_client_ep. m
ot den t
h
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
d. In the Attach/Detach Policies window, locate and select
oracle/wss10_saml_token_service_policy in the Available Policies panel, and
then click Attach.
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
7 5@ s Stu
r z am e thi
e s to o us
o (n se t
ranselected n displayed in the Directly Attached Policies panel.
cepolicy
You should see bthe l i
e. Click OK.am b le
Z
or that the a
r is attached to the service.
epolicy
t
Verify
s s f
Ne -tran
non
s a
a
) h it ฺin
d. In the Application navigator, double-click PaymentValidation_Securitym to open e
o
Service Bus Overview editor.
a ilฺc Guid
h otm dent
7 5@ s Stu
r z am e thi
e s to o us
o (n se t
b ran licen
amtherabusiness
e. Double_click
Z b le service to open its configuration editor.
f. Click
s t orthe Policies
s f e tab.
anPolicies tab, select From OWSM Policy Store, and then click Add Security
Ng. e policies
Underrthe
- t
non
(the plus icon).
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
s a
) h a
c o m d e ฺ
a il ฺ u i
i. Verify that the policy is attached.
m t G
h ot den
7 5@ s Stu
r z am e thi
e s to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
Tasks
1. Add User Name Token Service Oracle WSM policy to the proxy service.
a. In the PaymentValidation_Security Service Bus Overview editor, double click the proxy
service to open its configuration editor.
b. Click the Policies tab.
c. Under the Policies tab, select From OWSM Policy Store, and then click Add Security
policies (the plus icon).
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
s a
) h a
c o m deฺ
e. Verify that the policy is attached. a il ฺ
G ui
h otm dent
7 5@ s Stu
r z am e thi
e s to o us
o (n se t
b ran licen
Z m ble
aproject.
f. Saveryour
t o f e ra
s an s
TestNe tr
n -
no a positive test and a negative test to confirm the Oracle WSM security (User Name
1 Perform
Token policy) implementation on the proxy service.
2. In the Service Bus Overview Editor, right-click the proxy service, and select Run.
3. In the Test Console, choose /home/oracle/labs_DI/resources/sample_input/
PaymentInfoSample_Authorized.xml as the test file.
Since the CreditCardService_Proxy proxy service is attached with the User Name Token
Oracle WSM policy, you notice a Security section in the Test Console with an
oracle/wss_username_token_client_policy policy name and with a csf-key property.
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
e s to o us
o (n se t
Note that the mapping
b r n csf-key
ajoe-keyl i c en with the credentials joe/welcome1 is already
created by usingm EM consolel e in the previous practice.
Z a b
a proxy service.
rthe
5.
t o r to ftest
Click Execute
e
s asee s
n that the payment status is “Authorized” in the response message.
NYoue should
- t r
non
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot tab.den
c. On the “Settings for User: joe” page, click the Passwords
7 5@ s Stu
r z am e thi
e s to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
s a
) h a
c o m deฺ
il
e. Go back to the Service Bus Test Console in JDeveloper, andaexecute
ฺ i
theusame test
tm see
case (the one you performed for the positive test). Youoshould nthe
G
t request fail with
the following response, as joe’s password does @ h e
udvalue used in the
not match tthe
7 5 S
this
Credential Map.
z a m
r
to o us e
e s
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
9. When you are done, close the application and all open windows of the project.
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
s a
) h a
c o m d e ฺ
a il ฺ u i
Practices for m t G
h ot Lesson
d e n 13:
Advanced
7 tu
5@ sTopics
S
r z am e13 thi
Chapter
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
external service for the same request. Instead, it takes the response from cache which improves
OSB performance.
In this practice, you use ValidatePayment as the back-end service, but with an added wait
activity of 30 seconds. So when the business service is invoked for the first time, it should
take over 30 seconds to return the response, and when the business service gets called the
next time with the same request, it should not take more than 1-5 seconds as it would get
the response from the cache.
Assumptions
s a
Tasks
) h a
1. In a terminal window, enter the following commands:
c o m deฺ
>cd ~/labs_DI/lessons/lesson13 a il ฺ
G ui
>ls –l
h otm dent
>$HOME/labs_DI/resources/Scripts/deploy.sh
7 5@ s Stu
sca_ValidatePaymentCaching_rev1.0.jar
The build and deployment informationo r z
will
am e thini the console. You should see a
be displayed
message showing both build ande st toexecuted
deploying us successfully.
2. Test the deployed service o (
in EM
n se
a n
r In lTargete n
bdeployed
a. Open the EM console.
m e ic Navigator, expand SOA > soa-infra > default. Now you
should see
Z a rab
the l composite application ValidatePayment_Cachingt[1.0] in the
s t or sfe
folder.
Ne -tran
non
c. Expand the folders in Application Navigator, and you should see the folder structure
resembling the image below:
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
7 5@ s Stu
r z am e thi
4. Configure the business service
e s to o us
(n se t to open it in Overview Editor.
a. Double-click PaymentValidation_RCaching
o
b ran service
b. Right-click the business
l i cenand select Edit from the context menu.
Z am service
c. In the business
a b leeditor, select Transport tab.
sNote
t er URIs are still pointing to the ValidatePayment SOA service.
orthat thesfendpoint
Nd. e just
Change
t r n URIs to the endpoint URLs of ValidatePayment_Caching service that you
athe
n -deployed:
nohttp://<yourhostname>:7101/soa-
infra/services/default/ValidatePayment_Caching/validatepaymentpr
ocess_client_ep
e. Click the Performance tab.
f. Check the box next to Enable Result Caching.
g. Specify Cache Token.
1) Open XQuery Expression Editor by clicking next to Cache Token Expression.
2) For variables, navigate to body > validate > $body – request >PaymentInfo, and
select CardNum.
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z m ble
aOK.
4) Click
t o r f e ra
s s
Ne -tran
non
s a
) h a
c o m deฺ
5. To test your Service Bus application, do as follows: a il ฺ
G ui
a. Right-click the proxy service, and select Run. h otm dent
b. In the Test console, select
7 5@ s Stu
payload. r z am e thi
~/labs_DI/resources/sample_input/PaymentInfoSample_Authorized.xml for the request
e s to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
e s to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
on
d.n After the first test, click Back.
e. Test you proxy with the same request. Now you should get the response immediately
as the business service takes the response from the cache this time.
6. When you are done, close the application and all open windows of the project.
In this practice, you add an SLA alert when the status of the endpoint changes from up to down.
High-level steps:
• Add an SLA for Errors > 0 to the PaymentValidationBS Business Service.
• Stop the PaymentValidationBS Composite.
• Test the PaymentValidationRS proxy service.
• Observe SLA in the dashboard.
Assumptions
The PaymentValidation service bus application is deployed and running. s a
) h a
Tasks
c o m d e ฺ
a il
1. Enable monitoring and SLA for PaymentValidationBS business service. ฺ u i
m t G
a. Open EM Console in a browser.
h ot den
5@ folder,
b. In Target Navigator, navigate to SOA > service-bus
S u select
tand
PaymentValidation. 7
m this
r z aappears.
The Service Health page for the project
s t o u se
c. Click the Operations tab. ne to
( e
r a no cens
m b le li
a
t o r Z ferab
s s
Ne -tran
non
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
(n business
e tservice, do as follows:
e. On the Properties tab o
of the s
b ran licen
1) Enable Monitoring.
am rabInterval
2) SetZAggregation le to 1 minute.
s t or sfe
Ne -tran
non
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
e s to o us
o (n se t
b ran licen
Z amto applya b le changes.
f. ClickrApply
s t oSLA Alerts
s f eforr the PaymentValidationBS business service.
your
2.
Na. e Open
Define
- t r an Bus Console.
Service
on
b.n Create a session by clicking the Create button (on the top-right of the page).
Whenever you want to make changes, you need to create a session which contains a
transaction of all of our changes.
c. Before defining SLA Alert, create an alert destination.
1) In the navigator, right-click PaymentValidation and select Create > Alert
Destination.
2) In the Create Alert Destination dialog, enter AlertDestination for Resource
Name.
3) Click Create.
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
5) Click Save.
b ran licen
amthatratheblfile
You see
Z e is added to the project folder.
s t or sfe
Ne -tran
non
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
e s to o us
o (n se t
b ran licen
Z am rable
s t or sfe
an
Nk. e Click-tNext.
r
on
l. n On the Rule Condition page, set the condition aggregation interval to 1 minute.
m. Click the Add button to add a condition.
s a
o. Click the update rule condition button.
) h a
p. With the rule updated, click the Create button.
c o m d e ฺ
q. Save your work.
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
e s to o us
o (n se t
r a n cen
3. m b
Activate the session li a description.
and include
l e
a
t o r Z ferab
s s
Ne -tran
non
4. Now return to Enterprise Manager to test the SLA Alert. To set off an alert, you need to
shutdown the ValidatePayment composite.
a. Select the composite in Enterprise Manager under SOA->soa-infra->default-
>ValidatePayment
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
7 5@ s Stu
r z am e thi
e s to o us
o (n se t
b ran licen
f. Back in EM
Z am le the SOA ->service bus (DefaultServer) folder.
console, click
a b
s t r service-bus
osee
In the
s f er home page, make sure that SLA Alerts is selected. At first, you may
Ne yet.-This
not
t r anis normal. Just clickthe
any results because interval has not passed and the stats are not collected
the refresh button on the upper right-hand side of the
n
nodashboard every 30 seconds or so.
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
6. r z
Once you finish the test, start the ValidatePayment thi
am ecomposite.
e s to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
Tasks
non–v
>mvn
You should see an output similar to the following:
Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da;
2013-02-19 13:51:28+0000)
Maven home:
/u01/app/oracle/fmw_dev/12.1.3.0.0/oracle_common/modules/org.apa
che.maven_3.0.5
Java version: 1.7.0_71, vendor: Oracle Corporation
Java home: /usr/java/jdk1.7.0_71/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.8.13-16.2.1.el6uek.x86_64", arch:
"amd64", family: "unix"
non inthetheBuild
Besides
created
Success message, you should also see the archetype-catalog.xml file
$HOME/.m2 folder.
Now you are able to create a new Service Bus project from a Maven archetype.
s a
) h a
c o m deฺ
a il ฺ
G ui
h otm dent
7 5@ s Stu
r z am e thi
f. Click the Browse button next to the
e s to Maveno u s
Archetype field.
The Search for Archetype(n t
dialog box opens.
e Because there is no internet connection,
o n s
rathen search
you can only use local repository.
g. Type servicebin l i cefield.
Z amArchetypes
The Matching a b le panel is updated with the search result.
s t or sfer
Ne -tran
non
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
i. Click OK. 7 5@ s Stu
z amwizard,
Back in the Create Project from Archetype
r e ththei Maven Archetype field is
s
populated with the archetype you
e toselected.
o us
( n t
j. Click Next.
a n o e n sofethis archetype: ValidatePaymentMV.
m br ledialog
k. Provide the required projectName
lic box is displayed.
Z a rab
The Create Application
r
e sto ansfe
N -tr
non
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
e s to o us
o (n se t
You can open each
b ranpom filel i ctoenview its details.
9. Now you can a
Z m the ValidatePaymentMV
build
b le Service Bus project (under the
o r
ValidatePaymentMV
f e r a
folder). The high level steps are:
t s
sCreateafolders
n and import artifacts: ValidatePayment-concrete.wsdl and
Na. e CanonicalOrder.xsd.
t r
n o n-
b. Create the business service.
c. Create the simple pass-through proxy service.
Note: If you still need detailed instructions, please refer to Practice 3-2: Step 4 through
Step 20.
s a
) h a
c o m d e ฺ
a il ฺ u i
m t G
h ot den
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non
The Maven Package phase creates a SBAR file, sbconfig.sbar from your project, and
places it in the following directory:
<project_folder>/.data/maven/
s a
In your case, it is:
) h a
~/labs_DI/lessons/lesson03/ValidationServiceMVApp/
c o m d e ฺ
ValidatePaymentMV/.data/maven/
a il ฺ u i
m t G
ot den
11. When you are done, close the application and all open windows of this project.
h
7 5@ s Stu
r z am e thi
es to o us
o (n se t
b ran licen
Z am rable
s t or sfe
Ne -tran
non