Sie sind auf Seite 1von 392

Updated: 7.9.

2014 16:50:46

SOA Suite12c Tutorial


Oracle

Page 1 of 392

SOA Suite 12c Tutorial


Table of Contents
SOA Suite 12c Tutorial Overview .................................................................................................................. 6
Chapter 1: Quick Start Install ....................................................................................................................... 7
SOA Suite 12c Documentation .................................................................................................................. 7
Chapter 2: Validate Payment ....................................................................................................................... 8
Overview ................................................................................................................................................... 8
Prerequisites ............................................................................................................................................. 9
Part 1: Build SOA Composite ..................................................................................................................... 9
High-Level Steps ...................................................................................................................................... 11
SOA Templates ........................................................................................................................................ 11
Steps in Detail ......................................................................................................................................... 14
Create a new composite application and project ............................................................................... 14
Create a database connection for adapter to retrieve payment information.................................... 20
Review the validatePayment BPEL process ........................................................................................ 24
Calculate payment status using an XSLT map (custom activity template) ......................................... 27
Add a composite sensor for payment status ...................................................................................... 37
Deploy the SOA composite ................................................................................................................. 42
Debug a SOA project in JDeveloper ........................................................................................................ 43
Test the SOA composite ...................................................................................................................... 53
Part 2: Register Composite on Service Bus ............................................................................................ 54
High-Level Steps ...................................................................................................................................... 54
Steps in Detail ......................................................................................................................................... 55
Create a new service bus application and project .............................................................................. 55
Create folders and import artifacts..................................................................................................... 59
Configure Business Service for validatePayment composite. ............................................................. 65
Tip and Trick How to find composite deployment URI .................................................................... 69
Review Business Service Properties .................................................................................................... 70
Configure Proxy and Pipeline .............................................................................................................. 71
Deploy and Test .................................................................................................................................. 75

Chapter 1: Quick Start Install

Page 2 of 392

Chapter 3: Process Order ........................................................................................................................... 78


Overview ................................................................................................................................................. 78
Prerequisites ........................................................................................................................................... 79
Part 1: Build Process Order Composite ................................................................................................... 80
High-Level Steps ...................................................................................................................................... 80
Steps in Detail ......................................................................................................................................... 81
Import template .................................................................................................................................. 81
Create a new project ProcessOrder from a project template ............................................................ 82
Add the payment validation ............................................................................................................... 84
Update the order status in the Database ........................................................................................... 99
Use an inline BPEL subprocess for the order status update ............................................................. 100
Add an Order Number sensor to the Order Process composite ....................................................... 106
Update the order status to ReadyForShip if the payment has been authorized .......................... 109
Part 2: Register Process Order on Service Bus ..................................................................................... 117
High-Level Steps .................................................................................................................................... 117
Steps in Detail ....................................................................................................................................... 117
Open existing service bus application and import template resources ........................................... 117
Register ProcessOrder composite as a business service................................................................... 122
Create new pipeline with proxy using a pipeline template .............................................................. 125
Test end-to-end................................................................................................................................. 137
Chapter 4: Add New Order Channel ......................................................................................................... 138
Overview ............................................................................................................................................... 138
Prerequisites ......................................................................................................................................... 138
Part 1: Add file adapter proxy and wire to pipeline............................................................................. 139
High-Level Steps .................................................................................................................................... 139
Steps in Detail ....................................................................................................................................... 139
Configure Proxy for File Adapter....................................................................................................... 139
Wire to the existing Process Order Pipeline and Business Service. .................................................. 151
Test your service. .............................................................................................................................. 153
Part 2: Review Service Bus in Enterprise Manager .............................................................................. 154
High-Level Steps .................................................................................................................................... 154
Steps in Detail ....................................................................................................................................... 154
Bring up Enterprise Manager and navigate to Service Bus ............................................................... 154

Chapter 1: Quick Start Install

Page 3 of 392

Enable monitoring on all services in the Operations tab. ................................................................. 156


Review the various monitoring tabs ................................................................................................. 157
Review Message Reports .................................................................................................................. 159
Part 3: Service Bus Debugger ............................................................................................................... 163
High-Level Steps .................................................................................................................................... 163
Steps in Detail ....................................................................................................................................... 163
Part 4 Advanced: Build the nXSD translation from scratch ............................................................... 167
High-Level Steps .................................................................................................................................... 167
Steps in Detail ....................................................................................................................................... 167
Bring up the Native Format Builder .................................................................................................. 167
Chapter 5: Pack and Ship Service .............................................................................................................. 191
Overview ............................................................................................................................................... 191
Prerequisites ......................................................................................................................................... 191
Introduction .......................................................................................................................................... 193
High-level steps ..................................................................................................................................... 194
Steps in Detail ....................................................................................................................................... 195
Create the Packing Service project ................................................................................................... 195
Define a REST interface for the Packing Service Project ....................................................................... 198
Create the Packing BPEL process .......................................................................................................... 209
Test the REST service in JDeveloper...................................................................................................... 223
Update the order status in the database .............................................................................................. 228
Add a composite sensor ........................................................................................................................ 235
Send an Email Notification .................................................................................................................... 238
Check email notification ................................................................................................................... 246
UMS Setup and Configuration .............................................................................................................. 248
Download and configure Apache James 2.3.2 .................................................................................. 248
Configure the email server................................................................................................................ 248
Start the email server........................................................................................................................ 248
Stop the email server (when needed)............................................................................................... 249
Target the UMS and Coherence adapter .......................................................................................... 249
Configure the UMS Adapter to use the Apache James server .......................................................... 250
Chapter 6: Fulfill Order ............................................................................................................................. 254
Overview ............................................................................................................................................... 254

Chapter 1: Quick Start Install

Page 4 of 392

Prerequisites ......................................................................................................................................... 254


Introduction .......................................................................................................................................... 256
High-Level Steps .................................................................................................................................... 257
Steps in Detail ....................................................................................................................................... 258
Create the FulfillOrder project from SOA project template ................................................................. 258
Get familiar with the FulfillOrder project ............................................................................................. 260
Determine the Shipping Method through Business Rules .................................................................... 262
Add a composite sensor to the fulfillOrder composite......................................................................... 284
Call the pack and shipping service ........................................................................................................ 288
Add the coherence lookup for the Shipping Provider .......................................................................... 298
Appendix: Deploy, Test and Monitor Tutorial projects ............................................................................ 322
Introduction .......................................................................................................................................... 322
Start the Integrated WebLogic Server in JDeveloper............................................................................ 323
Stop the Integrated WebLogic Server in JDeveloper ............................................................................ 324
Check the audit level on the SOA Server .............................................................................................. 325
Deploy Chapter Solutions ..................................................................................................................... 328
Deploy SOA Projects to the Application Server .................................................................................... 329
Test the SOA project with EM Fusion Middleware Control .................................................................. 334
Flow instances in EM Fusion Middleware Control................................................................................ 340
Debug a SOA project in JDeveloper ...................................................................................................... 349
Test the application in JDeveloper with HTTPAnalyzer ........................................................................ 359
Define and run SOA Composite Test in JDeveloper .............................................................................. 364
Take a tour of Enterprise Manager Fusion Middleware Control .......................................................... 375
Run SOA test in EM FMWC ................................................................................................................... 377
Getting the service description (WSDL) of your project ....................................................................... 382
Getting the service WADL of your REST project ................................................................................... 383
Access the Database from JDeveloper .................................................................................................. 384
Create a Connection to Oracle WebLogic Server to deploy to a non-Integrated WebLogic Server ..... 388

Chapter 1: Quick Start Install

Page 5 of 392

SOA Suite 12c Tutorial Overview


The activities in this document aim to introduce you to key new features of SOA Suite 12c:

Quick Start install process Integrated Server

Everything in JDeveloper SOA and Service Bus

Templates

Debugger, Testing

REST enablement of services

New Adapters

More

Chapter 1: Quick Start Install

Page 6 of 392

Chapter 1: Quick Start Install


Please follow the new Developer Quick Start install guide available at
http://www.oracle.com/pls/topic/lookup?ctx=fmw121300&id=SOAQS to complete the installation.
The installer will:

Install all components necessary for development with the core of SOA Suite (BPEL, rules,
mediator, human work flow, service bus)

Launch JDeveloper after the installation, automatically registering the IDE plug-ins for SOA and
Service Bus.

Have e2e-1201-orderprocessing sample application ready for review, run and deploy.
Please note, while SOA Suite 12c greatly simplifies the initial developer install experience for SOA Suite,
all the flexibility and power of domain configuration that was available in 11g is preserved.
Your environment will look like the following within your developer desktop when you are done
typically in about 30 minutes:

SOA Suite 12c Documentation


SOA Suite 12c Documentation is available to view, and download (PDF, Mobi, ePub) from:
http://docs.oracle.com/middleware/1213/index.html

Chapter 1: Quick Start Install

Page 7 of 392

Oracle Confidential Do not distribute to third parties

Chapter 2: Validate Payment


Overview
Avitek has embarked upon an IT modernization project to align with business goals of improving
customer satisfaction. A key area of improvement will be streamlining the order process to provide
better visibility tracking orders through credit approvals, fulfillment, shipment and delivery.
One key issue in the current system is that credit card payments are often denied for various,
sometimes minor reasons, such as expiration date, etc. Since the process to correct these issues varies
across Aviteks order entry systems, there is no consistent follow-up and resolution with customers.
Orders may end up lost or delayed in the system leading to customer dissatisfaction.
The business has indicated a new credit card fraud detection system must be put in place before years
end to thwart credit card abuses. A consistent fraud mechanism will require the credit validation
process to be consolidated across all order entry systems.
The first step will be to provide a consistent interface to all order entry applications for credit validation.
Initially, the consolidated credit validation service will be hosted in-house to control quality; however,
once the interface is stabilized, this service will be outsourced to a 3rd party provider. In the future,
when Avitek decides to outsource credit validation to an external provider, this can be accomplished
without impacting existing applications.
In this chapter, you will build your first SOA Suite 12c project. At the end of this chapter, your solution
will look like the following from an architectural perspective.

Page 8 of 392

Chapter 2: Validate Payment: Build SOA Composites

Oracle Confidential Do not distribute to third parties

Prerequisites

Developer (QuickStart) installation is complete. JDeveloper is up and running with The


integrated WLS server started. If you need to stop and re-start the server, please follow the
instructions in the Appendix of this document.

Tutorial resources have been downloaded and unzipped to a directory of your choice. When
referring to any resources in the following chapters (for example wsdl or sample input), we will
always refer directories relative to the unzipped location as ~/e2e-1201-orderprocessing. For
example ~/e2e-1201-orderprocessing/sample-input/input.xml.

Part 1: Build a SOA Composite


In this section, you will build your first Oracle SOA Suite 12c composite to validate a credit card
payment.
In this composite, credit card payments will be validated and the payment status will be returned. If the
payment is denied, the order will not be processed.
Once done, your project should resemble the following.

All available credit cards will be stored in the database, including payment type, card number, expiry
date, card name and daily limit.
The incoming order message includes the credit card information.
For example, the payment part of the order message would look like this:
<soas:Billing>
<soas:CardPaymentType>1</soas:CardPaymentType>
<soas:CardNum>1234123412341234</soas:CardNum>
<soas:ExpireDate>0316</soas:ExpireDate>
<soas:CardName>AMEX</soas:CardName>
<soas:BillingAddress>
<soas:FirstName>Daniel</soas:FirstName>
<soas:LastName>Day-Lewis</soas:LastName>
<soas:AddressLine>555 Beverly Lane</soas:AddressLine>
<soas:City>Hollywood</soas:City>
<soas:State>CA</soas:State>
<soas:ZipCode>12345</soas:ZipCode>
Page 9 of 392

Chapter 2: Validate Payment: Build SOA Composites

<soas:PhoneNumber>5127691108</soas:PhoneNumber>
</soas:BillingAddress>
</soas:Billing>

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 if 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 its denied.
The implementation of this service uses a BPEL process to retrieve the credit card data from the
database and perform the tests outlined above. The service will return either Authorized or Denied as
the payment status.

Chapter 2: Validate Payment: Build SOA Composites

Page 10 of 392

High-Level Steps

Create a new composite application e2e-1201-composites and SOA project ValidatePayment.

Leverage the new SOA Project template to create the ValidatePayment composite.

Review the various components of the composite.

Add a database connection to Java DB.

Import a custom activity template with an XSLT map to determine the payment status
(Authorized or Denied), based on the daily limit and the total amount of order.

Add a composite sensor PaymentStatus for the payment status

Deploy the project

Use Debugger in JDeveloper.

Test the project

SOA Templates
In SOA Suite 12c, we have a number of new features to improve sharing of common code between
teams, departments or even from a partner to a customer. Part of that is the new SOA Templates
feature. As the name suggests, they will be used as starting points in the development of SOA
applications.
These templates will either be the foundation of a project or can be added to an existing project. From
that point on it will not be visible anymore that a template has been used.
All changes made after the import point will not be reflected in the original template.
The SOA templates come in three flavors:

Project templates: They include a complete project with all components and resources used and
will be used when creating a new project in your SOA application.

Component templates: A component with all references resources and components. For
example, a BPEL process that calls a business rule or adapter can be packaged as component
template. The component does not have to be complete and does not have to compile. A
component template can be added to an existing project.
Component templates will be visible in the composite palette if theyre available in the template
path, configured in JDev.

Custom activity templates: A scope in a BPEL process, which may include an invoke/receive
from/to a partnerlink, can be packaged as a custom BPEL activity. For example, an assign activity
and a call to an adapter. Those custom activities will be available in the BPEL palette.

To learn more, please see Introduction to Oracle SOA Suite Templates.

Chapter 2: Validate Payment: Build SOA Composites

Page 11 of 392

In this section, we will provide the ValidatePayment composite as a SOA Project template.
In order to leverage templates, please follow the steps below:

SOA templates that are located in the default directory (e.g.


$MW_HOME\jdeveloper\integration\templates) will be recognized automatically. Additional
directories can be added.

As the templates used for the labs have been unpacked into the ~/e2e-1201orderprocessing/templates/ folder, we will add this directory to the list of folders that are
scanned for templates.

In the main JDeveloper menu, please go to Tools Preferences.

In the Preferences window, go to SOA Templates. (If you do not see SOA in the
preferences, then you could create a new application, or open an existing one. This will load up
SOA libraries, SOA preference will show up).

Chapter 2: Validate Payment: Build SOA Composites

Page 12 of 392

Click the + button, to add folder.

Navigate to ~/e2e-1201-orderprocessing/ templates.

Click Select to accept your choice.

Click OK to close the Preferences window.

Chapter 2: Validate Payment: Build SOA Composites

Page 13 of 392

Steps in Detail
Create a new composite application and project
Create a new application. There are various ways and shortcuts to do this, and in this case choose File >
New > Application from the menu.

From the Categories tree, click on General > Applications.

Select SOA Application from the Items field.

Click OK.

In the subsequent dialog for Create SOA Application, set the following fields, leaving the others
with their default values:
a.

Application Name: e2e-1201-composites

b.

Directory of your choice.

Chapter 2: Validate Payment: Build SOA Composites

Page 14 of 392

Click Next.

When you create a new application, you are prompted to create a new project. Set the following
fields:
a. Project Name: ValidatePayment
b. Keep the default Directory
c. Project Features: SOA Suite

Click Next.

The next step allows you to pick either a Standard Composite, or a SOA Template. Choose
SOA Template.

Chapter 2: Validate Payment: Build SOA Composites

Page 15 of 392

Select ValidatePaymentTemplate. Click Finish.

A new project ValidatePayment is created with some predefined components as derived from
the template. You now have a canvas displaying three swim lanes: services, components, and
references.

Chapter 2: Validate Payment: Build SOA Composites

Page 16 of 392

On the left hand side, you will see the Application Navigator, which shows all resources
included in a SOA project.

This Navigator has been reorganized in SOA Suite 12c to make it easier to find all files related to
SOA, and also to provide the option to customize the folder structure.

You will see a SOA folder under the project root. This is where all SOA related files and folders
are stored, such as BPEL processes, schema files, WSDL files.

The composite.xml, which defines the structure of the composite, is located directly under the
SOA folder. In previous releases, this file was just shown as composite.xml. This became
confusing when several composite.xml files from different projects were open at the same time.

In SOA Suite 12c, we now display the project name in the navigator and in the composite tab
label. It is displayed as ValidatePayment here.

Chapter 2: Validate Payment: Build SOA Composites

Page 17 of 392

Concrete wsdls are supported for


SOA composites now
Composite.xml is labeled same as
the project name

The SOA folder has a number of subfolders with default names, which hold common SOA
artifacts viz. BPEL, XML schemas, WSDL files, transformation-related files and events.

You will see new subfolders created when creating new components.

The structure and names of the subfolders can be customized to your liking, as long as all folders
are located under SOA.

For more information about the Application Navigator, please see Getting Started with Developing
SOA Composite Applications.

Chapter 2: Validate Payment: Build SOA Composites

Page 18 of 392

The composite diagram looks like this.

The External References swim lane contains the getpaymentInformation database adapter.
This step will provide the payment information from the database, using the credit card number
as the key. Based on expiry date, daily limit, and total amount of order, we will then calculate
whether the payment is authorized or denied.
The database adapter will process your choices, and provides a service that implements the
operation specified. The WSDL file to represent that service is getPaymentInformation.wsdl.
You can see the .jca file of the getPaymentInformation database adapter, together with two
XML files under the Adapters subfolder and the WSDL file of the getPaymentInformation
service under the WSDLs subfolder.
A schema file getPaymentInformation_table.xsd has also been created. This is used to set the
input and output variable for the DB adapter call.

In the center (components swim lane) is the validatePayment BPEL Process - it is the
component in charge of the orchestration in the SOA Suite. You will add a BPEL Process
component to orchestrate a request to the service you just created with the database adapter.
In SOA Suite 12c, BPEL process supports concrete wsdl. This BPEL process will make use of two
resource files: ValidatePayment-concrete.wsdl and CanonicalOrder.xsd.
SOA Suite 12c supports BPEL 1.1 and BPEL 2.0 and the default version is BPEL 2.0.

The Exposed Service validatepaymentprocess_client_ep is the external client web service that
will provide input to the BPEL process.

Chapter 2: Validate Payment: Build SOA Composites

Page 19 of 392

Create a database connection for adapter to retrieve payment information


Note: Make sure your integrated server is running before doing this step, otherwise Java DB will not be
available.

The first step will provide the payment information from the database, using the credit card number
as the key. Based on expiry date, daily limit, and total amount of order, we will then calculate
whether the payment is authorized or denied.

The database adapter getpaymentInformation will connect to the SOA database. In order to do
that, it needs a connection which contains all the details needed to connect to the database. The
template does not carry the connection information it leverages the connection(s) configured for
the application.

Chapter 2: Validate Payment: Build SOA Composites

Page 20 of 392

In the Create Database Connection dialog, enter the following details

Create Connection In: Application Resources

Connection Name: SOA

Connection Type: Java DB (Derby)

Chapter 2: Validate Payment: Build SOA Composites

Page 21 of 392

Server Name (localhost), Port (1527) and Database (soainfra) for the preconfigured Java DB are
filled in automatically.

Click the Test Connection button and verify that your connection works.

You should see Success! like in the screenshot below

Click OK.

Make sure you save all changes by clicking the Save All icon at the top of JDeveloper.

Chapter 2: Validate Payment: Build SOA Composites

Page 22 of 392

Now build your project:


o

Click on Build in the main menu

Select Make ValidatePayment.jpr

You will see the build result in the Messages Log window (at the bottom of JDeveloper)

If you get an error like the one below, then something is wrong in your composite and it
needs to be fixed.

If your log looks like this, everything is fine:

Chapter 2: Validate Payment: Build SOA Composites

Page 23 of 392

Review the validatePayment BPEL process

Double-click the BPEL process to open the BPEL designer.

Notice the getPaymentInformation partnerlink already in the Partner Links swim lane. It is also
connected via the Invoke activity.

The input and output variables for the adapter call are also defined. They are leveraged when the
DB adapter is invoked.

We use Invoke activities when communicating with services, like adapters and web services.

When defining an invoke activity, you can have the input (and output) variable created
automatically. You can review these invoke activity and the variables using the new Property
Inspector (see How To Edit BPEL Activities in the Property Inspector in soa-dev-guide.pdf).

Chapter 2: Validate Payment: Build SOA Composites

Page 24 of 392

If the Property Inspector window is not open, go to Window Properties.

If the window is open on the right hand side, you may want to drag and drop it into the middle
at the bottom. On the left hand side of the property inspector you will see the same tabs as you
would see when opening the activity for editing.

The variable designated for the input will contain the data (the credit card number) that will be
sent to the service when it is invoked. It is automatically created with the correct type expected
by the service.
The name of the variable is fairly long as its a concatenation of the partner link name, the
operation and InputVariable.

Similarly inspect the Output Variable by changing to the Output tab.


These variables will be used when interacting with the getPaymentInformation service. The
output variable will be populated when the service returns a result, but you need to populate
the input variable yourself.

Chapter 2: Validate Payment: Build SOA Composites

Page 25 of 392

In the BPEL process, just above the invoke activity, is the Assign activity setCreditCardNumber. You
use an Assign activity to assign data to a variable. In this case, the credit card number is assigned
that was passed into the BPEL process to the getPaymentInformation service.

The assign activity is one of the few activities where you cannot define everything in the property
inspector. We need to launch the Assign Editor.

It assigns the credit card number in the incoming payment information (in the process input
variable) to the input variable of the database adapter.

On the left hand side (source), expand the variable Variables > Process > Variables > inputVariable >
paymentInfo > ns3:PaymentInfo > ns3:CardNum

On the right hand side (target), expand Variables > Process > Variables >
getPaymentInformation_getPaymentInformationSelect_InputVariable >
getPaymentInformationSelect_inputParameters > ns4:ccnb

Note the mapping from ns3:CardNum on the left to ns4:ccnb on the right.

This creates a new copy rule, which can be seen at the bottom of the editor.

Click OK to return to the BPEL process.

We dont need an assign activity for the output variable as we will define an XSLT map to determine if
the payment is valid, based on the information returned by the database adapter.
Make sure to save everything before you continue.

Chapter 2: Validate Payment: Build SOA Composites

Page 26 of 392

Calculate payment status using an XSLT map (custom activity template)

We provide an XSLT transformation to determine if the payment is valid, based on the daily
limit (retrieved from the database) and the total order amount (authorization amount in the
order message, which has been calculated in the process order project by multiplying price and
amount of every order item and adding them up).

The total amount of the order has to be smaller than the daily limit on the credit card.

In this module, the XSLT transformation is provided as a custom activity template.


In order to use the customer BPEL activity template, the directory should be included in the Tools
Preferences SOA Templates. We already mapped the folder in a prior section when project
template was used.

In your BPEL process, expand the Custom Activity Templates section in the BPEL activity palette.

If you dont see the template, close and reopen the BPEL process.

You should see the CalculatePaymentStatusScope template in the list.

Drag and drop the CalculatePaymentStatusScope template under the getPaymentInformation


invoke activity in the validatePaymentProcess BPEL process.

Chapter 2: Validate Payment: Build SOA Composites

Page 27 of 392

The template dialog shows you the Name and the Description of the template and all artifacts
that are included. You will also see a list of conflicts: The template includes the
CanonicalOrder.xsd, getPaymentInformation_table.xsd, and getPaymentInformation.wsdl
which are already present in the composite:

Chapter 2: Validate Payment: Build SOA Composites

Page 28 of 392

You have the option to skip all conflict files, meaning you keep the ones in the composite, or
overwrite all with those in the template. You can also make this decision individually.

In this case we know that the files are identical and will skip all:

Select Skip All and click OK.

Adding the custom activity template creates a new scope, which includes an XSLT
transformation calculatePaymentStatus.xsl.

Select the transform activity calculatePaymentStatus, and check out the property inspector
window. When you click on the transform activity, it might give the following error message:

Click OK. We will resolve this error message few steps later.

You will see that the transformation expects two input variables: The output variable of the
database adapter, which includes the payment information stored in the database, and the
input variable of the BPEL process, which includes the total order amount.

The output is the status field in the process output message, which will either be set to Denied
or Authorized.

Chapter 2: Validate Payment: Build SOA Composites

Page 29 of 392

If you want to see the definition of the XSLT file, click the edit button at the bottom:

This opens the mapper file.

Click Expand All Child Nodes on Source and Target and click on the little plus sign next to the
function in the middle.

Chapter 2: Validate Payment: Build SOA Composites

Page 30 of 392

The XSLT map checks whether


o

expireDate in order input and DB are the same AND

AuthorizationAmount (= total order price) is smaller than daily limit on credit card

Save All and close the XSLT Map.

Now you need to do one more step to get the map to work (remember the error message?)

You may have noticed that the transformation activity uses scope variables, not global variables,
as source and target. That is the case because all variables used in a template are converted into
scope variables.

As the BPEL process already includes variables that can be used in this transformation, you will
edit the transform activity to use global variables instead of scope variables.

Select the transform activity in the BPEL process and in the property inspector, select the first
source variable and click the pencil icon to edit:

Chapter 2: Validate Payment: Build SOA Composites

Page 31 of 392

Select the browse button next to the Source Variable field.

Select the global variable


getPaymentInformation_getPaymentInformationSelect_OutputVariable in the Variable
Chooser.

Click OK.

The Source Part for the variable will be automatically selected.

Chapter 2: Validate Payment: Build SOA Composites

Page 32 of 392

Click OK.

Repeat the same for the second source variable by replacing it with the process inputVariable.

To edit the target variable, click the browse button next to the Target Variable field.

The Variable Chooser dialog will be displayed. Select the scope variable outputVariable. This
variable will include the payment validation status.

Click OK.

Now you can delete the scope variables:

Chapter 2: Validate Payment: Build SOA Composites

Page 33 of 392

Open the Variables window by clicking the Property Structure icon on top of the BPEL process
and choosing Variables.

Delete the three scope variables by choosing the variables one by one and clicking the red X
icon:

Confirm the delete action by clicking Yes in the Delete Variables window.

Chapter 2: Validate Payment: Build SOA Composites

Page 34 of 392

Repeat this for all three scope variables.

Close the variables window.

Save all changes by clicking the Save All icon on top of JDeveloper.

Build your project by choosing Build Make ValidatePayment.jpr in the JDeveloper main menu.

Chapter 2: Validate Payment: Build SOA Composites

Page 35 of 392

If you see errors in the Messages - Log window at the bottom, indicating that a variable doesnt
exist, make sure the transformation uses the three global variables instead of the scope
variables you deleted.

The expected output is Successful compilation: 0 errors, 0 warnings

Chapter 2: Validate Payment: Build SOA Composites

Page 36 of 392

Add a composite sensor for payment status


Composite sensors provide a method for implementing track able fields on messages. Composite
sensors enable you to perform the following tasks:

Monitor incoming and outgoing messages.

Locate particular instances by searching for specific sensor details in the EM console.

Publish JMS data computed from incoming and outgoing messages.

Track composite instances initiated through business event subscriptions.

You define composite sensors on service and reference binding components or on service components
that have business event subscriptions in Oracle JDeveloper. This functionality is similar to variable
sensors in BPEL processes. During runtime, composite sensor data is persisted in the database.

By adding a composite sensor for payment status, we provide the ability to search for all authorized or
denied payments.

Close the BPEL editor to return to the composite editor.

Right-click on the SOAP service and choose Configure Sensors.

Choose the validatepaymentprocess_client_ep service.

Click on the blue plus sign to create a new composite sensor.

Chapter 2: Validate Payment: Build SOA Composites

Page 37 of 392

Name it PaymentStatus.

Choose the operation validate.

Leave the Enterprise Manager check box selected.

Click on the edit icon to define an expression for the sensor.

Chapter 2: Validate Payment: Build SOA Composites

Page 38 of 392

Choose Variables.

Choose Payment Status - Status in the output variable.

Chapter 2: Validate Payment: Build SOA Composites

Page 39 of 392

Click OK.

Chapter 2: Validate Payment: Build SOA Composites

Page 40 of 392

We wont define a filter for this sensor.

Click OK.

You now see the sensor in the list.

Click OK again.

You will see a new icon on the SOAP service.

Chapter 2: Validate Payment: Build SOA Composites

Page 41 of 392

When you mouse over, you can see the sensor definition.

Deploy the SOA composite


The first design iteration is complete and you are now ready to deploy the composite.
Please deploy the application following the steps outlined in section Deploy SOA Projects to the
Application Server in the Appendix section of this document.

Chapter 2: Validate Payment: Build SOA Composites

Page 42 of 392

Debug a SOA project in JDeveloper


In SOA Suite 12c, we have the ability to set breakpoints in the composite editor, BPEL process and
Service Bus pipeline.
Youre able to stop at breakpoints, look at the data, step into, step out and so on. In a BPEL process,
youre also able to change the value of a variable while debugging.

Set breakpoints in the composite by right clicking on an interface and create a Request or Reply
Breakpoint or both. For one-directional interfaces, you only get one option.

The breakpoints are little red icons with an arrow pointing in the direction of the flow.

In a BPEL process, right-click on an activity and choose Toggle Breakpoint. This will set a
breakpoint is there is none and remove if there is already a breakpoint.

Chapter 2: Validate Payment: Build SOA Composites

Page 43 of 392

These breakpoints are red dots only without arrow as the flow is always in one direction:

Set as many breakpoints as you want.

Important:
To make debugging easier for now, you should have a breakpoint at the beginning of every BPEL
process to make sure the debugger stops there.

Now start the debugger for your project:

Right-click on the project and choose Debug

Chapter 2: Validate Payment: Build SOA Composites

Page 44 of 392

You can debug local or remote. When the debugger is started, a window pops up asking which
server you want to use for debugging. It also asks for the debug port (default is 5004 for SOA,
but can be changed) and the timeout for the debugger when inactive.

Debugger properties are stored per project. If you previously imported a solution from a
different machine, the HOST will most likely have to be changed.

These values can also be stored in the JDeveloper properties and you can skip this dialog in the
future if you always want to use the same options.

Choose your host and leave the defaults.

Click OK.

If youve made changes to your project, it needs to be redeployed. This includes setting of
breakpoints.

You will be lead through the deploy wizard step by step if that is the case.

Chapter 2: Validate Payment: Build SOA Composites

Page 45 of 392

The debugger is ready when you see this message:

Every web service endpoint now shows a message that you can use the context menu to
initialize WS debugging:

Right-click on the WS interface and choose Initiate WS Debugging

This opens HTTP Analyzer.

Fill in all fields or choose HTTP Content at the bottom to be able to copy and paste an xml file
instead.

Chapter 2: Validate Payment: Build SOA Composites

Page 46 of 392

Use the sample file provided: PaymentInfoSample_Authorized_soap.xml.

Be aware that this sample message already includes the SOAP envelope needed for testing.

Chapter 2: Validate Payment: Build SOA Composites

Page 47 of 392

Hit Send Request.

If everything goes well, you should now see the debugger stop at your first breakpoint:

The active breakpoint turns blue and starts pulsing

Go to the Data tab at the bottom of JDeveloper and look at your variable values:

Chapter 2: Validate Payment: Build SOA Composites

Page 48 of 392

Step over (F8) to start your BPEL process.

Step through the BPEL process one activity at a time, using F8, and see how the variable values
change.

If you step through an assign activity, you will see the debugger step through the copy rules that
are included in the assign

If you set a breakpoint at the database adapter, it will jump out of BPEL and back to the
composite

Chapter 2: Validate Payment: Build SOA Composites

Page 49 of 392

Note the values that come back from the adapter.

After the calculate payment activity, the payment status has been set:

See what happens when you modify a value:

Chapter 2: Validate Payment: Build SOA Composites

Page 50 of 392

On the left hand side, you also see the stack trace:

Finish the debugger by stepping to the end of your BPEL process.

Back in HTTP Analyzer, you can see the result:

NOTE:
Please make sure to terminate the debugger before you continue with the implementation. As long as
the debugger is running, you will not be able to edit.
To stop the debugger, click the big red icon in the Tools section and choose your project.

Chapter 2: Validate Payment: Build SOA Composites

Page 51 of 392

Choose Terminate in the pop up window:

For more information on SOA Debugger, please see Debugging SOA Composite Applications with the
SOA Debugger in soa-dev-guide.pdf.

Chapter 2: Validate Payment: Build SOA Composites

Page 52 of 392

Test the SOA composite


You can test your project following the steps in Test the SOA project with EM FMWC in the Appendix
section of this document.
Please also check the audit level on the server, following the steps outlined in section Check the audit
level on the SOA Server in the Appendix section of this document.
When testing in EM FMWC you need to add a SOAP envelope to the test message. In order to make
testing easier, we already added the soap envelope to the test messages.
There are two sample message available in ~/e2e-1201-orderprocessing/sample_input to test the
validatePayment project: PaymentInfoSample_Authorized _soap.xml,
PaymentInfoSample_Denied_soap.xml.

Chapter 2: Validate Payment: Build SOA Composites

Page 53 of 392

Oracle Confidential Do not distribute to third parties

Part 2: Register Composite on Service Bus


Now that you have completed the validatePayment composite, you will register it on Service Bus.
Service Bus will protect consumers of the validatePayment composite from routine changes such as
deployment location and implementation updates. Service Bus will help scale the service to handle
higher volume of requests and provide resiliency for the service if it needs to be taken down for routine
maintenance.
You will start by first creating a Business Service to register the composite URI. You will then add a
simple Pipeline and Proxy. Pipelines contain actions performed on the Service Bus, typically reporting,
data transformation and validation, before invoking the backend service. Consumers of
validatePayment service will invoke via the Proxy rather than connect directly to the composite,
allowing more agility and flexibility in managing change.
If you need documentation help during this section, please consult the Service Bus Documentation.
After completing this section, your Service Bus application should look like the following.

View of Service Bus project after Part 2 is complete.

High-Level Steps
During this lab, you will accomplish the following tasks:

Create a new Service Bus application and new project ValidatePayment.


Create folders and import WSDL and XSD resource.
Configure a business service for the ValidatePayment composite and review properties.
Create proxy and pipeline and wire to the business service.

Test and Debug the end-to-end application.

Chapter 2: Validate Payment: Register Composite on Service Bus

Page 54 of 392

Oracle Confidential Do not distribute to third parties

Steps in Detail
Create a new service bus application and project
Create a new Service Bus application. There are various ways and shortcuts to do this, and in this
case choose File > New > Application from the menu.

From the Categories tree, click on General > Applications.

Select Service Bus Application with Service Bus Project from the Items field.

Click OK.

In the subsequent Create Service Bus Application With Service Bus Project dialog, set the following
fields, leaving the others with their default values:
a. Application Name: e2e-1201-servicebus
b. Directory of your choice

Chapter 2: Validate Payment: Register Composite on Service Bus

Page 55 of 392

Oracle Confidential Do not distribute to third parties

Click Next.

When you create a new application, you are prompted to create a new project. Set the following
fields on Step 2 of 2:
a. Project Name: ValidatePayment
b. Directory of your choice

Chapter 2: Validate Payment: Register Composite on Service Bus

Page 56 of 392

Oracle Confidential Do not distribute to third parties

Click Finish.

Double-click the ValidatePayment icon in the Application Navigator on the left-hand side, the
Services Bus Overview editor will open on the right.

Chapter 2: Validate Payment: Register Composite on Service Bus

Page 57 of 392

Oracle Confidential Do not distribute to third parties

The Overview Editor is a new view for Service Bus in SOA Suite 12c, and modeled from the SOA
Composite Editor.
This view allows you to construct Service Bus projects using a top-down, drag and drop approach. You
can create Proxy, Pipeline, and Business Services by dragging icons from the Component Palette on the
right, to the lanes of the canvas.
Please take a few moments to browse the Application navigator on the left of the screen and the
Component palette on the right.
On the Component Palette, notice the Resources category contains Pipeline and Split-Join icons. These
are the components for a Service Bus application. In this release, the Pipeline has been split from the
Proxy to allow it to be a re-usable component.
Other Palette categories, Technology, Adapters and Advanced, contain adapters and transports for
building Business Services (External References) and Proxy (Exposed Services).
If your Properties window is on the bottom right of the JDeveloper screen, please drag and position it to
the bottom center as shown in the above diagram. This will make editing properties of Pipeline actions
easier.

Chapter 2: Validate Payment: Register Composite on Service Bus

Page 58 of 392

Oracle Confidential Do not distribute to third parties

Create folders and import artifacts.


In Service Bus applications, Folders are leveraged to organize artifacts within a Project. For brand new
applications, we encourage you to create folders that align with the default folders in your 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 project, we will keep the structure simple since there are only a few artifacts to manage. As
your projects grow in subsequent chapters, you will add folders for categorizing artifacts into Business
Service, Proxy and Templates.

From the ValidatePayment project icon, select New> From Gallery.

Select Folder.

Chapter 2: Validate Payment: Register Composite on Service Bus

Page 59 of 392

Oracle Confidential Do not distribute to third parties

Click OK.
NOTE: This is only necessary the first time you add a Folder, thereafter it will be listed on the menu
by default.

When prompted fill in the following properties.


a. Folder Name: Schemas
b. Directory: Leave as Default

Click OK.

Chapter 2: Validate Payment: Register Composite on Service Bus

Page 60 of 392

Oracle Confidential Do not distribute to third parties

Create WSDLs folder in the same way. When complete your Application Navigator should resemble
the following.

Select the WSDLs folder that you just created in the left-hand navigation pane. We will now import
artifacts to build our services.

There are many ways to share artifacts between Service Bus and Composite applications, e.g. source
control, MDS backed by source control, etc. For todays work, you will import the artifacts from the
file system.

Chapter 2: Validate Payment: Register Composite on Service Bus

Page 61 of 392

Oracle Confidential Do not distribute to third parties

Select File-> Import

From the Import dialog, choose Service Bus Resources.

Click OK.

A wizard takes you through the steps of importing resources into your project. The title bar of the
wizard dialog shows the step number.

Chapter 2: Validate Payment: Register Composite on Service Bus

Page 62 of 392

Oracle Confidential Do not distribute to third parties

Import Service Bus Resources - Step 1 of 3, select Resources from URL.

Click Next.

Import Service Bus Resources - Step 2 of 3, next to Source URL, click the browse button

Be sure you selected the WSDLs folder in your project, then from the
WSDL chooser, navigate
to ~/e2e-1201-orderprocessing/resources/wsdl folder on your disk and select ValidatePaymentconcrete.wsdl

Chapter 2: Validate Payment: Register Composite on Service Bus

Page 63 of 392

Oracle Confidential Do not distribute to third parties

NOTE: This WSDL assumes that you have unzipped the resources as instructed in prior module
(ValidatePayment SOA composite), and the Schemas folder is at the same level as the wsdl folder
containing the CanonicalOrder.xsd. You will need this directory structure to successfully import the
WSDL.

Click OK.

Click Next.

Import Service Bus Resources - Step 3 of 3, accept the defaults.

Chapter 2: Validate Payment: Register Composite on Service Bus

Page 64 of 392

Oracle Confidential Do not distribute to third parties

Click Finish. Your left-hand navigation tree should resemble the following:

Configure Business Service for validatePayment composite.


In this section, you will configure a Business Service to represent your validatePayment composite.
There are different ways to create artifacts in Service Bus in JDeveloper:

right-click menu from the left-hand Application Navigator (traditional approach)

drag and drop icons from the Component Palette on to the overview canvas (new)

right click directly on the overview canvas to insert artifacts (new)

We will use the drag and drop Component Palette to build our first Service Bus project; however, feel
free to experiment with other mechanisms.

Chapter 2: Validate Payment: Register Composite on Service Bus

Page 65 of 392

Oracle Confidential Do not distribute to third parties

Drag and drop the

icon from the right Component Palette on to the External References Lane.

A wizard will walk you through the steps of configuring the Business Service. The title bar of the wizard
dialog shows the step number.

Create Business Service - Step 1 of 3


Service Name: ValidateBS
Location : Leave as default

Click Next.

Chapter 2: Validate Payment: Register Composite on Service Bus

Page 66 of 392

Oracle Confidential Do not distribute to third parties

Create Business Service - Step 2 of 3:


Select Service Type: WSDL

Select the

When the WSDL chooser appears, first, confirm that Application icon on the top is selected and
expand Application node Application -> ValidatePayment -> WSDLs.

Select ValidatePayment-concrete.wsdl

Click OK.

icon on the right of the WSDL choice.

Chapter 2: Validate Payment: Register Composite on Service Bus

Page 67 of 392

Oracle Confidential Do not distribute to third parties

Confirm that ValidationPaymentPort is selected in the Port field when you return back to the
wizard.

Click Next.

Create Business Service - Step 3 of 3:

Confirm http is selected in the Transport field.

Confirm Endpoint URI is set to your validatePayment composite, it should look similar to this:
http://localhost:7101/soainfra/services/default/ValidatePayment/validatepaymentprocess_client_ep

Chapter 2: Validate Payment: Register Composite on Service Bus

Page 68 of 392

Oracle Confidential Do not distribute to third parties

Click Finish. Your canvas should now resemble the following:

Tip and Trick How to find composite deployment URI

NOTE: There are several ways to check your deployed endpoint of a Composite. One way is to visit
the EM console (http://localhost:7101/em) and navigate to your composite.

Click the Test icon on the top right of screen. This will bring up a Web Service test page that lists your
deployed endpoint.

If you need to update your endpoint URI, you can do this as you review the Business Service
properties below in the Transport tab.

Chapter 2: Validate Payment: Register Composite on Service Bus

Page 69 of 392

Oracle Confidential Do not distribute to third parties

Review Business Service Properties

Double-click on your new Business Service in the overview and review the settings for your new business
service. There are settings for Performance (Result Caching), Policies for Security. We wont be settings
these right now but you might want to explore what is available.

General Properties

Transport

Transport Details

Performance

Security Policy

Chapter 2: Validate Payment: Register Composite on Service Bus

Page 70 of 392

Oracle Confidential Do not distribute to third parties

Configure Proxy and Pipeline


Now we will create the Proxy and Pipeline to invoke the ValidateBS Business Service. The Proxy will be
the interface to the service from external consumers. The Pipeline contains actions that must be
performed before invoking the composite. Typical actions are data transform and validation, reporting
with error handling; however, for your first Pipeline we will keep it simple.

Locate the Pipeline icon under Resources on the Component palette. Drag and drop the Pipeline
icon from the right onto the middle of the canvas, labeled the Pipelines/Split Joins lane.

The Pipeline wizard will walk you through the next steps. The title will show you what step you are on.

Create Pipeline Service - Step 1 of 2:


Service Name: ValidatePP

Chapter 2: Validate Payment: Register Composite on Service Bus

Page 71 of 392

Oracle Confidential Do not distribute to third parties

Click Next.

Create Pipeline Service - Step 2 of 2:


Service Type: Select WSDL

Click on the WSDL chooser icon


on the right. Navigate to Application -> ValidatePayment ->
WSDLs directory and then select ValidatePayment-concrete.wsdl.

Chapter 2: Validate Payment: Register Composite on Service Bus

Page 72 of 392

Oracle Confidential Do not distribute to third parties

Click OK.

Once back on Create Pipeline Service Step 2 of 2:


a. Ensure the Expose as Proxy Service checkbox is selected. This is the default.
b. Proxy Name: ValidatePS

Chapter 2: Validate Payment: Register Composite on Service Bus

Page 73 of 392

Oracle Confidential Do not distribute to third parties

Click Finish.

Your canvas should now look like the following we are almost done!

Now we will simply wire the Pipeline to invoke the Business Service.

Select ValidatePP and drag arrow to ValidateBS.

Chapter 2: Validate Payment: Register Composite on Service Bus

Page 74 of 392

Oracle Confidential Do not distribute to third parties

The Routing action is automatically configured for you in the Pipeline. Normally you would add
some actions to the Pipeline to validate, transform the payload or report for auditing. We will
practice this in subsequent chapters. For now lets go test your first Service Bus application end to
end!

Click the Save All icon

on top left of your screen.

Deploy and Test


We are ready to deploy and test end-to-end. Make sure your Integrated Server is running.

Bring Overview Editor back into focus. You can do this by double-click your project icon
in the Application Navigator or by selecting the ValidatePayment tab on
top center.

This will bring up your overview and refresh your canvas.

Right-click on the ValidatePS in the Exposed Services Lane. Select Run.

Chapter 2: Validate Payment: Register Composite on Service Bus

Page 75 of 392

Oracle Confidential Do not distribute to third parties

The Test Console will activate as one of your windows in JDeveloper on Windows. On Linux, this
may start a new browser window outside of JDeveloper. Make this window active by clicking on the
title bar.

By default, a sample payload will be generated for you; however, we will test with a specific file.

Click the Choose File button. This may show up as a Browse button on Linux.

Navigate to ~/e2e-orderprocessing/sample_input/ and select PaymentInfoSample_Authorized.xml

Click Open.

Chapter 2: Validate Payment: Register Composite on Service Bus

Page 76 of 392

Oracle Confidential Do not distribute to third parties

On the Test Console, click on the Execute button.

On the next screen, scroll down and hopefully your payment has been authorized!

You can also debug the Service Application leveraging the Debugger as was done in chapter 2A.

You have just completed your first SOA Suite 12c application!

Chapter 2: Validate Payment: Register Composite on Service Bus

Page 77 of 392

Oracle Confidential Do not distribute to third parties

Chapter 3: Process Order


Overview
In this chapter, you will build the basis of the new order processing system for Avitek, referred to as
ProcessOrder.
Recall a few of the business requirements for Avitek s new order processing system:

Many different types of clients will access it over different protocols and data formats, including
mobile devices.

With a mobile app launch in progress, next year at the latest, the new order processing system
must support access via RESTful API.

It must allow existing systems to place orders using xml files and CSV files. These should be
processed and fulfilled using the same new order provisioning infrastructure.

It must interface with trading partners and provide EDI support.

In this chapter, you will see templates, a new feature in SOA Suite, at work in BPEL as well as Service
Bus. You will leverage the validatePayment service you built in Chapter 2.
At the end of this chapter, your solution will look similar to the following (from an architectural
perspective).

Chapter 3: Process Order Overview

Page 78 of 392

Oracle Confidential Do not distribute to third parties

Prerequisites

Chapter 2: Validate Payment should be complete or the chapter solutions deployed. If you did
not complete Chapter 2, please deploy the solutions. The Deploy Chapter Solutions section in
the Appendix gives detailed instructions for deploying solutions.

Tutorial resources have been included and unzipped to a directory of your choice. When
referring to any resources in the following chapters, we will always refer to directories relative
to the unzipped location as ~/e2e-1201-orderprocessing. For example ~/e2e-1201orderprocessing/sample-input/input.xml.

When referring to resources in the following text, we will always assume the location you
unzipped e2e-1201-orderprocessing and has structure as follows:
o

WSDLs

Schemas

sample input

templates

Chapter 3: Process Order Overview

Page 79 of 392

Oracle Confidential Do not distribute to third parties

Part 1: Build Process Order Composite


You will now create another SOA application that will accept new purchase orders, approve them and
forward them to the fulfillment system. You will use a project template to implement the basic order
processing scenario, add a call to the payment validation service built in chapter 2 and update the order
status in the database based on the outcome of the payment validation.
The order status update will be converted to a BPEL subprocess to make it easily re-usable.

Once completed, your composite will look like this:

High-Level Steps

Import SOA template.

Before the order is processed, the credit card payment is validated using the validatePayment
service built in Chapter 2.

If the payment is denied, the order status is set to Denied and the processing is stopped.

If the payment is authorized, the order status is set to Authorized and the order is processed.

When the order processing is finished, the order status is set to ReadyForShip.

The Fulfill Order process to pick up orders that are ready to be fulfilled will use this status.

Chapter 3: Process Order: Build Process Order Composite

Page 80 of 392

Oracle Confidential Do not distribute to third parties

Steps in Detail
Import template
We will start by importing a SOA project template with a number of components already predefined.
These components can:

Receive an order through a web service call.

Create order number, set order date to current date and set order status =New.

Calculate the total order amount.

Save the order in the database with status=New.

Return an acknowledgement to the client with the order number.

The template has been provided as part of the resources for the labs, and should be located in the
templates folder.
In the previous chapter, we added this location to the list of folders where JDeveloper looks for
templates. If you havent done that yet, please follow the steps:

In the main JDeveloper menu, select Tools - Preferences

In the Preferences window, select SOA - Templates

Click Add

Navigate to the templates folder

Click Select to accept your choice

Click OK to close the Preferences window.

Chapter 3: Process Order: Build Process Order Composite

Page 81 of 392

Oracle Confidential Do not distribute to third parties

Create a new project ProcessOrder from a project template


In chapter 2, you used project template to accelerate building the Validate Payment service, as well as a
custom activity template for the XSLT transformation.
In this section, you will create the ProcessOrder composite (order processing service) based on the
provided project template in the e2e-1201-composites application.

Open the e2e-1201-composites application:

Choose File > New > Project from the menu.

Choose SOA Project

Click OK

Set the following fields:


o

Project Name: ProcessOrder

Directory: Keep the default directory

Click Next

In the next step, choose Start from SOA Template.

If you cant see ProcessOrderTemplate in the list, click the + button to add the folder where your
template is located.

Chapter 3: Process Order: Build Process Order Composite

Page 82 of 392

Oracle Confidential Do not distribute to third parties

Choose ProcessOrderTemplate.

Click Finish.

A new project with predefined components is created.

Double-click the components and services/references and discover what they do.

Deploy and test the project and make sure there are no errors, following the steps in the section
Test the SOA project with EM FMWC in the Appendix.

Use OrderSample_soap.xml (in the sample_input folder) for testing the web service interface.
Please note that this sample file includes the soap envelope needed for testing.

Check if new order records have been created in the database.

Chapter 3: Process Order: Build Process Order Composite

Page 83 of 392

Oracle Confidential Do not distribute to third parties

Add the payment validation


The order will only be processed if the payment is valid.
Remember that we already implemented the payment validation in the previous lab. Now we will add a
call to invoke this payment validation from process order.

Looking at the ProcessOrder composite, you will see that the BPEL process receiveOrder only sets the
order number (which is provided back to the client) and the order date, and then calls
validateAndProcessOrder to validate and process the order.

SOA Suite provides a mechanism to browse services that are deployed in a SOA or Service Bus project in
the integrated or a remote application server. The process is detailed below.
There are additional ways to find WSDL services that are available on the file system, in the repository or
in other locations.
In this lab, we will browse to the ValidatePS.proxy service, which has been deployed in the same
integrated server as the SOA composites.
First, we define a reference to the validate payment service.

In the composite drag-and-drop a SOAP web service into the External References swimlane.

Name it validatePaymentService

Click on the icon next to the WSDL URL field to find the validatePayment WSDL.

Chapter 3: Process Order: Build Process Order Composite

Page 84 of 392

Oracle Confidential Do not distribute to third parties

Make sure you select the app server where you deployed the ValidatePayment project.

Select the ValidatePS proxy service

Click OK

The port is chosen automatically

Check the box to copy the WSDL file and its dependant artifacts into the project. By doing this,
we ensure that the designer does not throw an error when the Service Bus service is not
available because the server is down or the service is not deployed.

Chapter 3: Process Order: Build Process Order Composite

Page 85 of 392

Oracle Confidential Do not distribute to third parties

Click OK

Chapter 3: Process Order: Build Process Order Composite

Page 86 of 392

Oracle Confidential Do not distribute to third parties

Uncheck Maintain original directory structure for imported files and Rename duplicate
files

Click OK

Now we need to wire the validateAndProcessOrder BPEL process to the newly created SOAP
reference

Chapter 3: Process Order: Build Process Order Composite

Page 87 of 392

Oracle Confidential Do not distribute to third parties

Open the validateAndProcessOrder BPEL process and add the call to validatePaymentService.

You will see that there is now a new partnerlink in the BPEL process for the payment validation.

But lets first have a look at what has already been defined in the process.

After assigning the order to a process variable, validateAndProcessOrder calculates the total
order amount, which is used to validate the payment. Remember, this was an input to the
payment validation service.

The calculation is done through an XSLT map.

Chapter 3: Process Order: Build Process Order Composite

Page 88 of 392

Oracle Confidential Do not distribute to third parties

An assign activity then adds the total order amount to the order message.

The writeOrderScope includes all activities involved in writing the order to the database.

Chapter 3: Process Order: Build Process Order Composite

Page 89 of 392

Oracle Confidential Do not distribute to third parties

If the payment is denied, we will cancel the order and update the order status in the database
accordingly.

The last step in the predefined process is to update the status in the database with the value of
the status element in the order message. This will be re-used several times in this process:
o

To update the order status with the outcome of the payment validation (Denied or
Authorized)

To update the status to ReadyForShip if the payment has been authorized and the order
process has been completed.

Now add the remaining activities to the BPEL process. Before you do that, collapse the scopes to make
the design look less crowded.

Add an invoke activity between the writeOrderScope and the updateOrderStatusScope. It


should be after the Dehydrate activity. The dehydrate activity is needed in the BPEL after the
Order is created, and before the validate Payment service is invoked. This will assist in properly
handling an error situation if ValidatePayment composite is down, restarted, and failed
instances of Order process are recovered.

Chapter 3: Process Order: Build Process Order Composite

Page 90 of 392

Oracle Confidential Do not distribute to third parties

Wire the invoke activity to the validatePaymentService partnerlink

This opens the invoke activity for editing.

You can choose to continue editing in this dialog or close the dialog and edit in the property
editor.

Chapter 3: Process Order: Build Process Order Composite

Page 91 of 392

Oracle Confidential Do not distribute to third parties

Lets use this dialog for now to make you aware of both options. Youll be able to decide later
which option you prefer.

Change the name of the invoke activity to validatePayment.

Click the + sign next to Input to automatically create the input variable for the invoke activity

Click OK

Chapter 3: Process Order: Build Process Order Composite

Page 92 of 392

Oracle Confidential Do not distribute to third parties

Create the output variable in the same way

Click OK

Click OK

The invoke activity is now complete.

Check the property inspector.

Chapter 3: Process Order: Build Process Order Composite

Page 93 of 392

Oracle Confidential Do not distribute to third parties

Before the web service can be invoked, the right values must be assigned to the input
variable for the web service call.

Add an Assign activity before the just added Invoke activity

In the General tab of the property inspector, specify the name as


assignPaymentInformation

Chapter 3: Process Order: Build Process Order Composite

Page 94 of 392

Oracle Confidential Do not distribute to third parties

Open the Copy Rules tab and launch the Assign Editor

Assign the payment information (Billing) from the order variable to the input variable of the
validatePayment service (validatePayment_validate_inputVariable) by dragging a map
from left to right.

Chapter 3: Process Order: Build Process Order Composite

Page 95 of 392

Oracle Confidential Do not distribute to third parties

This creates a new copy rule:

Click OK

If you see a warning attached to the assign, click the validate check box on top of the BPEL
editor. The warning should now go away.

We now assign the reply from the web service call - the payment status - to the order
message.

Add an assign activity after the invoke activity

Call it setPaymentStatus

Chapter 3: Process Order: Build Process Order Composite

Page 96 of 392

Oracle Confidential Do not distribute to third parties

In the Assign Editor, map the payment status in the output variable of the invoke activity to
the status in the order variable.

You will see a new copy rule:

Click OK to close the Assign Editor.

The last step in the BPEL process will update the order status in the database with the payment
validation result.
Chapter 3: Process Order: Build Process Order Composite

Page 97 of 392

Oracle Confidential Do not distribute to third parties

This is a good point to deploy and test the project again. Feel free to also debug the project, and the
BPEL processes to get a feel for what theyre doing.
Please follow the steps outlined in Test the SOA project with EM FMWC in the Appendix section.
Use OrderSample_soap.xml as sample message.

When you now open the flow instance in EM FMWC and choose the Composites tab, you will see both
composites within one flow instance:

ProcessOrder is the initiating composite

ValidatePayment is participating.

You will also see the service bus proxy service as part of the flow trace.
Make sure there are no errors in the flow trace.

Change the sample message to cause the payment validation to be denied (increase the
order items to extend the daily limit of the credit card, the daily limit is $1000).

Also verify that the PaymentStatus sensor is still set correctly.

Chapter 3: Process Order: Build Process Order Composite

Page 98 of 392

Oracle Confidential Do not distribute to third parties

Update the order status in the Database


The database adapter, which updates the order status, has already been defined within the
ProcessOrder template and an invocation of the service has been added to the
validateAndProcessOrder BPEL process:

This invocation of the database adapter will now update the order status to Denied or Authorized,
according to the return value of validatePayment.

Chapter 3: Process Order: Build Process Order Composite

Page 99 of 392

Oracle Confidential Do not distribute to third parties

Use an inline BPEL subprocess for the order status update


The order status update will be used at least once more in the same BPEL process. For this, you have to
repeat the same assign and invoke activities that we already used.
This is an error prone process and every time a change is necessary, it has to be implemented in all
those places.

To avoid this, we introduced a new feature in SOA Suite 12c called a BPEL subprocess.
BPEL sub-processes come in two flavors standalone, and inline.

About the standalone subprocess:

This is a fragment of a BPEL process, which includes a number of activities that will be re-used
across a number of other BPEL processes.

The standalone subprocess doesnt have an interface and can only be called from another BPEL
process, but it can have partner links.

In the composite view, the wire to a subprocess is shown as dotted line to indicate that this is
not a wire between actual components.

We introduced a new call activity in BPEL to be able to invoke a subprocess.

In the first release of SOA Suite 12c, we only support subprocesses in the same composite

Standalone subprocesses are visible in the component palette.

About the inline subprocess:

For groups of activities that are re-used within just one BPEL process, you can use an inline
subprocess.

Its part of the parent BPEL process code and not visible in the composite view.

We also use a call activity for this.

You can either define parameters to be set or use the process parameters.

The inline subprocess is visible in the BPEL palette.

Activities must be in a scope in order to be converted into a subprocess

At run-time, the subprocess code is re-entrant and re-usable only one copy is stored in
memory, even if it is called 20 times.

To learn more about BPEL subprocesses, please see chapter Oracle SOA Suite Templates and Reusable
Subprocesses in soa-dev-guide.pdf.

Chapter 3: Process Order: Build Process Order Composite

Page 100 of 392

Oracle Confidential Do not distribute to third parties

The order status update scope will be converted into an inline BPEL subprocess as its only used within
the same BPEL process.

Collapse the scope updateOrderStatusScope.

Right-click on the scope.

Choose Convert to a Subprocess.

Chapter 3: Process Order: Build Process Order Composite

Page 101 of 392

Oracle Confidential Do not distribute to third parties

Name it updateOrderStatusSP (By default it uses the scope name)

Leave Replace Scope with Subprocess Call checked. This will automatically replace the current
scope with a Call activity

Optionally set a label, comment and choose an image for your new subprocess.

Click OK

You will now see a new call activity in your process

You can also see the subprocess in the palette under Subprocesses

Chapter 3: Process Order: Build Process Order Composite

Page 102 of 392

Oracle Confidential Do not distribute to third parties

You can see and edit the definition of the subprocess when switching from Main Process to the
subprocess on top of the BPEL editor

You can see all partner links that are available in the main process, in case you want to add
another invoke.

You can make changes to this subprocess, which will be reflected in every call.

Chapter 3: Process Order: Build Process Order Composite

Page 103 of 392

Oracle Confidential Do not distribute to third parties

Before we test the process, lets change the name of the call activity.

Select the call activity and change the name in the property inspector to updateOrderStatus.

Deploy, test and debug the process again, the actual result should not change.

You will notice that you now see the call activity in your audit trail with the activities included in the
subprocess:

Chapter 3: Process Order: Build Process Order Composite

Page 104 of 392

Oracle Confidential Do not distribute to third parties

Similarly, in the flow trace, we also show the call activity and all activities included in the subprocess
below it:

Chapter 3: Process Order: Build Process Order Composite

Page 105 of 392

Oracle Confidential Do not distribute to third parties

Add an Order Number sensor to the Order Process composite


We already have a sensor for the payment status, now we will also define one for the order number.
At this point, composite sensors can only be set on services and references. The SOAP interface
receiveorder_client_ep returns the orderNumber in the order acknowledgement message. Thats
where we will define the sensor.

Go to the composite view of the ProcessOrder composite.

Right-click on the SOAP interface receiveorder_client_ep

Choose Configure Sensors

Choose receiveorder_client_ep

Click the + icon to create a new composite sensor

Name: OrderNumber

This sensor will be created from a variable

Chapter 3: Process Order: Build Process Order Composite

Page 106 of 392

Oracle Confidential Do not distribute to third parties

Pick the OrderNumber in the out message

Click OK

Chapter 3: Process Order: Build Process Order Composite

Page 107 of 392

Oracle Confidential Do not distribute to third parties

Optionally: use expressions and filters to define the sensor

Make sure Enterprise Manager is checked, so that you can see the sensor in the flowtrace

Click OK

Click OK

Note the sensor icon

Deploy and test the composite

Check to see if the sensor is set in the Flow Trace of the new instance together with the
payment status sensor.

Chapter 3: Process Order: Build Process Order Composite

Page 108 of 392

Oracle Confidential Do not distribute to third parties

Update the order status to ReadyForShip if the payment has been authorized
If the payment is valid, the order status is set to ReadyForShip in the database. This status update will
trigger the order fulfillment process, which will be built in a latter chapter.
If the payment is not valid, processing ends here.
First we add an If statement. The order will only continue if the payment was authorized. Otherwise
processing is stopped and an email is sent to the customer informing him of his unauthorized payment.
If in BPEL 2.0 is the equivalent of switch in BPEL 1.1.

Open the validateAndProcessOrder BPEL process if its not already open

Add an If under the sub process call. (You find the If activity under BPEL Constructs Structured
Activities)

Chapter 3: Process Order: Build Process Order Composite

Page 109 of 392

Oracle Confidential Do not distribute to third parties

We will check if the payment has been Authorized or Denied

Select the If construct and open the property inspector window, if its not already open.

Change the name to IfPaymentValid

Edit the condition by clicking the icon for the XPath Expression Builder

Expand the variable order and enter the status element into the Expression field by clicking
Insert Into Expression

Chapter 3: Process Order: Build Process Order Composite

Page 110 of 392

Oracle Confidential Do not distribute to third parties

Add = Authorized

Click OK to complete the expression

Back in the BPEL process, change the If label to Authorized by clicking on the label

Chapter 3: Process Order: Build Process Order Composite

Page 111 of 392

Oracle Confidential Do not distribute to third parties

Click OK

The else branch is not necessary, as the processing will just stop if the payment has been
denied. Delete the else branch:

Confirm the deletion

If the payment has been authorized, the processing of the order is complete and we update the
order status to ReadyForShip

In the If branch, add an assign activity to update order status to ReadyForShip

Name it assignReadyForShipStatus

Open the Assign Editor

Expand the order variable on the right hand side to the Status element and drag an Expression
on top of the Status element

Chapter 3: Process Order: Build Process Order Composite

Page 112 of 392

Oracle Confidential Do not distribute to third parties

That opens the Expression Builder

Enter ReadyForShip

Click OK to close the Expression Builder

Chapter 3: Process Order: Build Process Order Composite

Page 113 of 392

Oracle Confidential Do not distribute to third parties

Click OK to close the Assign Editor

Save All

Add a call to the subprocess (the one we just created) after the assign to update the order
status in the database. As previously, it reads the status form the order message, so no
additional assign activities are needed. Do you see how easy that is?

Chapter 3: Process Order: Build Process Order Composite

Page 114 of 392

Oracle Confidential Do not distribute to third parties

Change the name of the call activity to updateOrderStatusToReadyForShip

Deploy, and test the project. The order status in the database should be either Denied or
ReadyToShip.

Chapter 3: Process Order: Build Process Order Composite

Page 115 of 392

Oracle Confidential Do not distribute to third parties

Chapter 3: Process Order: Build Process Order Composite

Page 116 of 392

Oracle Confidential Do not distribute to third parties

Part 2: Register Process Order on Service Bus


Now that you have completed and tested the Process Order composite, you will register it on Service
Bus to make it available for external consumers. Service Bus will allow the Process Order composite to
be made available over different protocols and data formats without disruption to the core business
logic in the composite. Service Bus will also validate the Order data and report for auditing.
For now, you will just create an HTTP / SOAP Proxy and Pipeline for Process Order. You can also add a
File Proxy and Pipeline to allow orders to be processed from legacy systems.

View of Service Bus project after Part 2 is complete.

High-Level Steps

Open e2e-1201-servicebus application and import Pipeline template resources (new


feature!).
Configure ProcessOrder Business Service.
Configure Pipeline and Proxy using Pipeline template.
Test your application end-to-end.

Steps in Detail
Open existing service bus application and import template resources

Open your e2e-1201-servicebus application from Chapter 2. If already open, then navigate to it.

Chapter 3: Process Order: Register on Service Bus

Page 117 of 392

Oracle Confidential Do not distribute to third parties

Right-click in the Application Navigator window and select Import

Chapter 3: Process Order: Register on Service Bus

Page 118 of 392

Oracle Confidential Do not distribute to third parties

On the Import dialog, select Service Bus Resources.

Click OK

Import Service Bus Resources- Step 1 of 3, select Configuration Jar.

Click Next.

Import Service Bus Resources- Step 2 of 3, Click the browse icon to the right of Jar Source.

When the Configuration Jar chooser appears, navigate to where your resources are located on
disk and select pipeline-template-resources.jar from the Templates directory.

Chapter 3: Process Order: Register on Service Bus

Page 119 of 392

Oracle Confidential Do not distribute to third parties

Default path ~ /e2e-1201-orderprocessing/templates/pipeline-template-resources.jar.

Click Open

Click Next

Import Service Bus Resources- Step 3 of 3 - Review exactly what is being imported into your
application.
Service Bus supports the ability to import and export artifacts and projects at fine-grain level.
You may import artifacts individually, such as a WSDL or schema, or whole projects. You may
control whether dependencies are included or not.
By default, 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 you can control if 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 your development environment
for example.

You will accept all defaults in this case.

Chapter 3: Process Order: Register on Service Bus

Page 120 of 392

Oracle Confidential Do not distribute to third parties

Click Finish.

Your left-hand Application Navigator should now resemble the following:

Chapter 3: Process Order: Register on Service Bus

Page 121 of 392

Oracle Confidential Do not distribute to third parties

Register ProcessOrder composite as a business service


As you did in Chapter 2, you will first register the composite on Service Bus by creating a Business
Service. This time, rather than dragging and dropping from the Component Palette, you will create
using a menu-based Insert on the External Services lane.

First, make sure your overview editor is active by double-clicking on the


top or in the left-hand Application Navigator. Your canvas will be blank.

Now, right-click on the External Services lane of the overview editor.

Mouse-over Insert Transports and select HTTP.

This will bring up the same Business Service dialog that you leveraged in Chapter 2. Hopefully these
dialogs will be familiar to you now so we will just give you the settings.

Create Business Service Step 1 of 3:

on

Service Name: ProcessBS


Chapter 3: Process Order: Register on Service Bus

Page 122 of 392

Oracle Confidential Do not distribute to third parties

Transport: Leave as HTTP

Click Next.

Create Business Service Step 2 of 3:


Service Type : WSDL
Select

to the right of WSDL field.

From the WSDL Chooser, select from the Application and then navigate to find WSDL.
ProcessOrderSB->WSDLs->ProcessOrder-concrete.wsdl

Click OK.

Click Next.

Create Business Service Step 3 of 3:


Service Type: WSDL-based service
Transport: Leave as HTTP
Endpoint URI: Leave default

If you need to change the endpoint URI, you could do this from this dialog or wait until later and
change under the Business Service -> Transport tab. Service Bus also allows you to have multiple
endpoints for your Business Service to support application load-balancing and failover.

Click Finish.

Chapter 3: Process Order: Register on Service Bus

Page 123 of 392

Oracle Confidential Do not distribute to third parties

Before you proceed, why not quickly test your new Business Service and make sure the endpoint is a
good one. Do you remember how to do this? One simple way is directly from the overview canvas.

First, click Save All

Right-click ProcessBS icon on the External Services lane and select Run from the menu.

icon.

New Concept: What does Run do exactly?


If your Integrated Server is running, your project will be deployed and a window will be displayed, ready
for testing.
If your Integrated Server is not running, then it will be started, and then your project will be deployed
and a window will be displayed, ready for testing.
If your Integrated Server domain has not yet been created, a dialog will pop-up asking for your
password for the domain and a few other setting, then the domain will be created and started. Finally,
your project will be deployed and a window will be displayed, ready for testing..
Not much work on your part!

Once the Test Console is displays, Click on the Browse (Linux) or Choose File button (Windows) and
navigate to ~/e2e-1201-orderprocessing/sample_input and select OrderSample.xml.
You can also select the XML tab, and select the OrderSample_soap.xml

Chapter 3: Process Order: Register on Service Bus

Page 124 of 392

Oracle Confidential Do not distribute to third parties

Select the Execute button.

You should receive a response document that contains an OrderNumber from your ProcessOrder
composite. You are ready to build your Pipeline and Proxy!

Create new pipeline with proxy using a pipeline template


Now instead of creating the Pipeline for ProcessOrder from scratch, you will leverage a Pipeline
Template. The template encapsulates all the repetitive tasks common with building a Pipeline such
as routing, data validation, reporting, error handling and alerting under error conditions.

First, make sure your overview editor is active by double-clicking on the ProcessOrderSB icon
on top center or in the left-hand Application Navigator.

Locate the Pipeline icon on the Component palette and drag onto the middle of your canvas.

Chapter 3: Process Order: Register on Service Bus

Page 125 of 392

Oracle Confidential Do not distribute to third parties

The Create Pipeline dialog will appear. This is the same dialog as you used to create your Pipeline in
Chapter 2; however, this time you will select to Create the Pipeline from a Template.
Create Pipeline Step 1 of 2
a.

Service Name: ProcessPP

b.

Location: Leave as default

c.

From Template: Check this box and click on the

Chapter 3: Process Order: Register on Service Bus

icon to the right.

Page 126 of 392

Oracle Confidential Do not distribute to third parties

When the Pipeline Template chooser appears, navigate to Application>SharedSB>Templates and


select WSDL-VR.ptx.
Naming conventions have not quite emerged for Templates yet; however, this name means its a
Template for WSDL based services that does validation and routing. It also includes error-handling
and alerting but that would get a bit long.

Click OK

Click Next

Create Pipeline Step 2 of 2


Since this is a WSDL-based template, notice the Service Type is pre-selected as WSDL for you. All
you need to do is select the precise WSDL you wish to use for the Pipeline.

Chapter 3: Process Order: Register on Service Bus

Page 127 of 392

Oracle Confidential Do not distribute to third parties

Click on the browse icon to the right of the WSDL option

When the WSDL chooser displays, navigate to


Application>ProcessOrderSB>WSDLs>ProcessOrder-concrete.wsdl

Click OK

Chapter 3: Process Order: Register on Service Bus

Page 128 of 392

Oracle Confidential Do not distribute to third parties

Check the box for Expose as Proxy Service and set Proxy Name: ProcessPS. Leave rest of the values
to their defaults.

Click Finish.

On your canvas you will now see your new Pipeline created from a Template.
The pipeline created still needs some work so it may show an error or a warning (example of an error
in the diagram below).

Double-click on the ProcessPP Pipeline and lets drill down to take a closer look.

This Pipeline looks different than the one weve worked with before. Notice that the background is
grey. This indicates we are working with a Pipeline derived from a Template. The Template
Designer has made some items editable and others not.

Chapter 3: Process Order: Register on Service Bus

Page 129 of 392

Oracle Confidential Do not distribute to third parties

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. What blanks need to be filled in? Notice the
flags these indicate areas that still need to be filled in to have a valid Pipeline. Service Bus
has strong design-time validation so it will help you keep track when the Pipeline has been
completely filled out.

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.

Also, notice the Error Handler at the top right. Best practice is to always have an Error Handler
defined for Pipelines. This pre-defined Error Handler will report the error back to the caller with
good details and also send up an Alert to the EM console that something is wrong with processing.
Likely we may have invalid Order data incoming.

Chapter 3: Process Order: Register on Service Bus

Page 130 of 392

Oracle Confidential Do not distribute to third parties

Before editing the derived Pipeline, select the Configuration tab at the bottom of the canvas.

Review the instructions given by the Template Designer in the Description area before proceeding.
This is where documentation of how to use the Template should be captured and shared by the
Template Designer to the Developer using the template.

Re-select the Design tab, and lets now fill in the template and complete our Pipeline.
First, lets get rid of those

flags.

Double-click on the Validation action to open the Property Editor.


NOTE: If the Property inspector is not visible you can make it appear by going to the menu and
selecting Windows->Properties. The window should appear, usually in the right bottom corner.
Move to the bottom center of your screen for easiest access.

Chapter 3: Process Order: Register on Service Bus

Page 131 of 392

Oracle Confidential Do not distribute to third parties

Open the Data Validation stage and select the Validate action. You will validate the incoming
payload against the canonical Order element type that the ProcessOrder composite is expecting. By
validating in Service Bus, you save precious resources in the backend that are actually processing
good orders.

We only need to fill in the type to validate against. The location has already been provided by the
Template Designer. Since this is a WSDL based service, Service Bus knows our data types and can help
us easily fill in the blanks.

In the Properties tab see Schema, select Static

Chapter 3: Process Order: Register on Service Bus

Page 132 of 392

Oracle Confidential Do not distribute to third parties

Click on the magnifying glass on the right to bring up the XML Schema/WSDL chooser.

Navigate to Application>Schema>CanonicalOrder.xsd>Order OrderType

Click OK

Notice the red flag is gone! Notice the different Actions you can take when you Validate.

Chapter 3: Process Order: Register on Service Bus

Page 133 of 392

Oracle Confidential Do not distribute to third parties

You may raise an error (default) or simply assign the value to a variable that you can check in your
Pipeline. Perhaps you have a service that fixes common data entry type mistakes.
New Feature: Dynamic validation is supported in this release, so you can determine at runtime the
schema type to check based on an expression.

Move to the Reporting action in the Auditing stage of the response flow. Lets customize to report
on the Order number that is returned from our composite. The template already saves a copy of
the incoming Order in case of an error and reports it to EM.

In the Property tab, select the Report finger tab.

Click on the
Key: OrderNo
Variable: Select body
XPath: Click on the little icon to the right to pop-up the expression editor.

XPath Expression Builder, navigate to Variables tab in the middle of the screen and navigate to
Body>process>$ body response > OrderAck > OrderNumber

Chapter 3: Process Order: Register on Service Bus

Page 134 of 392

Oracle Confidential Do not distribute to third parties

Drag this element to the top box and click OK.

Click OK. You are almost DONE.

Double-click the Routing node and select the Route finger tab in the Property inspector.

Chapter 3: Process Order: Register on Service Bus

Page 135 of 392

Oracle Confidential Do not distribute to third parties

Click on the magnifying glass on the right and navigate to the ProcessBS Business Service.

Click OK

Chapter 3: Process Order: Register on Service Bus

Page 136 of 392

Oracle Confidential Do not distribute to third parties

We are ready to test. Click on the Application Navigator project icon


your overview. It should now resemble the following:

to refresh

Test end-to-end

Click on the ProcessPS service on the left swim lane and select Run

First, send in a good Order


a.

~/e2e-1201-orderprocessing/sample_input/OrderSample.xml

Then send in and invalid order


a.

~/e2e-1201-orderprocessing/sample_input/BadOrderSample.xml

What happens? Are the results sent back to you enough to understand what the problem is?

Did Templates make building your Pipeline easier?

Chapter 3: Process Order: Register on Service Bus

Page 137 of 392

Oracle Confidential Do not distribute to third parties

Chapter 4: Add New Order Channel


Overview
Now that the core order system is built for Avitek, you will 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.
In this chapter, you will add new File order channel for your ProcessOrder leveraging the work done in
previous chapters. You will add new Proxy to handled incoming orders by file and translate commondelimited format with nXSD.
Along the way you will also learn more about monitoring Service Bus in Enterprise Manager.

Enterprise
Manager
Console

Service Bus
Console

Prerequisites

Chapter 3 Process Order complete or solution deployed.

Resources have been downloaded and unzipped to the home directory ~/. When referring to
any resources in the following chapters (for example WSDLs or sample input), we will always
assume the home directory location. For example, sample input files are expected in ~/e2e1201-orderprocessing/sample_input.

JDeveloper should be open with WebLogic Integrated Server running

Chapter 4 Add New Order Channel

Page 138 of 392

Oracle Confidential Do not distribute to third parties

Part 1: Add file adapter proxy and wire to pipeline


You will use the File Adapter wizard to add a new File-based proxy for Process Order leveraging the
overview editor and Component Palette. In SOA Suite 12c, the Adapter wizards are shared between
SOA and Service Bus, so hopefully the steps below will be quite familiar to you if you use adapters in
SOA composite applications. The new File proxy will transform a comma-delimited file to a valid Order
xml which the ProcessOrder service can use, validate it and call the ProcessOrder SOA service.
At the end of this lab, your ProcessSB project should resemble the following:

High-Level Steps

Configure a File Adapter Proxy with nXSD translation.

Wire to the existing Process Order Pipeline and Business Service.

Test the end to end application.

Steps in Detail
Configure Proxy for File Adapter

Click on the ProcessOrder icon to bring up the Overview editor.

Locate the File Adapter icon in the Component Palette.

Chapter 3: Process Order Part 1

Page 139 of 392

Oracle Confidential Do not distribute to third parties

Drag the File Adapter onto the Service Bus Overview editor in the Proxy Services lane.

File Adapter Configuration Wizard - Step 1 of 4 :

Name: ProcessPS_File

Location: Leave as default.

Chapter 4 Add New Order Channel

Page 140 of 392

Oracle Confidential Do not distribute to third parties

Click Next.

File Adapter Configuration Wizard - Step 2 of 9 :

Chapter 4 Add New Order Channel

Page 141 of 392

Oracle Confidential Do not distribute to third parties

Click Next.

Chapter 4 Add New Order Channel

Page 142 of 392

Oracle Confidential Do not distribute to third parties

File Adapter Configuration Wizard - Step 3 of 4 :

Click Next.

File Adapter Configuration Wizard - Step 4 of 9 :

Select Read option.

Chapter 4 Add New Order Channel

Page 143 of 392

Oracle Confidential Do not distribute to third parties

Click Next.

File Adapter Configuration Wizard - Step of 5 of 9 :

Directory for Incoming Files : /tmp/soa/in

Chapter 4 Add New Order Channel

Page 144 of 392

Oracle Confidential Do not distribute to third parties

Click Next.

File Adapter Configuration Wizard - Step of 6 of 9 :

Chapter 4 Add New Order Channel

Page 145 of 392

Oracle Confidential Do not distribute to third parties

Include Files with Name Pattern: *.csv

Click Next.

File Adapter Configuration Wizard - Step of 7 of 9 :

Chapter 4 Add New Order Channel

Page 146 of 392

Oracle Confidential Do not distribute to third parties

Keep defaults.

Click Next.

File Adapter Configuration Wizard - Step of 8 of 9 :

NOTE: On this step you have a choice, you can proceed to Part 4 Advanced: Build the
translations from scratch of this chapter and build the nXSD from scratch or you may select an nXSD
that has been provided for you that will convert comma-delimited orders in valid canonical XML
format. Your choice if you are running ahead of schedule, we would encourage you to build from
scratch.

Chapter 4 Add New Order Channel

Page 147 of 392

Oracle Confidential Do not distribute to third parties

If selecting pre-built nXSD, select the magnifying glass to the left.

When the Type Chooser appears, navigate to Application Schema Files - > ProcessOrderSB ->
Schemas -> nXSD_Order.xsd -> Order

Chapter 4 Add New Order Channel

Page 148 of 392

Oracle Confidential Do not distribute to third parties

Click OK.

Then click Next after validated your choice looks like below notice the Schema Element is set to
Order.

Chapter 4 Add New Order Channel

Page 149 of 392

Oracle Confidential Do not distribute to third parties

Click Next.

File Adapter Configuration Wizard - Step of 9 of 9 :

You are done!

Chapter 4 Add New Order Channel

Page 150 of 392

Oracle Confidential Do not distribute to third parties

Click Finish.

Wire to the existing Process Order Pipeline and Business Service.


Your palette should now resemble the following:

Click on the

on your new Proxy and drag over to the existing ProcessPP pipeline.

Chapter 4 Add New Order Channel

Page 151 of 392

Oracle Confidential Do not distribute to third parties

You are all done!


Note: If the line does not connect (sometimes this happens), you can double-click and set the Proxy
invoke to ProcessPP in the General tab.

Your canvas should now resemble the following:

Chapter 4 Add New Order Channel

Page 152 of 392

Oracle Confidential Do not distribute to third parties

We are able to re-use the ProcessPP Pipeline we built in Chapter 2. Take a few minutes to browse
the properties of your Proxy services, Pipeline and Business Services. Ask any questions that you
might have.

Save everything. Right-click and then select Run from the menu to deploy your artifacts.

If you should see a policy error in the Test Console, go change this Policy setting in your Proxy
General tab. Set to No Policies and Run again.

Test your service.

Copy ~/e2e-1201-orderprocessing/sample_input/FileOrder.csv to /tmp/soa/in

After a few moments, the file should be gone meaning that it has been processed.

Before proceeding to the next section, test your ProcessPS SOAP/HTTP proxy with good and bad
data, we will use these results to review the Enterprise Manager console.
Good Data: ~/e2e-1201-orderprocessing/sample_input/OrderSample.xml
Bad Data: ~/e2e-1201-orderprocessing/sample_input/BadOrderSample.xml

Recall in Chapter 3, you used a Pipeline template to create your Pipeline. This pipeline had an
Application Alert defined in the error handling to warn if a service was failing.

Chapter 4 Add New Order Channel

Page 153 of 392

Oracle Confidential Do not distribute to third parties

Part 2: Review Service Bus in Enterprise Manager


Lets take a look at the new Service Bus monitoring in Enterprise Manager. In previous releases, Service
Bus packaged its own monitoring console along with the Design Console. The monitoring console has
been combined with the rest of SOA Suite. The split will also align better with roles of developers and
administrators within the organization. Now all of SOA Suite components can be management by
administrators from one unified Enterprise Manager Console.

High-Level Steps

Bring up the Enterprise Manager console and navigate to Service Bus

Enable monitoring on all services in the Operations tab.

Review the various monitoring tabs.

Review Message Reports.

Steps in Detail
Bring up Enterprise Manager and navigate to Service Bus

Bring up EM in Intenet Browser : http://localhost:7101/em.

Login with credentials


username: weblogic
password: welcome1

Chapter 4 Add New Order Channel

Page 154 of 392

Oracle Confidential Do not distribute to third parties

Navigate to the Service Bus folder on left side of the navigation tree and select the Operations tab.

Notice no services are displayed by default. You must first select the Search button on the right.
This has been done to optimize performance when there may be 100s or 1000s of services, you can
display only those services of interest by refining your search.

Select Search on the right. This is a new operational view, which will allow you to set operational
parameters across a select group of services that fit a specific pattern.

In this case, we are searching for all services in the ProcessOrderSB project. Select ProcessOrderSB
in the left navigation tree.

Select the Operations tab.

Press the Search button on the right and all the services in ProcessOrderSB will be displayed.

Chapter 4 Add New Order Channel

Page 155 of 392

Oracle Confidential Do not distribute to third parties

Enable monitoring on all services in the Operations tab.

Click on the checkbox at the top of the Monitoring column and select apply. By default, monitoring
is not enabled on services in Service Bus until you explicitly turn monitoring on. You may turn
monitoring on for just the ProcessSB services or by selecting the entire tree on the left; you may
turn of monitoring for all services.

Click Apply.

Note that you can also quickly filter by type of service Proxy, Business Service, Pipeline by selecting
the Type drop-down box.

Chapter 4 Add New Order Channel

Page 156 of 392

Oracle Confidential Do not distribute to third parties

Selecting Proxy and Business Services will display only those types of services in the
ProcessOrderSB project. We can further refine with the attribute drop-downs on the right to show
only the active services or those with SLA Alerts.

Now that monitoring is enabled, we can browse for other interesting data.

Review the various monitoring tabs

Click back on the top level of service bus in the left-hand navigation tree, this will remove the search
filter. Browse along the tabs
Global Settings
Operations (remember to hit Search!)
Faults
Service Health
Alert History
Dashboard

Chapter 4 Add New Order Channel

Page 157 of 392

Oracle Confidential Do not distribute to third parties

If you have been testing with good and bad order data, navigate to the Alert History tab.

Select Pipeline Alerts.

Press Search button. You should see a few critical alerts that were thrown from your service.

Click on one of the alerts and browse the data contained there.

Click on the Properties tab to set the Aggregation Interval to 8 hours. By default its 10 minutes.

Chapter 4 Add New Order Channel

Page 158 of 392

Oracle Confidential Do not distribute to third parties

Review Message Reports

Click the Service Bus drop-down at the very top of the screen.

Select Message Reports.

Then press the Search button. You should see a listing of all the Reporting from running your
services.

Click on a few of the items and inspect the properties and details captured by the reporting action.

Chapter 4 Add New Order Channel

Page 159 of 392

Oracle Confidential Do not distribute to third parties

Click on one of the OrderNo entries, and then select Report Details on the next page.

Chapter 4 Add New Order Channel

Page 160 of 392

Oracle Confidential Do not distribute to third parties

You can then see any payload that was captured by the service.

In a future lab, we will show a new future that can redact sensitive data from reporting and logs in
SOA Suite. Continue browsing.

Finally, browse back to the top-level and select the Dashboard tab. You can see a visual of the
Pipeline Alerts generated by your service by selecting PipeLine Alerts in the drop-down box.

Chapter 4 Add New Order Channel

Page 161 of 392

Oracle Confidential Do not distribute to third parties

If you dont see any alerts, change the Alert History Duration on the right to be 8 hours.

Chapter 4 Add New Order Channel

Page 162 of 392

Oracle Confidential Do not distribute to third parties

Part 3: Service Bus Debugger


Service Bus debugger framework has been brought into JDeveloper. This lab is a simple one and should
just take you a few moments.

High-Level Steps

Navigate to the ValidatePayment Pipeline.

Set a breakpoint in the Pipeline

Right-click your Pipeline or Proxy from the canvas and select the Debug option.

Enter test data into the Test Console.

Steps in Detail

Double-click on the project icon in the left-hand navigation window to bring your overview into
focus.

Double-click on your Pipeline to get into the Pipeline editor.

Select the Reporting action and right-click and select Toggle Breakpoint from the menu.

Chapter 4 Add New Order Channel

Page 163 of 392

Oracle Confidential Do not distribute to third parties

Navigate back to your overview canvas. Right-click on the Proxy and select Run.

Enter sample data into the test console.

In a short while, you should you should see your JDeveloper screen flashing and be able to review
your variable and step through your Pipeline.

Chapter 4 Add New Order Channel

Page 164 of 392

Oracle Confidential Do not distribute to third parties

Click on the Data window at the bottom center of your screen. Introspect $body.

Double-click on the Address element and change it.

Chapter 4 Add New Order Channel

Page 165 of 392

Oracle Confidential Do not distribute to third parties

Continue or step over by selecting icons at the top of the screen.

You are now finished with this part of the Chapter.

Chapter 4 Add New Order Channel

Page 166 of 392

Oracle Confidential Do not distribute to third parties

Part 4 Advanced: Build the nXSD translation from scratch


High-Level Steps

Invoke the Native Format Builder from the File Adapter Configuration Wizard (Step 8 of 9)

Build complex map

Steps in Detail
Bring up the Native Format Builder
When you click the Define Schema for Native Format button in the Messages page of the Adapter
Configuration Wizard shown in Figure below, the Native Format Builder wizard is displayed. The
Messages page is the last page that is displayed in the Adapter Configuration Wizard before the Finish
page.

Figure 1: Step 8 of 9 in the File Adapter Wizard.

In this use case, the Native Format Builder uses FileOrderSample.csv, a complex file type which contains
multiple records such as credit card information, billing address, shipping address and items. Also, using
this use case, you can generate the NXSD and test it. Perform the following steps to run this use case:

Chapter 4 Add New Order Channel

Page 167 of 392

Oracle Confidential Do not distribute to third parties

The data in a sample text file, ~/e2e-1201-orderprocessing/sample_input/FileOrderSample.csv,


appears as below:
1,1234123412341234,0316,AMEX
Daniel,Day-Lewis,555 Beverly Lane,Hollywood,CA,12345,5127691108
Daniel,Day-Lewis,555 Beverly Lane,Hollywood,CA,12345,5127691108
Standard,ddl@gmail.com
32779,5,4.72,Slaker,Water bottle,2008,Slaker Water Bottle
30421,16,10.72,Grand Prix,Bicycle Tires,2005,Grand Prix Bicycle
Tires
32861,11,60.72,Safe-T,Bicycle helmet,1829,Safe-T Helmet

File Adapter Configuration Wizard Step 8 of 9, click on the icon to the right of the URL choice
(see red box above)

Launch the Adapter Configuration Wizard and navigate to the Messages page, as displayed in
Figure 1, and click Define Schema For Native Format.

The Native Format Builder Welcome page is displayed, as shown in Figure 2 below.

Figure 2: Native Format Builder

Click Next.
Enter the FileName for the nxsd schema as shown below:

Chapter 4: Add New Order Channels

Page 168 of 392

Oracle Confidential Do not distribute to third parties

Click Next. The Choose Type page is displayed, as shown below

Select Complex Type (Contains records whose fields may themselves be records having
multiple delimiter types)

Click Next. The Native Format Builder File Description page is displayed.

Click Browse and select the FileOrderSample.txt file, and enter Order in the Root Element and
TargetNamespace as http://www.oracle.com/soasample.

Chapter 4: Add New Order Channels

Page 169 of 392

Oracle Confidential Do not distribute to third parties

Click Next. The Design Schema screen is displayed, as shown below:

Chapter 4: Add New Order Channels

Page 170 of 392

Oracle Confidential Do not distribute to third parties

We will now create the complex types for data corresponding to address, billing, shipping, and
item. Let us first start by creating complex type for address. Select Order element and click on
Add Complex Type icon (2nd from the left):

Rename <new_complex_type> to AddressType as shown below:

Chapter 4: Add New Order Channels

Page 171 of 392

Oracle Confidential Do not distribute to third parties

Drag and drop the address line from the right pane for Sample File onto the AddressType :

Chapter 4: Add New Order Channels

Page 172 of 392

Oracle Confidential Do not distribute to third parties

This opens the Complex Type Detail screen

Select Delimited By as Comma(,) from the drop down as shown:

Chapter 4: Add New Order Channels

Page 173 of 392

Oracle Confidential Do not distribute to third parties

Click on Generate Fields button; this will generate the schema elements corresponding to the
fields in the data file.

Chapter 4: Add New Order Channels

Page 174 of 392

Oracle Confidential Do not distribute to third parties

Now, you will need to rename the auto-generated elements C1,C2,C7 to element names that
we expect in the generated xml. Select each of the elements and click on the Pencil icon to
open the Edit Field Details screen(shown below) in order to update each field. Please ensure
that Terminated By field for each of the fields is set to , except for the last field which should
be set to ${eol} (e.g. end of line). Please ensure that the Style is set to terminated.
C1 FirstName
C2 LastName
C3 AddressLine
C4 City
C5 State
C6 ZipCode
C7 PhoneNumber
Shown below is the Edit Field Details screen for the first element:

Chapter 4: Add New Order Channels

Page 175 of 392

Oracle Confidential Do not distribute to third parties

Once the details are filled in, the screen should look like this:

Chapter 4: Add New Order Channels

Page 176 of 392

Oracle Confidential Do not distribute to third parties

Click OK. Your screen should look like this.

Chapter 4: Add New Order Channels

Page 177 of 392

Oracle Confidential Do not distribute to third parties

Now we will create the complex type for BillingType. The BillingType consists of Credit Card
Information and the Billing Address. Select Order element from the left pane and click on Add
Complex Type; name it as BillingType. Select BillingType and drag and drop the first line of
data from the Sample File pane onto the Billing Type.

The Complex Type Detail screen for BillingType is shown

Chapter 4: Add New Order Channels

Page 178 of 392

Oracle Confidential Do not distribute to third parties

Select Delimited by as Comma(,) and click on Generate Fields. Now map the auto generated
columns C1,C2,C3, and C4 to CardPaymentType, CardNum, ExpireDate, and CardName
respectively. Ensure that CardPaymentType, CardNum, ExpireDate fields are terminated by
Comma(,) and CardName is terminated by ${eol}. The Style for CardPaymentType might be set
to blank; please ensure that Style is set to terminated. Once done, your screen should look as
shown below:

Chapter 4: Add New Order Channels

Page 179 of 392

Oracle Confidential Do not distribute to third parties

Now we need to add another field to this list. Click on the Green button (plus sign) to add a new
field. Name of the element as BillingAddress and select AddressType as its type. Leave Style
as blank. Click on OK. Now your Define Schema screen looks as below:

Chapter 4: Add New Order Channels

Page 180 of 392

Oracle Confidential Do not distribute to third parties

Now, we will create the type information for the order line item. Select Order and create a new
complex type called ItemType and drag and drop the first order line onto this :

This will open the Complex Type Detail window. Select Delimited by as Comma(,) and click on
Generate Fields. Rename C1,C2,C3,C4,C5,C6 and C7 to SKU, Quantity, UnitPrice, Brand, Model,
Category, and Description respectively. Make sure that all the fields except Description have
Terminated By set to Comma(,); Description field will be Terminated By ${eol}(e.g. end of line).

Chapter 4: Add New Order Channels

Page 181 of 392

Oracle Confidential Do not distribute to third parties

Click OK. Youre back at the screen for Design Schema as shown

Chapter 4: Add New Order Channels

Page 182 of 392

Oracle Confidential Do not distribute to third parties

Add a new complex type ShippingType under Order element. Right-Click on ShippingType
and select Add Element as shown.

Name the element as Address as shown below.

Now drag AddressType onto Address element that we just created.

Chapter 4: Add New Order Channels

Page 183 of 392

Oracle Confidential Do not distribute to third parties

Right click on ShippingType and add another element ShippingSpeed. You can use Right
click, or Add element Button.

Select ShippingSpeed element and click on pencil icon on the top to edit the element. This will
open the Edit Field Details screen. Select terminated as style and add Terminated By as
Comma(,) manually as shown:

Chapter 4: Add New Order Channels

Page 184 of 392

Oracle Confidential Do not distribute to third parties

Click OK. Youre back to the Design Schema screen

Select Order element and create another complex type with name ItemsType. Select ItemsType
and create a new element item as shown below:

Chapter 4: Add New Order Channels

Page 185 of 392

Oracle Confidential Do not distribute to third parties

Now select item element and click on pencil icon to edit the element, select type as
ItemType, Max Occurs as UNBOUNDED, check Array button and put Array Separator as
${eof} (e.g. end of file)

Click OK. Youre back on the screen for Design Schema shown below

Chapter 4: Add New Order Channels

Page 186 of 392

Oracle Confidential Do not distribute to third parties

Now, its time to create the elements. Select Order element and click on Add Element icon
at the top and create 4 elements, Billing, Shipping, Email and items. Your screen will look like
this:

Now drag and drop BillingType on Billing , ShippingType on Shipping, and ItemsType on items.

Chapter 4: Add New Order Channels

Page 187 of 392

Oracle Confidential Do not distribute to third parties

Select Email element. Click on pencil icon on the top to edit the information. You will see the
Element Detail screen.

Click on Edit Properties. You will be presented with a screen to edit the Field details. Enter
Style as terminated, type as string and Terminated By as ${eol}

Chapter 4: Add New Order Channels

Page 188 of 392

Oracle Confidential Do not distribute to third parties

Click OK. Click OK again.

Click Next. Youll be able to see the generated schema. Ensure that your top level Order
elements looks as shown below. Reorder the elements if they do not occur in the exact order as
shown below:

Chapter 4: Add New Order Channels

Page 189 of 392

Oracle Confidential Do not distribute to third parties

Click on Test button

Click on Generate XML button as shown, you should be able to see the generated xml as
shown:

Chapter 4: Add New Order Channels

Page 190 of 392

Oracle Confidential Do not distribute to third parties

Chapter 5: Pack and Ship Service


Overview
In this chapter, you will build the first part of the order fulfillment service. After the order has been
successfully processed, it needs to be packed and shipped.
Avitek has a number of preferred shipping providers, each of them assigned to a specific shipping
method. This method is calculated based on the shipping speed the customer chose when placing the
order and the shipping state (in address).
Once the order has been shipped, an email is sent to the customer confirming the shipping provider and
the order status is updated to Shipped.
This chapter will build the pack and ship service, including the email notification.
The next chapter will build the fulfill order service, which identifies the shipping provider and calls the
pack and ship service.

Prerequisites

JDeveloper is up and running.

The integrated server in JDeveloper is up and running with at least Chapter 3 completed. Make
sure the debugger has been terminated.

If you did not complete Chapter 3, obtain and deploy the solution, following the steps below:
To deploy solutions:
-

Locate ~/e2e-1201-orderprocessing/solutions/ch4-addOrderInputChannels

Unzip e2e-1201-composites_ch3.zip to a location of your choice (the SOA composite did not change
in chapter 4, thats why youll use the chapter 3 solution)

Open JDeveloper

Open the previously unzipped application by selecting Application Open from the main JDeveloper
menu

Select e2e-1201-composites.jws in e2e-1201-composites

Alternatively, if you already have an application e2e-1201-composites and only need to import specific
projects
Locate from the following list of projects the ones you want to import in ~/e2e-1201orderprocessing/solutions/ ch4-addOrderInputChannels/SOAProjects:
-

ValidatePayment_ch2zip

ProcessOrder_ch3.zip

Extract the project into the e2e-1201-composites folder


In JDeveloper, choose Open Project and choose the .jpr file in your project (see screenshots below):
Chapter 5: Pack and Ship Service

Page 191 of 392

Oracle Confidential Do not distribute to third parties

To deploy service bus solutions:


-

Locate ~/e2e-1201-orderprocessing/solutions/ch4-addOrderInputChannels

Unzip e2e-1201-servicebus-ch4.zip to a location of your choice

Open JDeveloper

Open the previously unzipped application by selecting Application Open from the main JDeveloper
menu

Select e2e-1201-servicebus.jws in e2e-1201-composites

Chapter 5: Pack and Ship Service

Page 192 of 392

Oracle Confidential Do not distribute to third parties

Introduction
In this chapter, you will build the pack and ship service.
The pack and ship service is defined with a REST interface and accepts a Shipping resource (part of the
canonical order message). It initiates the packing and shipping of one order and notifies the customer
that the order has shipped.
It also updates the order status in the database to Shipped.
Once done, your project will look like this.

Chapter 5: Pack and Ship Service

Page 193 of 392

Oracle Confidential Do not distribute to third parties

High-level steps

Create a new project PackAndShipService.

Create a SOA REST inbound interface using Shipping as a resource.

Create a BPEL process to

set the status of the order to Shipped.

update the status of the order in the database.

send an email to the customer that the order has been shipped.

Add a composite sensor for the ShippingProvider.

Test the service in JDeveloper.

Inspect the instances in EM FMWC.

Chapter 5: Pack and Ship Service

Page 194 of 392

Oracle Confidential Do not distribute to third parties

Steps in Detail
Create the Packing Service project
Oracle Service Bus provided REST support in 11g, but Oracle SOA Suite 11g had very limited support
through HTTP binding only.
SOA Suite 12c provides the following REST support:

Support in SOA composite applications:


o Enable REST support in new or existing services
o Integrate with external REST APIs
o Orchestrate a set of RESTful state transitions (RPC/HATEOAS approach)
o Support for XML, JSON (with automatic translation to and from XML), and URL-encoded
GET/POST data
Ease of development:
o Oracle JDeveloper wizard for modeling REST interfaces and WSDL mappings
o Readable API that publishes each method used upon deployment
o Ability to browse and consume Oracle REST endpoints (including Oracle Service Bus)
from within Oracle JDeveloper
Oracle Web Service Manager (OWSM) policy support for REST security
Support for the following use cases:
o Get a list of customers
o Create a new customer
o Get customer details
o Update customer details
o Delete a customer
o Create a new address for a customer
o Get a customers address
o Update a customers address

For more information, please see Integrating REST Operations in SOA Composite Applications in soadev-guide.pdf.

Please follow the steps below to create a SOA Suite 12c REST service:

Create a new SOA project PackAndShipService with an empty composite in the application e2e1201-composites.

Chapter 5: Pack and Ship Service

Page 195 of 392

Oracle Confidential Do not distribute to third parties

Click OK

Click Next

Chapter 5: Pack and Ship Service

Page 196 of 392

Oracle Confidential Do not distribute to third parties

Click Finish

Open the newly created project if it doesnt open automatically.

Chapter 5: Pack and Ship Service

Page 197 of 392

Oracle Confidential Do not distribute to third parties

Define a REST interface for the Packing Service Project


The packing service expects a shipping resource that includes all necessary information to pack and ship
an order. It will also return a shipping resource with an updated order status.
The only operation were going to define for this service will be a POST operation.

Drag and drop a REST Binding Adapter into the Exposed Services lane

Set the following fields:

Name: packingService

Description: The order is packed and shipped

Add a new resource /shipping by following the steps below.


o

Click the green + sign next to Resources to open the Create REST Resource dialog

Chapter 5: Pack and Ship Service

Page 198 of 392

Oracle Confidential Do not distribute to third parties

Insert /shipping as relative path to the resource

Click OK

Delete the default resource / by selecting it and clicking the X sign

Now add an operation binding by clicking the + sign next to Operation Binding

Chapter 5: Pack and Ship Service

Page 199 of 392

Oracle Confidential Do not distribute to third parties

Set the following fields:


o

Operation: packAndShip

Resource: /shipping/

HTTP Verb: POST

Request:
o

Payload: select XML (already checked by default)

Specify the schema file by clicking the browse button:

Import the CanonicalOrder.xsd schema from the ProcessOrder project or from the resources folder

Chapter 5: Pack and Ship Service

Page 200 of 392

Oracle Confidential Do not distribute to third parties

Click OK to choose the CanonicalOrder.xsd schema

Uncheck Maintain original directory structure for imported files

Click OK

Choose the Shipping element

Chapter 5: Pack and Ship Service

Page 201 of 392

Oracle Confidential Do not distribute to third parties

Click OK

The REST Operation Binding dialog provides the ability to generate a sample payload.

Click the Generate a sample payload icon

Browse to a different directory to store the sample payload in.

Chapter 5: Pack and Ship Service

Page 202 of 392

Oracle Confidential Do not distribute to third parties

Create a new folder SampleInput under SOA by clicking the Create new subdirectory icon.

Chapter 5: Pack and Ship Service

Page 203 of 392

Oracle Confidential Do not distribute to third parties

Select the newly created directory

Change the file name to SampleShipping.xml

Chapter 5: Pack and Ship Service

Page 204 of 392

Oracle Confidential Do not distribute to third parties

Click OK

Now lets define the response of the REST service

Select the Response tab

Uncheck No Payload if it is checked

Browse for a schema file

Chapter 5: Pack and Ship Service

Page 205 of 392

Oracle Confidential Do not distribute to third parties

Choose CanonicalOrder.xsd and the Shipping element in there

Click OK

Leave HTTP Statuses set to 200

Chapter 5: Pack and Ship Service

Page 206 of 392

Oracle Confidential Do not distribute to third parties

Add a description.

Click OK to complete the definition of the REST operation binding.

Chapter 5: Pack and Ship Service

Page 207 of 392

Oracle Confidential Do not distribute to third parties

Click OK to complete the definition of the REST service.

Chapter 5: Pack and Ship Service

Page 208 of 392

Oracle Confidential Do not distribute to third parties

Create the Packing BPEL process


Now create a BPEL process exposing the REST interface we just created.

Create a new BPEL process

Name: packAndShipOrder

Template: Define Service Later (The interface will be defined when we wire this process
to the REST binding, later in the procedure.)

Click OK

Wire the REST binding to the BPEL process

Click OK when asked to set the transaction properties of the BPEL service

Chapter 5: Pack and Ship Service

Page 209 of 392

Oracle Confidential Do not distribute to third parties

Open the BPEL process for editing

There is no receive activity defined yet, but the partner link for the REST service is already
available.

Add a Receive activity to be called from the REST service.

Wire the REST partnerlink to the Receive activity (Start the wire at the Receive activity and drag
it to packingService).

Chapter 5: Pack and Ship Service

Page 210 of 392

Oracle Confidential Do not distribute to third parties

This opens the editor for the Receive activity

Name it receiveShippingInfo

Check Create Instance (when receiving this request, a new BPEL instance will be created).

Click the + sign to automatically create the input variable

Chapter 5: Pack and Ship Service

Page 211 of 392

Oracle Confidential Do not distribute to third parties

Click OK twice

This defines half of the interface of the BPEL process

Chapter 5: Pack and Ship Service

Page 212 of 392

Oracle Confidential Do not distribute to third parties

To complete the interface, we must define a reply activity

Drag a reply activity under the receive activity

Wire the reply activity to the packingService partnerlink

Rename it to replyShipping

Auto-create the output variable

Chapter 5: Pack and Ship Service

Page 213 of 392

Oracle Confidential Do not distribute to third parties

This completes the interface definition for the BPEL process

Chapter 5: Pack and Ship Service

Page 214 of 392

Oracle Confidential Do not distribute to third parties

This service initiates the packing and shipping, based on shipping provider and shipping method, which
are both determined by the order fulfillment service.
To simulate the packing and shipping, we will add an empty activity to the BPEL process.

Chapter 5: Pack and Ship Service

Page 215 of 392

Oracle Confidential Do not distribute to third parties

In the property inspector, name the activity ShippingService.

After the ShippingService is complete, we update the order status to Shipped.

But first we create two new variables for orderNumber and orderStatus. These will be used
later and will be assigned in the next step.

Open the Variables view by clicking the Property Structure icon on top of the BPEL editor

Select Variables Process Variables and click the + sign to add a new variable

Chapter 5: Pack and Ship Service

Page 216 of 392

Oracle Confidential Do not distribute to third parties

Name the variable orderNumber and browse to the simple type string

Click OK

Click OK again

Create the orderStatus variable the same way

Chapter 5: Pack and Ship Service

Page 217 of 392

Oracle Confidential Do not distribute to third parties

Close the Variables editor

Now lets add an assign activity after the empty activity.

Name it setOrderStatusToShipped.

Launch the Assign Editor

Set the status in the input shipping method to Shipped by using the expression builder as you
did several times before.

Chapter 5: Pack and Ship Service

Page 218 of 392

Oracle Confidential Do not distribute to third parties

Also assign the order number and order status to the variables we just created.
o

orderNumber is set from the input variable

orderStatus is set to Shipped

The order status element in the input message is optional. Right-click on the right hand side of
the copy rule (which assigns the order status to the input variable) and choose
insertMissingToData

Chapter 5: Pack and Ship Service

Page 219 of 392

Oracle Confidential Do not distribute to third parties

In a similar way, the order number in the input message is optional. Right-click on the right hand
side of the copy rule (which assigns the order number to the order number variable) and choose
ignoreMissingFromData

Click OK

Now we still have to set the output variable for the BPEL process.

Add an assign activity before the reply activity

Name it assignShippingReply

Chapter 5: Pack and Ship Service

Page 220 of 392

Oracle Confidential Do not distribute to third parties

In the Assign Editor, set the value of the input variable (with the updated status) to the output
variable.

Your BPEL process now looks like this:

Chapter 5: Pack and Ship Service

Page 221 of 392

Oracle Confidential Do not distribute to third parties

Deploy this project, following the same steps as you did previously

Testing a REST service is different than testing a SOAP service. The details will be explained
in the next section.

Chapter 5: Pack and Ship Service

Page 222 of 392

Oracle Confidential Do not distribute to third parties

Test the REST service in JDeveloper


SOA REST services expose WADL files instead of WSDL files to define their interface. You can read more
about WADL in Web Application Description Language on Wikipedia and W3C Web Application
Description Language.
In order to be able to test the REST service, you will need to get the WADL location from EM FMWC.

Deploy the PackAndShip Service

Open EM FMWC: Error! Hyperlink reference not valid., substitute your own host name and port
number.

Click on the deployed composite PackAndShipService

Click on the Show WADL and Text Description URL icon

This opens the Service WADL and Text Description URL window:

Chapter 5: Pack and Ship Service

Page 223 of 392

Oracle Confidential Do not distribute to third parties

Copy the WADL URL to a place where youll be able to retrieve it in a later step. You will need it
for testing the service in JDeveloper.

It will look something like: http://slc04rbc.us.oracle.com:7101/soainfra/resources/default/PackAndShipService!1.0/packingService/application.wadl

Go back to JDeveloper.

From the menu in the main JDeveloper window, select Tools HTTP Analyzer

Drag the window up from the bottom for easier access

Click Open URL

Enter the WADL URL you copied above

Chapter 5: Pack and Ship Service

Page 224 of 392

Oracle Confidential Do not distribute to third parties

Press Return

You will now see the WADL file which includes the POST method

If the WADL file opens in source view and you dont see a design tab, close and restart
JDeveloper.

Within the WADL file design view, click Test in the POST method

Copy and paste the sample message you created previously (SampleShipping.xml)

Chapter 5: Pack and Ship Service

Page 225 of 392

Oracle Confidential Do not distribute to third parties

Click on Send Request below the sample message

After a little while, you should see a response message with order status Shipped

Chapter 5: Pack and Ship Service

Page 226 of 392

Oracle Confidential Do not distribute to third parties

Repeat the same test with ShippingSample.xml in ~/e2e-1201-orderprocessing/sample_input.

You tested the REST service successfully!


You can leave the window open and perform additional tests after you make further changes.

Chapter 5: Pack and Ship Service

Page 227 of 392

Oracle Confidential Do not distribute to third parties

Update the order status in the database


In addition to updating the order status in the shipping message, the order status must be updated in
the database.
Recall from chapter 3 that this is an action that needs to be performed repeatedly.
A component template has been prepared for you. It includes a standalone BPEL subprocess that calls a
database adapter to update the order status.

The template looks like this:

If you havent done so already in chapter 2, add the path to the templates folder to the list of folders
that are scanned for templates.
Open Tools Preferences and choose SOA Templates:

The following steps describe how to add the updateOrderStatusSP template to the pack and ship
project.

Open the PackAndShipService composite if its not already open.

In the Components palette, scroll to the bottom where you see the Component Templates

Make sure updateOrderStatusSP is visible

If its not visible, close and reopen the composite editor

Chapter 5: Pack and Ship Service

Page 228 of 392

Oracle Confidential Do not distribute to third parties

Drag and drop the template in the middle of the component palette

A window opens providing an overview of all artifacts bundled with the template.

Chapter 5: Pack and Ship Service

Page 229 of 392

Oracle Confidential Do not distribute to third parties

You can see all artifacts necessary for the database adapter and the subprocess. None of the
artifacts are optional.

Click OK to accept

The composite now includes the adapter and the subprocess.

Open the updateOrderStatusSP subprocess to see what it does.

You will notice an assign activity and an invoke activity to the database adapter.

The assign takes an order number and an order status and assigns it to the input variable of the
adapter.

Chapter 5: Pack and Ship Service

Page 230 of 392

Oracle Confidential Do not distribute to third parties

Close the subprocess and open the packAndShipOrderProcess BPEL process

The call to the updateOrderStatusSP subprocess is available in the BPEL constructs palette
under Subprocesses - Standalone

Drag and drop it under the setOrderStatusToShipped assign activity

Chapter 5: Pack and Ship Service

Page 231 of 392

Oracle Confidential Do not distribute to third parties

Change the name to updateOrderStatusToShipped

In the property inspector you can see the arguments for the subprocess.

We only need to provide the order number and order status.

Select the orderNumber and click on the small area behind the value to select the input.

Chapter 5: Pack and Ship Service

Page 232 of 392

Oracle Confidential Do not distribute to third parties

Browse to the variable orderNumber

In the variable chooser, pick the variable orderNumber

Click OK

Click OK

Repeat the process to set the variable orderStatus.

Chapter 5: Pack and Ship Service

Page 233 of 392

Oracle Confidential Do not distribute to third parties

No other variables need to be set as theyre internal to the subprocess.

In order to test this service, you must use an existing order number value for orderNumber. The easiest
way to do this is to run ProcessOrder first and make note of the order number.
When you have an order number, test the PackAndShipService, using the ShippingSample.xml sample
file, replacing the orderNumber with the ProcessOrder output.
Check the flow trace to make sure there was no error:

Chapter 5: Pack and Ship Service

Page 234 of 392

Oracle Confidential Do not distribute to third parties

Add a composite sensor


Well add a sensor for the shipping provider to this composite.
Youll be able to search for all orders that have been shipped with a specific shipping provider.

Open the composite view

Right-click on the REST service and choose Configure Sensors

Select the packingService interface

Define a sensor ShippingProvider

Define an expression for the sensor

Chapter 5: Pack and Ship Service

Page 235 of 392

Oracle Confidential Do not distribute to third parties

Choose the ShippingProvider Name in the Shipping method in the incoming message

Click OK

The composite now looks like this:

Chapter 5: Pack and Ship Service

Page 236 of 392

Oracle Confidential Do not distribute to third parties

Deploy and test the service and check out the sensor values in EM FMW by opening the flow trace
of the just-created instance and choosing the sensor tab:

Use sample messages with different Shipping Providers to see how the sensors values change.

Chapter 5: Pack and Ship Service

Page 237 of 392

Oracle Confidential Do not distribute to third parties

Send an Email Notification


Next you will use a UMS Adapter to send an email notification indicating that the Order was shipped.
Please make sure to follow the steps outlined in section UMS Setup and Configuration at the end of this
document to configure the infrastructure for emails. After configuring UMS, continue with the steps
below.

For this drag and drop the UMS Adapter from the palette into the right swimlane.

Name it NotifyUser.

Click Next

Accept the default for the JNDI Name

Click Next

Leave the Outbound Send Notification checked and accept the default for the
SendNotification.

Chapter 5: Pack and Ship Service

Page 238 of 392

Oracle Confidential Do not distribute to third parties

Click Next

In the next screen, leave Email selected as the type of notification. Specify the Subject Your
order has been shipped and the correct email address (see below) in the From and To fields.

Click Next

Select Message is String type and then finish the wizard.

Chapter 5: Pack and Ship Service

Page 239 of 392

Oracle Confidential Do not distribute to third parties

Click Next

Click Finish

Now wire the Adapter reference to the PackAndShipService BPEL Component

Open the BPEL Editor

Add an Invoke activity before the Reply activity to invoke the email adapter

Chapter 5: Pack and Ship Service

Page 240 of 392

Oracle Confidential Do not distribute to third parties

In the Property Inspector, browse for the NotifyUser partner link

Change the name to notifyUserByEmail

Click the + sign next to Input to auto-generate the input variable

There is no output variable

Chapter 5: Pack and Ship Service

Page 241 of 392

Oracle Confidential Do not distribute to third parties

The complete Invoke activity looks like this:

Next, build the message payload by dragging an Assign activity just before the Invoke activity.

Name it assignNotification

Chapter 5: Pack and Ship Service

Page 242 of 392

Oracle Confidential Do not distribute to third parties

In the Assign Editor, add an expression to the payload child element of the input variable of the
invoke activity that wires to the UMS Adapter.

Use the following expression to populate the payload by extending the output variable and
concatenating the order number and shipping provider.

concat("Your order#", $orderNumber, has been shipped via ,


$replyShipping_packAndShip_OutputVariable.reply/ns2:ShippingProvider/ns2:Name)

Chapter 5: Pack and Ship Service

Page 243 of 392

Oracle Confidential Do not distribute to third parties

Chapter 5: Pack and Ship Service

Page 244 of 392

Oracle Confidential Do not distribute to third parties

Note: The namespace prefixes could be different for you so dont just copy and paste the expression!

Click OK

Your BPEL process is now complete.

Chapter 5: Pack and Ship Service

Page 245 of 392

Oracle Confidential Do not distribute to third parties

Please deploy and test the process again and make sure you receive an email notification.

Check email notification


To check the email notification, you can use the telnet protocol on the configured pop3 port 1110.
Please note that telnet is disabled on windows 7 by default. Please follow the steps in this article to
enable: http://social.technet.microsoft.com/wiki/contents/articles/910.how-to-enable-telnet-client-inwindows-7.aspx.

Chapter 5: Pack and Ship Service

Page 246 of 392

Oracle Confidential Do not distribute to third parties

Here are the steps to check the email notification:


Open up a command prompt and run the following commands.

telnet localhost 1110


user daniel
pass welcome1
retr 1 (there is a whitespace in between)

This will retrieve the first message. If no message has been received yet, you will see -ERR Message (1)
does not exist.
Here is an example.

You can also run list to see how many emails have been received.

Chapter 5: Pack and Ship Service

Page 247 of 392

Oracle Confidential Do not distribute to third parties

UMS Setup and Configuration


Were using Apache James Email Server for the email notification once the order is ready.
Please follow the steps below to download, install, configure and start James email server, configure
UMS and target the UMS adapter.
The email server will be configured with the users Admin and Daniel (email=adminuser@localhost, and
email = daniel@localhost).
Please check the AdapterConfig folder under e2e-1201-orderprocessing/scripts. This folder includes the
scripts necessary for the UMS setup.
On linux, you may have to change permissions for the script files. Please make sure you can execute
them.

Download and configure Apache James 2.3.2

Download Location - http://james.apache.org/download.cgi

Go to the Section "Apache James 2.3.2 is the stable version" on the page

Click on the link for "Binary (ZIP Format)" to download a zip distribution of Apache James to the
AdapterConfig folder for windows or linux.

Configure the email server

Open up a command prompt and navigate to the AdapterConfig folder.

Ensure that JAVA_HOME is set and JAVA_HOME/bin is in your PATH.

Execute "james.sh" if you are on linux, or "james.bat" if you are on windows.

Start the email server

Open up a second command prompt and navigate to the AdapterConfig folder.

Go to the james-2.3.2/bin directory.

Type in run.sh or run.bat depending on whether you are on linux or windows.

You should see something like the below:

Chapter 5: Pack and Ship Service

Page 248 of 392

Oracle Confidential Do not distribute to third parties

Stop the email server (when needed)

Open up a command prompt.

Type telnet localhost 4555. (Use localhost or wherever you have james set up and running)

Login as root/root.

Type shutdown.

Note: You could also force stop the James server by pressing Ctrl+C on the console where James was
started in.

Target the UMS and Coherence adapter


The coherence adapter will be used in chapter 6 and will be targeted together with the UMS adapter.

Open up a command prompt and navigate to the AdapterConfig folder.

Ensure that MW_HOME is set. For example execute the following command on windows: set
MW_HOME=D:\oracle\Middleware\soa12c or on linux setenv MW_HOME
/oracle/Middleware/soa12c, using the correct path for your installation

Open up the target_adapters.py file and check the host/port, userName, password and the
server name.
The script uses the default values and should work if you havent made any changes to the
defaults. If you didnt use the default values, please change the file accordingly

host: localhost
port: 7101
username/password: weblogic/welcome1
Server Name: DefaultServer

Run target_adapters.bat on windows or target_adapters.sh on linux.

You should now be able to see that the adapters are in Active state in the WLS Admin Console.

Navigate to Error! Hyperlink reference not valid. where host/port are the admin server host
and port values (default is http://localhost:7101/console).

Chapter 5: Pack and Ship Service

Page 249 of 392

Oracle Confidential Do not distribute to third parties

Click on Deployments on the left hand side.

You should see the Coherence Adapter and UMS Adapter in the table on the right. You may
have to press Next a few times or customize the table to see all entries.

Coherence Adapter

UMS Adapter:

Configure the UMS Adapter to use the Apache James server

Edit the config_emails.bat or config_emails.sh (depending on whether you are on windows or


linux, and replace <DomainPath> with the path to your domain directory.

Chapter 5: Pack and Ship Service

Page 250 of 392

Oracle Confidential Do not distribute to third parties

The actually domain name is created dynamically by concatenating system and a string of
numbers, e.g. system12.1.2.0.40.66.59 and will be located in your user directory. Please make
sure you copy the correct path into the script.

The location of the domain directory depends on the value of JDEV_USER_DIR when
you created the default domain. It will look like
$JDEV_USER_DIR/system12.1.2.0.40.66.59/DefaultDomain

If you cannot find your domain home, open EM FM Control Error! Hyperlink reference
not valid., where host/port are the admin server host and port values, e.g.
http://localhost:7101/em with username/password: weblogic/welcome1.

Under Target Navigation, open SOA soa-infra soa-infra (DefaultServer)

Right-click on soa-infra (DefaultServer) and select Target Information

This will open a window with information about your environment, including your
Domain Home:

Chapter 5: Pack and Ship Service

Page 251 of 392

Oracle Confidential Do not distribute to third parties

After setting <DomainPath> with the path to your domain directory open up a command
prompt and navigate to the AdapterConfig folder.

Run the script config_emails.bat if you are on windows, or config_emails.sh if you are on linux.

Restart the integrated WebLogicServer in JDeveloper.

After restarting the server, you should see the updated configuration on the UMS Messaging
driver configuration page in EM FMW Control.

To verify this, go to Error! Hyperlink reference not valid., where host/port are the admin server
host and port values, e.g. http://localhost:7101/em.

Expand User Messaging Service and right-click on usermessagingdriver-email (DefaultServer)


and select Email Driver Properties

Make sure you see the same values as in the screenshot below:

Chapter 5: Pack and Ship Service

Page 252 of 392

Oracle Confidential Do not distribute to third parties

Chapter 5: Pack and Ship Service

Page 253 of 392

Oracle Confidential Do not distribute to third parties

Chapter 6: Fulfill Order


Overview
In this chapter, you will build the second part of the order fulfillment service, the FulfillOrder composite.
The composite listens to orders being processed, select a Shipping Provider and then invoke the
PackAndShip service that was built in the previous chapter.

Prerequisites

JDeveloper is up and running.

The integrated server in JDeveloper is up and running with Chapter 5 completed.

Debugger has been terminated.

If you did not complete Chapter 5, obtain and deploy the solution, following the steps below:
To deploy SOA solutions:
-

Locate e2e-1201-orderprocessing/solutions/ch5-packAndShip

Unzip e2e-1201-composites_ch5.zip to a location of your choice

Open JDeveloper

Open the previously unzipped application by selecting Application Open from the main JDeveloper
menu

Select e2e-1201-composites.jws in e2e-1201-composites

Alternatively, if you already have an application e2e-1201-composites and only need to import specific
projects.
Locate from the following list of projects the ones you want to import in e2e-1201orderprocessing/solutions/ch5-packAndShip/SOAProjects:
-

ValidatePayment_ch2zip

ProcessOrder_ch3.zip

PackAndShipService_ch5.zip.

Extract the projects into the existing e2e-1201-composites folder


In JDeveloper, choose Open Project and choose the .jpr file in your project (see screenshots below):

Chapter 6: Fulfill Order

Page 254 of 392

Oracle Confidential Do not distribute to third parties

To deploy service bus solutions:


-

Locate e2e-1201-orderprocessing/solutions/ch5-packAndShip

Unzip e2e-1201-servicebus-ch4.zip to a location of your choice

Open JDeveloper

Open the previously unzipped application by selecting Application Open from the main JDeveloper
menu

Select e2e-1201-servicebus.jws in e2e-1201-composites

Chapter 6: Fulfill Order

Page 255 of 392

Oracle Confidential Do not distribute to third parties

Introduction
In this chapter, you will build the order fulfillment service.
The service is triggered when an order is updated as ReadyForShip in the database. It then locates the
shipping speed in the order message, determines the shipping method based on shipping speed and
shipping state, reads the preferred shipping provider from the database or cache, and calls the pack and
ship REST service.
When its completed, your project will look like this.

Chapter 6: Fulfill Order

Page 256 of 392

Oracle Confidential Do not distribute to third parties

High-Level Steps

Create a new SOA project called FulfillOrder from a project template.

The DB adapter polls the order table for orders that are ready for shipment. (This will be used
later for the ESS use case where we activate this adapter only at certain times of the day.).

It receives a single order and transforms it into a fulfillment order (using XSLT).

A business rule (decision table) is used to decide the shipping method based on shipping speed
and shipping state.

Based on the shipping method, the preferred shipping provider is retrieved from the database.

The Order is sent to the packing service via SOA REST outbound.

The coherence adapter puts the shipping provider into the cache, so that it can be retrieved
from the cache instead of the database.

Chapter 6: Fulfill Order

Page 257 of 392

Oracle Confidential Do not distribute to third parties

Steps in Detail
Create the FulfillOrder project from SOA project template

Create a new SOA project FulfillOrder in the e2e-1201-composites application

Choose File New Project from the main JDeveloper menu

Select a SOA Project

Click OK

Name the new project FulfillOrder

Chapter 6: Fulfill Order

Page 258 of 392

Oracle Confidential Do not distribute to third parties

Click Next

Check SOA Template

Select the FulfillOrderTemplate

The composite name is automatically retrieved from the project name you entered earlier

Click Finish to create the project

Chapter 6: Fulfill Order

Page 259 of 392

Oracle Confidential Do not distribute to third parties

Get familiar with the FulfillOrder project

Importing the project template creates a new project with two database adapters and a BPEL
process

The first database adapter listens to orders with status ReadyForShip, reads the record out of the
database and triggers a new BPEL process for each order.

In order to prevent the order from being read again, it changes the status to ReadyForPack.

The second database adapter reads the shipping provider from the database, using the shipping
method ID as primary key.

As part of the database setup, we keep a list of preferred shipping providers per shipping method.
For example, USPS is used for USAFirstClass shipping (shipping method ID =1), UPS for USAPriority
(shipping method ID =2), and so on.

Lets have a look at the BPEL process receiveOrderToShip

Double click the BPEL process to edit it

The process is started by the database adapter input

The message provided from the database adapter is in a format specific to the database adapter.

An XSLT map is used to transform the message into a canonical order message

The fulfillOrder BPEL process is invoked with the canonical order message as input.

The fulfillOrder BPEL process is also already partially predefined:


Chapter 6: Fulfill Order

Page 260 of 392

Oracle Confidential Do not distribute to third parties

The incoming order message includes the shipping speed selected by the customer:

Standard shipping: 3-5 business days

Two-Day shipping

One-Day shipping

The shipping method ID is hard-coded at the moment to 2 (=USAPriority). This will be replaced by a
business rule that determines the shipping method based on shipping speed and shipping address.

This shipping method ID is used as input to the database call to retrieve the shipping provider.

One of the following sections will describe how to invoke the previously defined packAndShip REST
service.

The last section will explain how to use the coherence cache for the shipping provider instead of
reading it from the database every time its needed.

Chapter 6: Fulfill Order

Page 261 of 392

Oracle Confidential Do not distribute to third parties

Determine the Shipping Method through Business Rules


This section adds a business rule to determine the shipping method ID.
The rule takes as input the shipping state and the requested shipping speed and returns the shipping
method ID. For the purposes of this lab, use state to determine if shipping should be ground or air,
assuming that in the state where the shipping facilities are would not require air for the requested
speed.
The rule input and output are both of type Shipping.

State (in Address) is a string.

Shipping speed is an enumeration: Standard, Twoday, Oneday.

Shipping method ID is an integer. Some pre-defined values are: 1 (USAFirstClass), 2


(USAPriority), 3 (USAFreeMail).

In the composite editor, drag and drop a Business Rule component to the Components swim
lane

Chapter 6: Fulfill Order

Page 262 of 392

Oracle Confidential Do not distribute to third parties

Name it DetermineShippingRules

Specify Input and Output types for the Business Rule:

Click the green + icon in Inputs/Outputs and choose Input

Chapter 6: Fulfill Order

Page 263 of 392

Oracle Confidential Do not distribute to third parties

Expand CanonicalOrder.xsd under Project Schema Files and select Shipping

Click OK

Chapter 6: Fulfill Order

Page 264 of 392

Oracle Confidential Do not distribute to third parties

Click the green + icon in Inputs/Outputs and choose Output

Again, expand CanonicalOrder.xsd under Project Schema Files and select Shipping

Chapter 6: Fulfill Order

Page 265 of 392

Oracle Confidential Do not distribute to third parties

Click OK

Your Business Rule should now look like this:

Click OK

Your composite now looks like this:

Double click on the Business Rule component in the composite

Chapter 6: Fulfill Order

Page 266 of 392

Oracle Confidential Do not distribute to third parties

The rules editor opens

Create a new Decision Table:

Click the + icon in Decision Tables

A new view opens where we can specify the conditions and actions to take based on those
conditions

Chapter 6: Fulfill Order

Page 267 of 392

Oracle Confidential Do not distribute to third parties

First define the conditions:

Click on <insert condition>

Double click on Shipping Type

Chapter 6: Fulfill Order

Page 268 of 392

Oracle Confidential Do not distribute to third parties

You will see a drop down list where you can select the specific elements you want to define
conditions for

Expand Shipping Type and select shippingSpeed

Add a second condition for shipping state by clicking on the + sign and selecting Condition:

Expand Shipping Type and select address - state

Chapter 6: Fulfill Order

Page 269 of 392

Oracle Confidential Do not distribute to third parties

Next add rules for the conditions.

Expand the list from the + icon and select Rule.

Repeat two more times until you have four rules.

You need to define a condition for each rule

Chapter 6: Fulfill Order

Page 270 of 392

Oracle Confidential Do not distribute to third parties

Click on the ? in the R1 column. A list appears that allows us to select from the valid values for
shippingSpeed.

For R1 select ONEDAY.

Click OK

For R2 select TWODAY

For R3 select STANDARD

For R4, select Specify Value as Dont Care. For this rule, shipping speed does not matter

Chapter 6: Fulfill Order

Page 271 of 392

Oracle Confidential Do not distribute to third parties

Add a condition for state in R4: TX. Make sure to hit enter after entering the value.

For the other rules we dont care about the state, only shipping speed matters.

Select Specify Value as Dont Care for those

Next define the action to take for each condition

Click on <insert action> under Actions

Select the modify action

Chapter 6: Fulfill Order

Page 272 of 392

Oracle Confidential Do not distribute to third parties

Double click on the modify entry

Select ShippingType as the type were going to modify and shipMethod as the element

Check the Parameterized checkbox for the shipMethod element

Chapter 6: Fulfill Order

Page 273 of 392

Oracle Confidential Do not distribute to third parties

Click OK

Now define the specifics of the actions for each Rule column:

The shippingMethod element accepts integer values 1-3

In the R1 column select the checkbox

Then click in the field below

Enter 1 and hit the Enter key

In the R2 column enter 2 and then enter 3 in the R3 column

Chapter 6: Fulfill Order

Page 274 of 392

Oracle Confidential Do not distribute to third parties

For R4 enter 7 for UPSGround.

When finished the Action columns should look like this:

Here is a broader perspective of what your decision table should now look like

Notice there is a conflict the dictionary shows you that more than one rule can fire for certain
input values. Double-click the Rule 4 conflict and have it override rules 1 and 2.

Chapter 6: Fulfill Order

Page 275 of 392

Oracle Confidential Do not distribute to third parties

Click OK

Before adding the business rules activity to the BPEL process, change the name of the decision
table to DetermineShippingMethod by clicking on the name on top

Hit the enter key

Chapter 6: Fulfill Order

Page 276 of 392

Oracle Confidential Do not distribute to third parties

Save and close the rules editor.

Chapter 6: Fulfill Order

Page 277 of 392

Oracle Confidential Do not distribute to third parties

From the composite view double click the fulfillOrder BPEL process

In the BPEL Process editor, drag a Business Rule (in SOA Components) under the receiveInput
activity

Chapter 6: Fulfill Order

Page 278 of 392

Oracle Confidential Do not distribute to third parties

Double click on the Business Rule activity

Select the Dictionary or Business Rule that this activity invokes in the Edit Rule window. In this
case its the DetermineShippingRules Dictionary.

Next define the Copy Rules for the Input and Output Facts.

You will copy the ShippingType from the process inputVariable to the dsIn variable of the
Business Rule.

For the output were going to copy the ShippingMethod from the dsOut variable of the
Business Rule to the shippingMethodID process variable

First select the + icon for Assign Input Facts

On the left we have the source or From. On the right we have the destination or To

On the left, expand inputVariable payload Order and select Shipping

On the right, under Scope Rule1 - Variables, expand dsIn payload callFunctionStateless parameterList and select Shipping

Chapter 6: Fulfill Order

Page 279 of 392

Oracle Confidential Do not distribute to third parties

Click OK

Assign Input Facts should now look like this:

Select the Assign Output Facts tab

Click on the + icon

Chapter 6: Fulfill Order

Page 280 of 392

Oracle Confidential Do not distribute to third parties

Copy the updated ShippingMethod type to the shippingMethodID variable

On the left, expand dsOut payload callFunctionStatelessDecision resultList Shipping and


select ShipMethod (this variable contains the shipping method ID)

On the right, select shippingMethodID

Click OK

Assign Output Facts should now look like the below

Chapter 6: Fulfill Order

Page 281 of 392

Oracle Confidential Do not distribute to third parties

Rename the activity to determineShippingMethod

Click OK

Deploy and test the project (by running ProcessOrder).

In the Flow Trace you will now see the business rule:

If you click on it, you can see the audit trail

Chapter 6: Fulfill Order

Page 282 of 392

Oracle Confidential Do not distribute to third parties

In the BPEL process audit trail, you can see that the business rule activity consists of a number
of other activities

This reflects what you see when you expand the activity in the BPEL editor.

Chapter 6: Fulfill Order

Page 283 of 392

Oracle Confidential Do not distribute to third parties

In the test message, state is CA and shipping speed is standard. The result of the business rule is
3.

Add a composite sensor to the fulfillOrder composite

As we did in previous chapters, we will add a composite sensor for the orderNumber

In the composite editor, right-click on the ReceiveOrdersReadyForShipment database adapter


and choose Configure Sensors

Chapter 6: Fulfill Order

Page 284 of 392

Oracle Confidential Do not distribute to third parties

With the database service selected, click the blue + sign to create a new sensor

Name it OrderNumber and create an Expression

Choose the orderNumber in the input message by expanding the in node, select orderNumber
and click Insert Into Expression

Chapter 6: Fulfill Order

Page 285 of 392

Oracle Confidential Do not distribute to third parties

Click OK to close the Expression Builder

Click OK to create the sensor

Click OK again

Chapter 6: Fulfill Order

Page 286 of 392

Oracle Confidential Do not distribute to third parties

Deploy and test this composite by running the ProcessOrder composite

Open the flow trace in EM FMWC

You can see the sensor value in the EM Flow Trace

Chapter 6: Fulfill Order

Page 287 of 392

Oracle Confidential Do not distribute to third parties

Call the pack and shipping service


We will use a REST interface to call the previously created PackAndShip service.

Open the composite editor and drag and drop a REST binding into the External References
swimlane.

Name it packAndShipOrder

Add the operations based on the WADL file created in the previous chapter:

Click the green + sign to the right of Operations Bindings and choose Add operations based
on WADL Service

Click the Browse for the WADL icon

Chapter 6: Fulfill Order

Page 288 of 392

Oracle Confidential Do not distribute to third parties

Select Application Server

Select the IntegratedWebLogicServer

Expand the SOA node and find the PackAndShipService REST interface

Select the packingService

Leave copy schema artifacts into the project checked

Click OK to accept the choice

Chapter 6: Fulfill Order

Page 289 of 392

Oracle Confidential Do not distribute to third parties

Click OK again

Uncheck Maintain original directory structure for imported files and Rename duplicate
files

Click OK

Everything has been filled in automatically based on the WADL file

Chapter 6: Fulfill Order

Page 290 of 392

Oracle Confidential Do not distribute to third parties

Click OK to close the REST binding creation window

This completes the definition of the REST binding.

Chapter 6: Fulfill Order

Page 291 of 392

Oracle Confidential Do not distribute to third parties

Now wire the BPEL process to the packAndShipOrder service

Open the fulfillOrder BPEL process

Add an invoke activity as the last activity in the BPEL process

Chapter 6: Fulfill Order

Page 292 of 392

Oracle Confidential Do not distribute to third parties

In the property inspector, change the name to invokePackAndShipOrder

Browse to the packAndShipOrder partnerlink

Click OK

Automatically create input and output message and keep the default names

Chapter 6: Fulfill Order

Page 293 of 392

Oracle Confidential Do not distribute to third parties

Create a new assign activity before the invoke to set the input message for the REST service

Name it assignShipping

Chapter 6: Fulfill Order

Page 294 of 392

Oracle Confidential Do not distribute to third parties

In the Assign Editor, map the shipping element in the process input variable to the shipping
element in the input variable for the REST service
(invokePackAndShipOrder_packAndShip_InputVariable)

As the shipping method is optional in Shipping, make sure to right-click on the copy rule and
choose insertMissingToData, which will create the element

The shipping element in the original order does not include the order number, which is needed
for the order confirmation email in the PackAndShipService. Map the order number in the input
variable to the order number in the shipping element.

Make sure you also choose insertMissingToData as the order number in shipping is optional.

Chapter 6: Fulfill Order

Page 295 of 392

Oracle Confidential Do not distribute to third parties

The BPEL process is one-way, so there is no need to assign the return value of the REST service.

The BPEL process now looks like this:

Chapter 6: Fulfill Order

Page 296 of 392

Oracle Confidential Do not distribute to third parties

Deploy and test/debug the FulfillOrder project by running the ProcessOrder composite. This will cause
an order in the database to be updated to ReadyForShip, which triggers the FulfillOrder project.

In EM FMWC, you will now see the FulfillOrder and the PackandShipService composites.

Chapter 6: Fulfill Order

Page 297 of 392

Oracle Confidential Do not distribute to third parties

And sensors for OrderNumber and ShippingProvider:

Add the coherence lookup for the Shipping Provider


Before you start the lab, the Coherence Adapter has to be active and targeted to the server.
If you followed the steps in chapter 5, section UMS Setup and Configuration, to target the UMS and
coherence adapter, you dont need to do anything else.
Otherwise, please follow the steps below:

When you extracted the soabeta.zip file, it created an AdapterConfig folder under e2e-1201orderprocessing/scripts. This folder includes the scripts necessary for the UMS setup.

On linux, you may have to change permissions for the script files. Please make sure you can
execute them..

Open up a command prompt and navigate to the AdapterConfig folder.

Ensure that MW_HOME is set. For example execute the following command on windows: set
MW_HOME=C:\Middleware\0610\soabeta or on linux setenv MW_HOME
/user/sgeib/0610/soabeta, using the correct path for your installation

Open up the target_adapters.py file and check the host/port, userName, password and the
server name.
The script uses the default values and should work if you havent made any changes to the
defaults. If you didnt use the default values, please change the file accordingly

host: localhost
port: 7101

Chapter 6: Fulfill Order

Page 298 of 392

Oracle Confidential Do not distribute to third parties

username/password: weblogic/welcome1
Server Name: DefaultServer

Run target_adapters.bat on windows or target_adapters.sh on linux.

You should now be able to see that the adapters are in Active state in the WLS Admin Console.

Navigate to Error! Hyperlink reference not valid. where host/port are the admin server
host and port values (default is http://localhost:7101/console).
Click on Deployments on the left hand side.

You should see the Coherence Adapter in the table on the right.

Your Composite deployment will fail if the adapter is untargeted.

Next, we will incorporate the coherence lookup. For this, we must structure the database call so that it is
invoked only if the data is not found in the cache.

The steps for this are:

Invoke Get on the coherence cache via coherence adapter (lookup by Shipping Method
ID)

Chapter 6: Fulfill Order

Page 299 of 392

Oracle Confidential Do not distribute to third parties

Check the response to see if any data was returned

If data was returned, populate the Shipping Provider within the Shipping variable from
the coherence lookup response.

If no data was returned


o

Execute the database adapter interaction to retrieve the Shipping provider details.

Invoke Put on the coherence cache via coherence adapter. The key would be the
ShippingMethodID and the value would be the XML returned by the coherence
adapter.

Populate the Shipping Provider within the Shipping variable from the database
lookup response.

Step 1: Model the Coherence Get interaction

Drag and drop the coherence adapter (under Technology Adapters) into the External
References swimlane of the composite.

Name it queryCoherence.

Chapter 6: Fulfill Order

Page 300 of 392

Oracle Confidential Do not distribute to third parties

Click Next

Change the JNDI Name to eis/Coherence/Local.

Click Next

For Operation, select Get.

Click Next

We will use the prebuilt internal coherence cache for this demo. Set Cache Name to adapterlocal

Chapter 6: Fulfill Order

Page 301 of 392

Oracle Confidential Do not distribute to third parties

You will populate the Key using a jca.coherence.Key property later. Leave it empty, click Next
and ignore the warning.

Pick up the database lookup response Schema definition as the XML Schema. The response from
the database lookup will be directly stored in the coherence cache.

Chapter 6: Fulfill Order

Page 302 of 392

Oracle Confidential Do not distribute to third parties

Click OK

Click Next.

Click Finish.

You do not need to specify any input data into this invocation except for the jca.coherence.Key
property on the invocation.

For this, wire the adapter to the fulfillOrder BPEL process.

Chapter 6: Fulfill Order

Page 303 of 392

Oracle Confidential Do not distribute to third parties

Double-click the BPEL process to open the BPEL editor.

Drag and drop an invoke activity before the assignShippingMethodForDBAdapter assign activity
to wire to the QueryCoherence partnerlink.

Chapter 6: Fulfill Order

Page 304 of 392

Oracle Confidential Do not distribute to third parties

Name it queryCoherence

Browse to the queryCoherence partnerlink and click OK

Chapter 6: Fulfill Order

Page 305 of 392

Oracle Confidential Do not distribute to third parties

Automatically create the Input and Output variable as you did previously

Select the Properties tab and click the green + sign to add a new property

In the dropdown list, choose jca.coherence.Key

Chapter 6: Fulfill Order

Page 306 of 392

Oracle Confidential Do not distribute to third parties

Browse to the variable that is used as key value in the coherence cache

Select the shippingMethodID variable and click OK

This will populate the shippingMethodID variable contents into the property and pass it on the
invocation to the adapter.

Click OK

Chapter 6: Fulfill Order

Page 307 of 392

Oracle Confidential Do not distribute to third parties

Note that you dont need to create an assign statement and assign an input value to the coherence
query interaction. The only input value required to query is the Key which, as shown above, is
passed in as a property to the invocation.

Step 2: Branch the flow based on the Query Response.

Drag and drop an If activity into the BPEL code after the invoke activity.

Double click on the If to specify the condition as shown below. Use the XPath Expression
Builder to create the expression.

Expand the output variable of the coherence call (queryCoherence_Get_OutputVariable) and


select the name element that keeps the shipping provider name

Chapter 6: Fulfill Order

Page 308 of 392

Oracle Confidential Do not distribute to third parties

Click OK

Rename the If to DataInCache

Click OK

Rename the If label to DataInCache and the else label to DataNotInCache

Chapter 6: Fulfill Order

Page 309 of 392

Oracle Confidential Do not distribute to third parties

Drag and drop an assign activity into the If branch.

Name it assignShippingProvider

Use the Assign Editor to assign the shipping provider name from the coherence query output
variable to the shipping provider name in the process input variable (in the shipping element).
This will later be used as input for the pack and ship service.

Ensure that you specify insertMissingToData on this statement by right-clicking the highlighted
expression in the bottom part of the Edit Assign window so that the Name is inserted into the target
document if it does not already exist.

Chapter 6: Fulfill Order

Page 310 of 392

Oracle Confidential Do not distribute to third parties

Close the Assign Editor by clicking OK

Next, move the database adapter invocation (getShippingProvider), including its two assign
activities (assignShippingMethodForDBAdapter and assignShippingProvider) into the Else
block.

Chapter 6: Fulfill Order

Page 311 of 392

Oracle Confidential Do not distribute to third parties

Step 3: Model the Put Interaction for the Coherence Adapter


Next we will copy the database adapter response into the coherence cache, so that the shipping
provider is available in the cache next time it is looked up.

Open the composite editor

Drag and drop another coherence adapter into the right swimlane and name if
putIntoCoherence

Chapter 6: Fulfill Order

Page 312 of 392

Oracle Confidential Do not distribute to third parties

Click Next

Change the JNDI name to eis/Coherence/Local.

Click Next

Select Operation Put

Click Next

In the next page, specify adapter-local for the Cache Name.

Uncheck Auto-generate key

Chapter 6: Fulfill Order

Page 313 of 392

Oracle Confidential Do not distribute to third parties

Enter the Key value as shippingMethodKey. We will override this value in the BPEL Process.

Click Next

In the next screen, specify the database lookup response (E2E1201_ShippingMethodsCollection


in getShippingProvider_table.xsd) as the message definition and finish the wizard.

Chapter 6: Fulfill Order

Page 314 of 392

Oracle Confidential Do not distribute to third parties

Click Next

Click Finish

Next, wire the adapter to the fulfillOrder BPEL process

Double click the fulfillOrder BPEL process to open the BPEL editor

Drag and drop an invoke activity into the else branch below the assign activity

Chapter 6: Fulfill Order

Page 315 of 392

Oracle Confidential Do not distribute to third parties

Name it putIntoCoherence

Browse to the putIntoCoherence partnerlink

Automatically create the Input and Output variables.

Add the property the same way as you did before

Select the Properties tab and click the green + sign to add a new property

Chapter 6: Fulfill Order

Page 316 of 392

Oracle Confidential Do not distribute to third parties

In the dropdown list, choose jca.coherence.Key

Browse to the variable that is used as key value in the coherence cache

Select the shippingMethodID variable and click OK

Chapter 6: Fulfill Order

Page 317 of 392

Oracle Confidential Do not distribute to third parties

This will populate the shippingMethodID variable contents into the property and pass it on the
invocation to the adapter

Click OK

Following this, drag and drop an assign activity before the invoke to populate the input variable
of the coherence adapter with the output variable of the database call.

Name it assignCoherenceInput

The flow should look something like this now:

Chapter 6: Fulfill Order

Page 318 of 392

Oracle Confidential Do not distribute to third parties

Deploy, debug and test the composite

You will see that initially both coherence adapters are executed. QueryCoherence returns and empty
variable as nothing has been put into the coherence cache yet. PutCoherence then puts the content into
the coherence cache:

Chapter 6: Fulfill Order

Page 319 of 392

Oracle Confidential Do not distribute to third parties

Once the message has been put into the coherence cache, you will see that the audit trail has changed:

QueryCoherence returns the shipping method variable and the database doesnt need to be queried
anymore:

Chapter 6: Fulfill Order

Page 320 of 392

Oracle Confidential Do not distribute to third parties

Chapter 6: Fulfill Order

Page 321 of 392

Oracle Confidential Do not distribute to third parties

Appendix: Deploy, Test and Monitor Tutorial projects

Introduction
This document outlines how to deploy a project for SOA composites and Service Bus, how to debug and
different ways to test within JDeveloper and Enterprise Manager Fusion Middleware Control.
It also describes how to open JDeveloper and how to start and stop the Integrated WebLogic Server.

Page 322 of 392

Appendix

Oracle Confidential Do not distribute to third parties

Start the Integrated WebLogic Server in JDeveloper


To start the server, choose Run Start Server Instance (IntegratedWebLogicServer) in the main menu

You will see a new tab at the bottom Running: IntegratedWebLogicServer Log, which shows
the server log file

The server is up and running when you see the following message:
[IntegratedWebLogicServer started.]

Appendix

Page 323 of 392

Oracle Confidential Do not distribute to third parties

Stop the Integrated WebLogic Server in JDeveloper

Click on the red Terminate icon on top of your JDeveloper window and choose
IntegratedWebLogicServer

The server is stopped when you see [IntegratedWebLogicServer terminated]

If you dont see that message, terminate again.

Appendix

Page 324 of 392

Oracle Confidential Do not distribute to third parties

Check the audit level on the SOA Server

Audit tracking enables you to select the level of information to be collected by the message tracking
infrastructure.

The following audit levels are available:

Off: No logging is performed. Composite instance tracking information and payload tracking
information are not collected.
Production: Minimal information for SOA composite application instances is collected. For
example, the BPEL process and Oracle Mediator service engines do not capture the payload.
Therefore, the payload details are not available in the flow audit trails. The BPEL process service
engine collects payload details for all activities except assign activities. This level is optimal for
most standard operations and testing.
Development: Complete information for SOA composite application instances is collected. This
option allows both composite instance tracking and payload tracking. This setting may have an
impact on performance because the payload is stored at each step in the message flow. This
setting is useful for debugging purposes.

For our labs, we need to make sure that the audit level is set to Development.

Right-click on soa-infra (Default Server) and choose SOA Administration > Common Properties.

If the Audit Level is set to Development, youre okay.

Appendix

Page 325 of 392

Oracle Confidential Do not distribute to third parties

If the Audit Level is set to Production, please set it to Development

Choose Development in the drop-down list

Click Apply

When asked for confirmation, click Yes.

You will see a confirmation that the change has been made:

Appendix

Page 326 of 392

Oracle Confidential Do not distribute to third parties

Appendix

Page 327 of 392

Oracle Confidential Do not distribute to third parties

Deploy Chapter Solutions


To deploy solutions:
-

Locate the solutions folder underneath ~/e2e-1201-orderprocessing. For example, e2e-1201orderprocessing/solutions/ch2-validatePayment

Unzip e2e-1201-composites_ch2.zip to a location of your choice

Open JDeveloper

Open the previously unzipped application by selecting Application Open from the main JDeveloper
menu

Select e2e-1201-composites.jws in e2e-1201-composites

If a window pops up asking you to migrate the application, choose Yes.

Alternatively, if you already have an application e2e-1201-composites and only need to import a chapter
project:
Locate the following project in /solutions/ch3-processOrder/SOAProjects:
-

ProcessOrder_ch3.zip

Extract the project into the existing e2e-1201-composites folder


In JDeveloper, choose Open Project and choose the .jpr file in your project (see screenshots below):

Appendix

Page 328 of 392

Oracle Confidential Do not distribute to third parties

To deploy service bus solution:


-

Locate /solutions/ch2-validatePayment

Unzip e2e-1201-servicebus-ch2.zip to a location of your choice

Open JDeveloper

Open the previously unzipped application by selecting Application Open from the main JDeveloper
menu

Select e2e-1201-servicebus.jws in e2e-1201-composites

Deploy SOA Projects to the Application Server


After you have created your composite, you can deploy it to the server. Please see the next section to
deploy a Human Task form project, which has a different procedure.
The Deploy command rebuilds the project and writes the binaries to disk. It also brings up the
deployment plan dialog before deploying. When the server is stopped and restarted, the applications
will remain deployed.
The following screenshots assume deployment to the Integrated Server. When deploying to a different
server, choose the server connection accordingly.
Important: The server has to be RUNNING for this deployment to be successful. If your server is down,
please bring it back up before attempting deployment.

Appendix

Page 329 of 392

Oracle Confidential Do not distribute to third parties

Right-click on the project name in the project menu - select Deploy and your project name. Make
sure you have the project menu and not the application menu in order to see this option.

Select the first option Deploy to Application Server.

Click Next.

The SOA Deployment Configuration dialog opens. When deploying a project, you have to choose
the Revision ID. If you previously deployed the same project with the same Revision ID, the
deployment will fail, unless you choose to overwrite an existing project with the same ID.

If you deploy with a new Revision ID, this will become the default.

For our labs, we will deploy with Revision ID 1.0 and check the box to Overwrite any existing
composites with the same revision ID.

This will now be your default deployment profile, until you change it.

Appendix

Page 330 of 392

Oracle Confidential Do not distribute to third parties

Click Next.

If you previously configured additional application servers, you will see all of them in this list.

Choose IntegratedWebLogicServer and click Next.

The SOA Server is looked up to make sure that the server you chose is indeed a SOA server and that
the server is running. If that is not the case, you will get an error.

Make sure the server is running.

Appendix

Page 331 of 392

Oracle Confidential Do not distribute to third parties

Click Next.

Check the Deployment Summary and click Finish.

Next the application is built and deployed. If there are no compilation errors, you will see on the
SOA log, at the bottom of JDeveloper, BUILD SUCCESSFUL and then the deployment starts.

Appendix

Page 332 of 392

Oracle Confidential Do not distribute to third parties

In the Deployment log, view the details of the deployment.

Wait for your application to be deployed and then you can run and test it.

Appendix

Page 333 of 392

Oracle Confidential Do not distribute to third parties

Test the SOA project with EM Fusion Middleware Control


The Oracle Enterprise Manager Fusion Middleware Control allows you to test your services. We will use
the ValidatePayment composite as an example.

If Enterprise Manager is not open, go to http://localhost:7101/em (adapt your host and port if
necessary).

Navigate to the composite home page or soa-infra node through following best practices

Select the ValidatePayment composite (or the composite you want to test).

On this page, you can see the Recent Instances, Fault Instances, Component Metrics, and the
Services and References Metrics.

Click the Test button at the top of the screen.

Appendix

Page 334 of 392

Oracle Confidential Do not distribute to third parties

The Test page opens.

Appendix

Page 335 of 392

Oracle Confidential Do not distribute to third parties

You can see the WSDL location, Operations list, and two tabs, Request and Response for the test
message.
Scroll down to the Input Arguments section
Specify your values for the payload. You can use the HTML form on the Tree View, which is default, or
the XML source on the XML View. For smaller amounts of the data, using the HTML form view is
probably easier. But for large payloads, it's easier to copy-and-paste your data into the XML View.

Appendix

Page 336 of 392

Oracle Confidential Do not distribute to third parties

Enter the data or switch to XML view and use the PaymentInfoSample_Authorized_soap.xml
sample message. This message already includes the SOAP envelope needed for the web service
test.

Click Test Web Service.

When the composite completes, the screen switches to the Response tab and the returned
value is shown.

Appendix

Page 337 of 392

Oracle Confidential Do not distribute to third parties

From here, you launch the Flow Trace of this instance.

Click Launch Flow Trace. The Flow Trace screen opens and you can see the flow of your
composite and the status of each service, component and reference.

Click on the BPEL process to drill down into the instance details of the component

Appendix

Page 338 of 392

Oracle Confidential Do not distribute to third parties

Continue with the next section.

Appendix

Page 339 of 392

Oracle Confidential Do not distribute to third parties

Flow instances in EM Fusion Middleware Control

With the ValidatePayment composite open, choose the tab Flow Instances

For better performance, we dont show any flow instances when the view is opened. We leave it to
the user to decide how many instances he wants to see.

Appendix

Page 340 of 392

Oracle Confidential Do not distribute to third parties

By default, the timeframe for the list of composite is set to 24 Hours.

Click Search to see all Flow Instances that were created in the last day.

Clicking on the search icon makes the search options disappear.

Appendix

Page 341 of 392

Oracle Confidential Do not distribute to third parties

Bring the search options back and change the time to 2 days or change the state of the instances
you want to see. By default, you see all active instances.

Click on the Flow ID for one of the instances to open the Flow Trace window.

The first tab on this page shows all faults in the instance if there are any.

Appendix

Page 342 of 392

Oracle Confidential Do not distribute to third parties

Cause faults in your composite and come back here to see the list of faults. There will be a later lab
where this is explained in detail.

The second tab shows Sensor Values in your instance. Here you can see the sensor for the payment
status.

The third tab shows the composites that are part of this instance. Once you finish chapter 3, you will
see two composites here.

Appendix

Page 343 of 392

Oracle Confidential Do not distribute to third parties

You will see the name of the composite, sequence in flow (e.g. initiating or participating) and the
time when the flow entered the composite.

In this example we only have one composite, which initiates the flow.

Clicking on the composite name opens the composite view.

Well get back to this view when more than one composite are involved.

Click on the BPEL process validatePaymentProcess.

This opens the Audit Trail of the process

There you can see every activity of the process.

To see the payload in a given activity, click View Payload.

Appendix

Page 344 of 392

Oracle Confidential Do not distribute to third parties

The payload opens in a separate window:

The payload can also be downloaded.

You will notice that in the audit trail, one assign is shown per copy rule, even if all copy rules are
done in one assign activity in the BPEL process.

Click on the Flow tab to get a graphic view of the BPEL process.

Appendix

Page 345 of 392

Oracle Confidential Do not distribute to third parties

Click on any node to get the details of what happened in the activity.

Appendix

Page 346 of 392

Oracle Confidential Do not distribute to third parties

The Sensors tab shows all activity sensors in the instance. We have not defined any activity sensors
yet, only composite sensors.

Appendix

Page 347 of 392

Oracle Confidential Do not distribute to third parties

Appendix

Page 348 of 392

Oracle Confidential Do not distribute to third parties

Debug a SOA project in JDeveloper


In SOA Suite 12, we have the ability to set breakpoints in the composite editor, BPEL process and
Service Bus pipeline.
Youre able to stop at breakpoints, look at the data, step into, step out and so on. In a BPEL process,
youre also able to change the value of a variable while debugging.

Set breakpoints in the composite by right clicking on an interface and create a Request or Reply
Breakpoint or both. For one-directional interfaces, you only get one option.

The breakpoints are little red icons with an arrow pointing in the direction of the flow.

In a BPEL process, right-click on an activity and choose Toggle Breakpoint. This will set a
breakpoint is there is none and remove if there is already a breakpoint.

Appendix

Page 349 of 392

Oracle Confidential Do not distribute to third parties

These breakpoints are red dots only without arrow as the flow is always in one direction:

Set as many breakpoints as you want.

Important:
To make debugging easier for now, you should have a breakpoint at the beginning of every BPEL
process to make sure the debugger stops there.

Now start the debugger for your project:

Right-click on the project and choose Debug

Appendix

Page 350 of 392

Oracle Confidential Do not distribute to third parties

You can debug local or remote. When the debugger is started, a window pops up asking which
server you want to use for debugging. It also asks for the debug port (default is 5004 for SOA,
but can be changed) and the timeout for the debugger when inactive.

Debugger properties are stored per project. If you previously imported a solution from a
different machine, the HOST will most likely have to be changed.

These values can also be stored in the JDeveloper properties and you can skip this dialog in the
future if you always want to use the same options.

Choose your host and leave the defaults.

Click OK.

If youve made changes to your project, it needs to be redeployed. This includes setting of
breakpoints.

You will be lead through the deploy wizard step by step if that is the case.

The debugger is ready when you see this message:

Appendix

Page 351 of 392

Oracle Confidential Do not distribute to third parties

Every web service endpoint now shows a message that you can use the context menu to
initialize WS debugging:

Right-click on the WS interface and choose Initiate WS Debugging

This opens HTTP Analyzer.

Fill in all fields or choose HTTP Content at the bottom to be able to copy and paste an xml file
instead.

Appendix

Page 352 of 392

Oracle Confidential Do not distribute to third parties

Use the sample file provided: PaymentInfoSample_Authorized_soap.xml.

Be aware that this sample message already includes the SOAP envelope needed for testing.

Appendix

Page 353 of 392

Oracle Confidential Do not distribute to third parties

Hit Send Request.

If everything goes well, you should now see the debugger stop at your first breakpoint:

The active breakpoint turns blue and starts pulsing

Go to the Data tab at the bottom of JDeveloper and look at your variable values:

Appendix

Page 354 of 392

Oracle Confidential Do not distribute to third parties

Step over (F8) to start your BPEL process.

Step through the BPEL process one activity at a time, using F8, and see how the variable values
change.

If you step through an assign activity, you will see the debugger step through the copy rules that
are included in the assign

Appendix

Page 355 of 392

Oracle Confidential Do not distribute to third parties

If you set a breakpoint at the database adapter, it will jump out of BPEL and back to the
composite

Note the values that come back from the adapter.

After the calculate payment activity, the payment status has been set:

See what happens when you modify a value:

Appendix

Page 356 of 392

Oracle Confidential Do not distribute to third parties

On the left hand side, you also see the stack trace:

Finish the debugger by stepping to the end of your BPEL process.

Back in HTTP Analyzer, you can see the result:

NOTE:
Please make sure to terminate the debugger before you continue with the implementation. As long as
the debugger is running, you will not be able to edit.
To stop the debugger, click the big red icon in the Tools section and choose your project.

Appendix

Page 357 of 392

Oracle Confidential Do not distribute to third parties

Choose Terminate in the pop up window:

For more information on SOA Debugger, please see Debugging SOA Composite Applications with the
SOA Debugger in soa-dev-guide.pdf.

Appendix

Page 358 of 392

Oracle Confidential Do not distribute to third parties

Test the application in JDeveloper with HTTPAnalyzer


Another testing method is directly from JDeveloper.

Open the Application Servers window if not already open from Window Application Servers

Expand Application Servers IntegratedWebLogicServer (or a different server if youre not using
integrated server) SOA Default Server (or your server name) default ValidatePayment
[Default 1.0] validatepaymentprocess_client_ep (ws)

Right-click on the service you want to test (validatepaymentprocess_client_ep (ws)) and choose
Test Web Service

Appendix

Page 359 of 392

Oracle Confidential Do not distribute to third parties

This opens HTTP Analyzer

There you can enter the request message and test the service:

You can either enter all values in the SOAP structure


o

Use 1234123412341234 as CardNum

Use 0316 as ExpireDate for a valid credit card, any other value for an invalid credit card

Authorizationdate is optional, uncheck the Include checkbox and leave it empty

Set AuthorizationAmount to 100

Fill out the rest of the fields like in the screenshot below:

Appendix

Page 360 of 392

Oracle Confidential Do not distribute to third parties

Alternatively, choose HTTP Content at the bottom and use the


PaymentInfoSample_Authorized_soap.xml sample xml file.

Appendix

Page 361 of 392

Oracle Confidential Do not distribute to third parties

Click Send Request to start the test

If everything goes well, you will see the reply in the right window:

Appendix

Page 362 of 392

Oracle Confidential Do not distribute to third parties

Appendix

Page 363 of 392

Oracle Confidential Do not distribute to third parties

Define and run SOA Composite Test in JDeveloper


SOA Suite 11g provides an automated Test Suite Framework for creating and running repeatable tests
on a SOA composite application.
The Test Suite Framework provides the following features:

Simulates web service partner interactions

Validates process actions with test data

Creates reports of test results

The test framework supports testing at the SOA composite application level. In this type of testing,
wires, service binding components, service components (such as BPEL processes and Oracle Mediator
service components), and reference binding components are tested.
Test suites consist of a logical collection of one or more test cases. Each test case contains a set of
commands to perform as the test instance is executed. The execution of a test suite is known as a test
run. Each test corresponds to a single SOA composite application instance.
Emulations enable you to simulate the behavior of the following components with which your SOA
composite application interacts during execution.
Assertions enable you to verify variable data or process flow. You can perform the following types of
assertions.
As part of the composite tests, you can also automate the testing of an individual BPEL process service
component. These test cases enable you to simulate the interaction between a BPEL process and its web
service partners before deployment in a production environment.
You can create variable and fault assertions on BPEL process activities and fast forward on a wait
activity.
For more information, please see Automating Testing of SOA Composite Applications in soa-devguide.pdf.

In SOA Suite 12c, we add the ability to run the tests in JDeveloper (in addition to EM FMWC and
command-line). When making a change to a SOA composite or a test before running it, they are first
deployed. You can run the same test multiple times without changes.
You can also see the results after running the tests in JDeveloper, including assertions, and access the
history of the test results.
In addition we also made usability improvements to the test creation.
Gallery access and toolbar access is now provided and a test create wizard guides you to the creation of
simple tests in one shot. We also support the JDeveloper property inspector to create and edit test
metadata.
Two gallery items named 'Composite Test' and 'Composite Test Suite' have been introduced under the
category ' SOA Tier -> Tests' to create a test and a test suite respectively, as shown below:

Appendix

Page 364 of 392

Oracle Confidential Do not distribute to third parties

Creating a new Composite Test is also directly available in the shortcut menu from New and the
context menu:

Appendix

Page 365 of 392

Oracle Confidential Do not distribute to third parties

The test creation button is also exposed from the composite editor's toolbar as shown below (note the
composite test image button). You can directly create tests from within the composite editor:

Appendix

Page 366 of 392

Oracle Confidential Do not distribute to third parties

In this section, you will define and run tests for the ValidatePayment composite in JDeveloper.

Choose File > New > From Gallery from the menu.

From the Categories tree, click on SOA Tier > Tests.

Select Composite Test from the Items field.

Click OK.

In the subsequent Create Composite Test dialog, set the Test Name field to ValidatePaymentTest.

Click the Create Test Suite icon on the right of the Test Suite field. From here, you can create a new
test suite or select an existing test suite.

Appendix

Page 367 of 392

Oracle Confidential Do not distribute to third parties

Set the test suite name to ValidatePayment_TestSuite1.

Click OK.

Click Next.

Accept the default values and click Next.

To specify the input message, choose Load From File

Browse to PaymentInfoSample_Authorized.xml (dont pick the file with the soap envelope).

Appendix

Page 368 of 392

Oracle Confidential Do not distribute to third parties

Click Next.

To specify the output message, choose Load From File.

Browse to PaymentInfoOutput.xml.

Appendix

Page 369 of 392

Oracle Confidential Do not distribute to third parties

Click Finish.

Once the Finish button is clicked, the test creation wizard closes and the test is created.

The composite test editor opens to show the test.

Additional test metadata like emulations can be added if necessary. If the current test is done, you
can continue to create another test by clicking the test image button from the editor's toolbar.

As mentioned before, we now support running tests in JDeveloper without switching to EM


FMWC. After the tests are created, you can select multiple tests to run or a single test.

There are different ways to issue the run command. You can right-click the test suites or tests from
the JDeveloper navigator and select the corresponding run menu items.

If the test is already open in its test editor, you can also press the green arrow button from the test
editor's toolbar to run the open test.

Once the test run command is issued, it will first ask what test server to use to run the test if the test
server is not configured in JDev Tools -> Preferences -> SOA or is configured but has been set to ask
every time.

You enter the test server host name and can optionally check the 'Do not ask again' checkbox to
save the test server host name in JDev Tools -> Preferences -> SOA.

If the checkbox is checked, then this dialog will not pop up again next time you run tests until you go
to JDev Tools -> Preferences -> SOA to change the configuration.

Enter the name of your server and click OK.

The Test Run dialog pops up. In the test run dialog, you specify the test run name and can select or
deselect tests to run. The Test Run dialog also allows you to specify the timeout for running the tests
on the test server.

Confirm the ValidatePaymentTest test selected.

Appendix

Page 370 of 392

Oracle Confidential Do not distribute to third parties

Click OK.

Once the 'OK' button is clicked, we will check if the composite (which includes the tests) has been
deployed on the test server. If the composite has been never deployed on the test server or youve
made changes to the composite or the test since it was deployed last, the composite needs to be
deployed to the test server first before we the tests can be run on the test server.

The following deployment confirmation dialog pops up to confirm the deployment.

Click OK to deploy the composite, including the tests.

The deployment wizard is the same one as when you just deploy the composite without tests
involved.

The composite test starts automatically when the deployment has finished.

If the tests ran successfully, the test result overview editor will open to show the test results.

Appendix

Page 371 of 392

Oracle Confidential Do not distribute to third parties

The test result overview editor is per test server and composite DN (unique identifier). We show the
test server URL (the SOA server hostname and the port number) and composite DN on the top right
corner of the editor to indicate the context. Due to space limitation, we do not this info on the
editor tab name. The editor tab name is in form of 'Test Results: <Composite-Name>'.

The test result overview editor also provides a toolbar button to go to the composite editor.

The test results are shown in three collapsible tables from master to details. The three tables are the
Test Run Table, the Test Case Table and the Assert Result Table.

The Test Run Table shows the current test run and its status summary if you just submitted a test
run from the test UI. If you just queried the test server for test runs, then the table shows all test
runs matching your query criteria.

The Test Case Table shows all test cases and their statuses of the selected test run from the Test
Run Table.

The Assert Result Table shows all assert results of the selected test case from the Test Case Table.

Click XML link in the Assert Result table to check the result. This will be more meaningful when you
cause a fault and compare the expected XML with the Actual XML.

Appendix

Page 372 of 392

Oracle Confidential Do not distribute to third parties

Run the test several times.

Make changes that will make the test fail or create new tests and check out the test result overview
editor.

To change the input message, right-click on the SOAP interface and choose Edit Initiate Messages

Appendix

Page 373 of 392

Oracle Confidential Do not distribute to third parties

The expected output message counts as an assert. To change it, right-click on Asserts and Emulates
and choose Edit Asserts and Emulates

Appendix

Page 374 of 392

Oracle Confidential Do not distribute to third parties

Take a tour of Enterprise Manager Fusion Middleware Control

Open Enterprise Manager: http://localhost:7101/em (adapt your host and port if necessary) if not
already open.

The first time these screens are run after starting the server they will be slow as they are unpacked,
compiled, and loaded into memory.

Enter your login details, for example weblogic/welcome1.

The SOA composites are listed under the SOA folder in the Target Navigator.

Navigate to the composite home page or soa-infra node through following best practices

Select your composite from the list of composites. The composite page opens.

Appendix

Page 375 of 392

Oracle Confidential Do not distribute to third parties

The view opens with the composite Dashboard where you can see all Services and References

Click on Composite Definition to get a view of your complete composite

You can switch between Design and Source view and zoom in and out

Appendix

Page 376 of 392

Oracle Confidential Do not distribute to third parties

Run SOA test in EM FMWC


The tests that have been created in JDeveloper can also be run in EM:

Open EM at http://localhost :7001/em (substitute your own host and port if necessary) and go
to your composite.

Navigate to the composite home page or soa-infra node through following best practices

Go to the ValidatePayment composite

Check the composite definition tab.

Go to the Unit Tests tab.

Appendix

Page 377 of 392

Oracle Confidential Do not distribute to third parties

Check the box behind the test you previously created: ValidatePaymentTest.xml and click on
Execute

Enter a Test Run name and Click OK

Click Refresh Test Status

Test results are displayed.

You will see that the test passed successfully

Appendix

Page 378 of 392

Oracle Confidential Do not distribute to third parties

Clicking on XML link of Expected\Actual value column shows that Actual value matched with
Expected value.

Appendix

Page 379 of 392

Oracle Confidential Do not distribute to third parties

Launch the flowtrace and see its execution and the sensor values

In the flow-instance tab of soa-infra\composite, the instances executed as part of unit tests are
marked with a yellow dot as shown below

Appendix

Page 380 of 392

Oracle Confidential Do not distribute to third parties

Create a new test that will fail, and run again.

Appendix

Page 381 of 392

Oracle Confidential Do not distribute to third parties

Getting the service description (WSDL) of your project


You can get the service description, or WSDL, of your composite from the Composite page. This is useful
because you may need it for applications to access your service, or to expose your service to others.
Open the Composite page for the composite you are interested in.

Click Show WSDL and endpoint URI icon on the top.

You can see the Endpoint URI and the WSDL.

Appendix

Page 382 of 392

Oracle Confidential Do not distribute to third parties

Getting the service WADL of your REST project


For projects exposing a REST interface, you may need the service WADL.
This is done the same way as getting the WSDL for a project.
Open the Composite page for the composite you are interested in.

Click Show WADL and Text description URL icon on the top.

You can see the Text description URL and the Service WADL.

Appendix

Page 383 of 392

Oracle Confidential Do not distribute to third parties

Access the Database from JDeveloper


The integrated server uses Java DB, also known as Derby DB, for the SOA tables and the tables used for
our lab scenario.

You can access those tables directly from JDeveloper by following the steps below.

Please make sure the Server is up and running

Open Application Resources->Connections->Database on the left hand side, under the


application navigator.

Right click on the connection SOA, which has been created in chapter 2, lab 1, and click Open in
Databases Window.

You will see the order tables under SOAINFRA - Tables

Appendix

Page 384 of 392

Oracle Confidential Do not distribute to third parties

In the database window, right click on the connection and choose Open SQL Worksheet

Appendix

Page 385 of 392

Oracle Confidential Do not distribute to third parties

You can check on the order tables by entering something like select * from E2E_1201_ORDERS;
and click on the Run Statement button

You will see the result of the query under Query Results

Appendix

Page 386 of 392

Oracle Confidential Do not distribute to third parties

Appendix

Page 387 of 392

Oracle Confidential Do not distribute to third parties

Create a Connection to Oracle WebLogic Server to deploy to a nonIntegrated WebLogic Server


When deploying a project from JDeveloper, an Oracle WebLogic Server connection is used.
This connection is created automatically in JDeveloper, when the Integrated Server is being used. Please
skip this section when deploying to the Integrated Server.

In order to deploy to other servers, local or remote, the following steps are necessary.

From the Application Menu, select New > From Gallery

In the New Gallery, in the Categories tree, select General, and then Connections.

Select Application Server Connection

Appendix

Page 388 of 392

Oracle Confidential Do not distribute to third parties

Click OK. The Create Application Server Connection page is displayed.

Enter MyAppServerConnection in the Connection Name field and select WebLogic 10.3 from
the Connection Type list.

Click Next. The Connection Authentication page is displayed.

Appendix

Page 389 of 392

Oracle Confidential Do not distribute to third parties

Enter weblogic for the User Name and the password (welcome1) for that administrator in the
Password field.

Click Next. The Configuration page displays.

Enter the following values:

Weblogic Hostname (Administration Server): localhost


Port: <your port>, e.g. 7001
WLS Domain: <your domain name>, e.g. soa_osb_domain

Appendix

Page 390 of 392

Oracle Confidential Do not distribute to third parties

Click Next. The Test page displays.

Click Test Connection. The following status should appear:

If the test is unsuccessful, ensure that Oracle WebLogic Server status is RUNNING, and retry the test.

Click Next, and in the Finish page, click Finish.

Appendix

Page 391 of 392

Oracle Confidential Do not distribute to third parties

Appendix

Page 392 of 392

Das könnte Ihnen auch gefallen