Contents
This is part of the Oracle SOA11g hands on tutorials.
Create a New SOA Application
* File -> New -> General -> Applications -> SOA Application
* On Create SOA Application wizard Step 1, enter
Application Name: CreditCardValidation
Directory: C:\po\CreditCardValidation
Applicatoin Package Prefix: blank
* On Step 2, enter
Project Name: validationForCC
Directory: C:\po\CreditCardValidation\validationForCC
* On Step 3, select
Empty Composite
* Click Finish
Add DBAdapter
* Drag and drop Database Adapter from Component Palette to External References lane
* On Adapter Configuration Wizard, Step 2 of 4, enter:
Service Name: getCreditValidation
* On Step 3,
– Click green plus icon, enter
Connection Name: soademoDatabase
Connection Type: Oracle(JDBC)
Username: soademo
Password: soademo
Save Password: checked
Driver: thin
Host Name: localhost
Service Name: orcl.world
JDBC Port: 1521
– Click Test Connection, should see success! under the button
– Click OK
* Still on Step 3, verify
JNDI Name: eis/DB/soademoDatabase
and click Next
* On Step 4, select
Perform an Operation on a Table -> Select
* On Step 5, click Import Tables… and then
– Click Query
– Move CREDITCARDINFO from left to right
– Click OK
* On Step 6, select CCNUMBER as primary key
* On Step 7, click Next
* On Step 8,
un-check all columns except status
* On Step 9,
– click Add button and enter a new parameter named ccnb, click OK
– click Edit button, click Add… button, and select
First Argument/Query Key: ccnumber
Operator: EQUAL
Second Argument: Parameter -> ccnb
– click OK
* Click Finish
Add Mediator Component
* Drag and drop a Mediator from Palette to Components lane, enter
Name: RouteRequest
Template: Define Interface Later
* Click OK
Add Outbound Web Service
* Drag and drop Web Service from Component Palette to Exposed Services lane
* On Create Web Service screen, enter
Name: getStatusByCC
Type: Service
* Click Create WSDL from schema icon (second one to the right of WSDL URL field)
Create WSDL
* On Create WSDL screen, accept
File Name: getStatusByCC.wsdl
Directory: C:\po\CreditCardValidation\validationForCC
Namespace: http://oracle.com/sca/soapservice/CreditCardValidation/validationForCC/getStatusByCC
Port Type: execute_ptt
Operation: execute
Interface Type: Synchronous Interface
Define Input
* click the green plus icon above the Input panel
* On Add Message Part screen, click the browse for schema icon (magnifying glass)
* On Type Choose screen, click the Import Schema File icon (first icon on upper right)
* On Import Schema File screen, enter
Check: Copy to Project
URL: file:/C:/po/schemas/creditcheck.xsd (or click the magnifying glass and browse to creditcheck.xsd file)
– click OK
* On Localize Files screen,
– uncheck maintain original directory structure…
– click OK
* Back on Type Choose screen,
– select creditcardStatusRequest
– click OK
* Back on Add Message Part screen, enter
Part Name: creditcardStatusRequestPart
URL: xsd/creditcheck.xsd
Schema Element: creditcardStatusRequest
– click OK
Define Output
* click the green plus icon above the Output panel
* On Add Message Part screen, click the browse for schema icon (magnifying glass)
* On Type Choose screen,
– expand creditcheck.xsd
– select creditcardStatus
– click OK
* Back on Add Message Part screen, enter
Part Name: creditcardStatusPart
URL: xsd/creditcheck.xsd
Schema Element: creditcardStatus
– click OK
Define Fault
* click the green plus icon above the Fault panel
* On Add Message Part screen, click the browse for schema icon (magnifying glass)
* On Type Choose screen,
– expand creditcheck.xsd
– select error
– click OK
* Back on Add Message Part screen, enter
Part Name: errorPart
URL: xsd/creditcheck.xsd
Schema Element: error
– click OK
Finish Create WSDL
* Click OK on Create WSDL screen
* On Create Web Service screen, verify
– copy wsdl and its dependent artifacts into the project: unchecked
– Transaction Participation: NEVER
* Click OK
Wire Web Service, Mediator and DBAdapter
* Drag right arrow on upper right of getStatusByCC web service and drop on lower left of RouteRequest.
* Drag right arrow on lower right of RouteRequest and drop on right arrow on upper left of getCreditValidation.
Add Transformation Steps
* Double click RouteRequest
Input Mapper
* Click on the first transformation icon (to the right of the first “Transform Using” field)
* Select Create New Mapper File and click OK
* On the new mapper file,
– drag from left side inp1:CCNumber to right side top:ccnb
* Save and close mapper file
Reply Mapper
* Click on the transformation icon to the right of the second Transform Using field
* Select Create New Mapper File and click OK
* On the new mapper file,
– drag from left side top:status to right side inp1:creditcardStatus
* Save and close mapper file
* Save and close RouteRequest.mplan file
Create a Server Connection
* Click File -> New… -> General -> Connections -> Application Server Connection
* Click OK on New Gallery screen
* On Create Application Server Connection Step 1 screen, enter
Connection Name: MyAppServerConnection
Connection Type: WebLogic 10.3
* Step 2, enter
Username: weblogic
Password: welcome1
* Step 3, enter
Weblogic Hostname: localhost
Port: 7001
Weblogic Domain: soa_domain
* Step 4, click Test Connection
Testing JSR-160 Runtime ... success. Testing JSR-160 DomainRuntime ... success. Testing JSR-88 ... success. Testing JSR-88-LOCAL ... success. Testing JNDI ... success. Testing JSR-160 Edit ... success. Testing HTTP ... success. Testing Server MBeans Model ... success. Testing HTTP Authentication ... success. 9 of 9 tests successful.
* Step 5, click Finish
Deploy
* Right click validationForCC project
* Select Deploy -> validationForCC
* On Deploy validationForCC screen,
– select Deploy to Application Server
* On Deploy Configuration screen,
– check Overwrite any existing composites with the same revision ID if reploying
– click Next
* One Select Server screen,
– select MyAppServerConnection
– click Next
* Click Finish on Summary screen
Testing
* Login Enterprise Console http://localhost:7001/em
* Click Farm_soa_domain -> SOA -> soa-infra (soa_server1) -> default -> validationForCC
* Click Test tab
* Under Input Arguments, enter
CCNumber: 1234-1234-1234-1234
* Click Test Web Service button
* Should return VALID
* Enter
CCNumber: 4321-4321-4321-4321
should return INVALID