Sei sulla pagina 1di 7

3/11/2014

SOA 11g Tutorial: Credit Verification App

Jianming Li SOA 11g Tutorial: Credit Verification App (http://jianmingli.com/wp/?p=2062)


Contents

Create a New SOA Application (#Create_a_New_SOA_Application) Add DBAdapter (#Add_DBAdapter) Add Mediator Component (#Add_Mediator_Component) Add Outbound Web Service (#Add_Outbound_Web_Service) Create WSDL (#Create_WSDL) Wire Web Service, Mediator and DBAdapter (#Wire_Web_Service_Mediator_and_DBAdapter) Add Transformation Steps (#Add_Transformation_Steps) Input Mapper (#Input_Mapper) Reply Mapper (#Reply_Mapper) Create a Server Connection (#Create_a_Server_Connection) Deploy (#Deploy) Testing (#Testing)

This is part of the Oracle SOA11g hands on tutorials (?p=1924).

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
http://jianmingli.com/wp/?p=2062 1/7

3/11/2014

SOA 11g Tutorial: Credit Verification App

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)
http://jianmingli.com/wp/?p=2062 2/7

3/11/2014

SOA 11g Tutorial: Credit Verification App

* 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.
http://jianmingli.com/wp/?p=2062 3/7

3/11/2014

SOA 11g Tutorial: Credit Verification App

* 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 1 . 2 . 3 . 4 . 5 . 6 . 7 . 8 . 9 . 1 0 .

T e s t i n gJ S R 1 6 0R u n t i m e. . .s u c c e s s . T e s t i n gJ S R 1 6 0D o m a i n R u n t i m e. . .s u c c e s s . T e s t i n gJ S R 8 8. . .s u c c e s s . T e s t i n gJ S R 8 8 L O C A L. . .s u c c e s s . T e s t i n gJ N D I. . .s u c c e s s . T e s t i n gJ S R 1 6 0E d i t. . .s u c c e s s . T e s t i n gH T T P. . .s u c c e s s . T e s t i n gS e r v e rM B e a n sM o d e l. . .s u c c e s s . T e s t i n gH T T PA u t h e n t i c a t i o n. . .s u c c e s s .
4/7

http://jianmingli.com/wp/?p=2062

3/11/2014

SOA 11g Tutorial: Credit Verification App

1 1 . 1 2 . 9o f9t e s t ss u c c e s s f u l . 1 3 . * 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 At jianmingli.com (http://jianmingli.com/wp), the privacy of our visitors is of extreme importance to us (See this article (http://www.wp-insert.smartlogix.co.in/what-is-a-privacy-policy/) to learn more about Privacy Policies.). This privacy policy document outlines the types of personal information is received and collected by jianmingli.com (http://jianmingli.com/wp) and how it is used. Log Files Like many other Web sites, jianmingli.com (http://jianmingli.com/wp) makes use of log files. The information inside the log files includes internet protocol ( IP ) addresses, type of browser, Internet Service Provider ( ISP ), date/time stamp, referring/exit pages, and number of clicks to analyze trends, administer the site, track users movement around the site, and gather demographic information. IP addresses, and other such information are not linked to any information that is personally identifiable. Cookies and Web Beacons jianmingli.com (http://jianmingli.com/wp) does use cookies to store information about visitors preferences, record user-specific information on which pages the user access or visit, customize Web page content based on visitors browser type or other information that the visitor sends via their browser. DoubleClick DART Cookie

http://jianmingli.com/wp/?p=2062

5/7

3/11/2014

SOA 11g Tutorial: Credit Verification App

Google, as a third party vendor, uses cookies to serve ads on jianmingli.com (http://jianmingli.com/wp). Google's use of the DART cookie enables it to serve ads to users based on their visit to jianmingli.com (http://jianmingli.com/wp) and other sites on the Internet. Users may opt out of the use of the DART cookie by visiting the Google ad and content network privacy policy at the following URL - http://www.google.com/privacy_ads.html (http://www.google.com/privacy_ads.html). These third-party ad servers or ad networks use technology to the advertisements and links that appear on jianmingli.com (http://jianmingli.com/wp) send directly to your browsers. They automatically receive your IP address when this occurs. Other technologies ( such as cookies, JavaScript, or Web Beacons ) may also be used by the third-party ad networks to measure the effectiveness of their advertisements and / or to personalize the advertising content that you see. jianmingli.com (http://jianmingli.com/wp) has no access to or control over these cookies that are used by third-party advertisers. You should consult the respective privacy policies of these third-party ad servers for more detailed information on their practices as well as for instructions about how to opt-out of certain practices. jianmingli.com's (http://jianmingli.com/wp) privacy policy does not apply to, and we cannot control the activities of, such other advertisers or web sites. If you wish to disable cookies, you may do so through your individual browser options. More detailed information about cookie management with specific web browsers can be found at the browsers' respective websites. Let us talk about Name and Mail are required Name Mail(will not be published) Website

Join the discuss

... on Topic

(#)
http://jianmingli.com/wp/?p=2062 6/7

3/11/2014

SOA 11g Tutorial: Credit Verification App

CAPTCHA Code *
Submit

SOA 11g Tutorial: PO Routing App (http://jianmingli.com/wp/?p=2063) || SOA 11g Tutorial: Prepare and Setup (http://jianmingli.com/wp/?p=2079) Top 2014,Jianming Li,WP Theme "mts journey" by mts from WebDesign.

http://jianmingli.com/wp/?p=2062

7/7

Potrebbero piacerti anche