{"id":1564,"date":"2010-04-22T12:15:23","date_gmt":"2010-04-22T17:15:23","guid":{"rendered":"http:\/\/jianmingli.com\/wp\/?p=1564"},"modified":"2010-04-22T12:15:23","modified_gmt":"2010-04-22T17:15:23","slug":"oracle-esb-customerdata-tutorial","status":"publish","type":"post","link":"https:\/\/jianmingli.com\/wp\/?p=1564","title":{"rendered":"Oracle ESB: CustomerData Tutorial"},"content":{"rendered":"<span id=\"Setup_JDev\"><h2>Setup JDev<\/h2><\/span>\n<p>* Install JDev 10.1.3.3<\/p>\n<span id=\"Create_a_new_Application_Server_connection\"><h3>Create a new Application Server connection<\/h3><\/span>\n<p>* Click &#8220;Connections&#8221; tab,<br \/>\n* Right click &#8220;Application Server&#8221;,<br \/>\n* Select &#8220;New Application Server Connection&#8230;&#8221;<\/p>\n<pre lang=\"txt\">Name: LocalApplicationServer\r\nConnection Type: Oracle Application Server 10g 10.1.3\r\nUser name: oc4jadmin\r\nPass: welcome1\r\nConnect to: Single Instance\r\nHost name:  localhost   \r\nOPMN Port: 6003\r\nOC4J instance name: home<\/pre>\n<span id=\"Create_a_new_Integration_Server_connection\"><h3>Create a new Integration Server connection<\/h3><\/span>\n<p>* Click &#8220;Connections&#8221; tab,<br \/>\n* Right click &#8220;Integration Server&#8221;,<br \/>\n* Select &#8220;New Integration Server Connection&#8230;&#8221;<\/p>\n<pre lang=\"txt\">Name: LocalIntegrationServer\r\nApplication server: LocalApplicationServer\r\nHost name: localhost\r\nPort number: 8888<\/pre>\n<span id=\"Unzip_CustomerSample.zip\"><h2>Unzip CustomerSample.zip<\/h2><\/span>\n<p>* CustomerSample.zip is in &#8216;OracleAS_1\\integration\\esb\\samples\\tutorials\\CustomerData&#8217;<br \/>\n* Unzip it into C:\\<\/p>\n<span id=\"Create_JDev_Application_and_Project\"><h2>Create JDev Application and Project<\/h2><\/span>\n<span id=\"Create_a_JDev_Application_named_8216ESBSamples8217\"><h3>Create a JDev Application named &#8216;ESBSamples&#8217;<\/h3><\/span>\n<p>* Click &#8220;Applications Navigator&#8221; tab,<br \/>\n* Right click &#8220;Applications&#8221;,<br \/>\n* Select &#8220;New Application&#8230;&#8221;,<br \/>\n* Enter application name,<br \/>\n* Click &#8220;OK&#8221;,<br \/>\n* Click &#8220;Cancel&#8221; on Create Project dialog.<\/p>\n<span id=\"Create_a_JDev_ESB_Project_named_8216CustomerData8217\"><h3>Create a JDev ESB Project named &#8216;CustomerData&#8217;<\/h3><\/span>\n<p>* Click &#8220;Applications Navigator&#8221; tab,<br \/>\n* Right click &#8220;ESBSamples&#8221;,<br \/>\n* Select &#8220;New Project&#8230;&#8221;,<br \/>\n* Select &#8220;General -> Projects -> ESB Project&#8221;,<br \/>\n* Click &#8220;OK&#8221;. <\/p>\n<span id=\"Import_XSD_Files\"><h2>Import XSD Files<\/h2><\/span>\n<p>* Click &#8220;CustomerData&#8221; ESB project<br \/>\n* Click &#8220;File -> Import&#8230;&#8221;<br \/>\n* Select &#8220;Web Source&#8221;, click &#8220;OK&#8221;<br \/>\n* Browse to &#8216;C:\\Customer\\Schemas&#8217;<br \/>\n* Select all three schema files, click &#8216;OK&#8217;<\/p>\n<span id=\"Create_an_ESB_System\"><h2>Create an ESB System<\/h2><\/span>\n<p>* Click &#8216;Create System\/Group&#8217; icon on the center panel.<br \/>\n&#8211; Create: System<br \/>\n&#8211; Name: CustomerData<br \/>\n* Click &#8216;OK&#8217;<\/p>\n<span id=\"Create_an_Inbound_File_Adapter_Service:_CustIn\"><h2>Create an Inbound File Adapter Service: CustIn<\/h2><\/span>\n<p>* Drag &#8216;Component Palette -> Adapter Services -> File Adapter&#8217; onto &#8216;CustomerData.esb&#8217; design area in the center panel.<br \/>\n* Define file adapter service:<\/p>\n<pre lang=\"txt\">Name: CustIn\r\nSystem\/Group: CustomerData<\/pre>\n<p>* Click &#8216;Configure Adapter Service Wsdl&#8217; icon to the right of WSDL File field.<\/p>\n<pre lang=\"txt\">Service name: CustIn\r\nOperation type: Read File\r\nOperation name: ReadCustomerData\r\nDirectory for Incoming Files (physical path): C:\\Customer\\In\r\nInclude Files with Name Pattern: *.xml\r\nPolling frequency: 1 sec\r\nSchema location: Type Explorere -> Project Schema Files -> LegacyCustomer.xsd -> CustomerData\r\nSchema element: CustomerData<\/pre>\n<p>* Click &#8216;Finish&#8217;<br \/>\n* Click &#8216;OK&#8217;<br \/>\n* &#8216;CustIn_RS&#8217; routing service is also created automatically.<\/p>\n<span id=\"Create_an_Outbound_Database_Adapter_Service:_CustDBOut\"><h2>Create an Outbound Database Adapter Service: CustDBOut<\/h2><\/span>\n<span id=\"Create_OLite_8216CUSTOMER_DATA8217_table\"><h3>Create OLite &#8216;CUSTOMER_DATA&#8217; table<\/h3><\/span>\n<pre lange=\"bash\">\r\ncd C:\\oracle\\product\\10.1.3.1\\OracleAS_1\\integration\\esb\\olite\\bin\r\nsql_olite.bat @C:\\Customer\\create_customer.sql\r\n<\/pre>\n<span id=\"Create_CustDBOut\"><h3>Create CustDBOut<\/h3><\/span>\n<p>* Drag &#8216;Component Palette -> Adapter Services -> Database Adapter&#8217; onto &#8216;CustomerData.esb&#8217; design area in the center panel.<\/p>\n<pre lang=\"txt\">Name: CustDBOut\r\nSystem\/Group: CustomerData<\/pre>\n<p>* Click &#8216;Configure Adapter Service Wsdl&#8217; icon to the right of WSDL File field.<br \/>\n&#8211; Service name: CustDBOut<br \/>\n&#8211; Connection: click &#8216;New&#8217;<\/p>\n<pre lang=\"txt\">Connection name: Olite\r\nConnection type: Oracle Lite\r\nUser name: system\r\nPass: any\r\nDriver: Type 4 Driver\r\nLibrary: Olite40.jar\r\nClasspath: C:\\oracle\\product\\10.1.3.1\\OracleAS_1\\integration\\esb\\lib\\olite40.jar\r\nHost name: localhost\r\nJDBC port: 1531\r\nSID: OraESB<\/pre>\n<p>* Click &#8216;Test Connection&#8217;, should return Success<br \/>\n* Click &#8216;Finish&#8217;<\/p>\n<pre lang=\"txt\">Connection is now: Olite\r\nUser name: system\r\nDriver: oracle.lite.poljdbc.POLJDBCDriver\r\nConnection string: jdbc:polite4@localhost:1531:OraESB\r\nJDDI name: eis\/DB\/Olite<\/pre>\n<p>* Operation type: Perform an operation on a table -> Insert or Update (Merge)<br \/>\n* Import Tables: SYSTEM.CUSTOMER_DATA<br \/>\n* Primary key: CUSTOMERID<br \/>\n* Click &#8216;Finish&#8217;<br \/>\n* Click &#8216;OK&#8217;<\/p>\n<span id=\"Create_an_Outbound_JMS_Adapter_Service:_CRMOut\"><h2>Create an Outbound JMS Adapter Service: CRMOut<\/h2><\/span>\n<p>* Drag &#8216;Component Palette -> Adapter Services -> JMS Adapter&#8217; onto &#8216;CustomerData.esb&#8217; design area in the center panel.<br \/>\n* Define jms adapter service:<br \/>\n&#8211; Name: CRMOut<br \/>\n&#8211; System\/Group: CustomerData<br \/>\n* Click &#8216;Configure Adapter Service Wsdl&#8217; icon to the right of WSDL File field.<br \/>\n&#8211; Service name: CRMOut<br \/>\n&#8211; OEMS: Memory\/File<br \/>\n&#8211; Connection: LocalApplicationServer<br \/>\n&#8211; Operation type: Produce Message<br \/>\n&#8211; Operation name: Product_Message<br \/>\n&#8211; Destinations: demoTopic (topic)<\/p>\n<pre>\r\nDestination name: jms\/demoTopic\r\nJMS Connection Factory: jms\/TopicConnectionFactory\r\nMessage body type: TextMessage\r\nDelivery mode: Persistent\r\nPriority: default\r\nTimeToLive: 0\r\nJNDI name: eis\/Jms\/TopicConnectionFactory\r\n<\/pre>\n<p>&#8211; Schema location: browse to &#8216;Type Explorer -> Project Schema Files -> CommonCustomer.xsd -> Customer&#8217;<br \/>\n&#8211; Schema element: Customer<br \/>\n&#8211; Click &#8216;Finish&#8217;<br \/>\n* Click &#8216;OK&#8217;<\/p>\n<span id=\"Create_an_Outbound_Routing_Service:_CustOut_RS\"><h2>Create an Outbound Routing Service: CustOut_RS<\/h2><\/span>\n<p>* Drag &#8216;Component Palette -> ESB Services -> Routing Service&#8217; onto &#8216;CustomerData.esb&#8217; design area in the center panel.<br \/>\n* Define routing service:<br \/>\n&#8211; Name: CustOut_RS<br \/>\n&#8211; System\/Group: CustomerData<br \/>\n* Select &#8216;Generate WSDL from Schema&#8217;<br \/>\n&#8211; Schema location: browse to &#8216;Type Explorer -> Project Schema Files -> CommonCustomer.xsd -> Customer&#8217;<br \/>\n&#8211; Schema element: Customer<br \/>\n&#8211; Operation name: MapCustomerData<br \/>\n&#8211; Namespace: http:\/\/oracle.com\/esb\/namespaces\/CustomerData<\/p>\n<span id=\"Specify_Routing_Rules_for_CustIn_RS_and_CustOut_RS\"><h2>Specify Routing Rules for CustIn_RS and CustOut_RS<\/h2><\/span>\n<p>* Double click CustIn_RS<\/p>\n<span id=\"Specifying_Routing_Rules_from_CustOut_RS_to_CustDBOut\"><h2>Specifying Routing Rules from CustOut_RS to CustDBOut<\/h2><\/span>\n<p>* Double click CustOut_RS<br \/>\n* Expand Routing Rules<br \/>\n* Click &#8216;+&#8217; sign to the right of MapCustomerData<br \/>\n&#8211; Select &#8216;ESB\/Services in project\/CustDBOut\/write&#8217;<br \/>\n* Click &#8216;H&#8217; icon to the right of <<Transformation Map>><br \/>\n&#8211; Select &#8216;Create New Mapper File:&#8217;<br \/>\n&#8211; Click &#8216;OK&#8217;<br \/>\n&#8211; Drag &#8216;inp1:Customer&#8217; to &#8216;top:CustomerData&#8217;<br \/>\n~ Check &#8216;Enable Auto Map&#8217;<br \/>\n~ Check &#8216;Prompt for Preferences before Auto Map&#8217;<br \/>\n~ Mode: Basic<br \/>\n~ Check &#8216;Match Elements with Similar Names&#8217;<br \/>\n~ All others deselected. Especially, <strong>de<\/strong>select Match Elements Considering their Ancestor Names<br \/>\n* Click OK<\/p>\n<span id=\"Specifying_Routing_Rules_from_CustOut_RS_to_CRMOut\"><h2>Specifying Routing Rules from CustOut_RS to CRMOut<\/h2><\/span>\n<p>* Double click CustOut_RS<br \/>\n* Expand Routing Rules<br \/>\n* Click &#8216;+&#8217; sign to the right of MapCustomerData<br \/>\n&#8211; Select &#8216;ESB\/Services in Project\/CustomerData\/CRMOut, select Produce_Message&#8217;<\/p>\n<span id=\"Adding_an_Expression_Filter_to_the_CustOut_RS_Routing_Service\"><h2>Adding an Expression Filter to the CustOut_RS Routing Service<\/h2><\/span>\n<p>* Double click CustOut_RS<br \/>\n* Click the filer icon for &#8216;CustDBOut::write&#8217;<br \/>\n* In the WSDL Message box, expand Customer_request\/Customer\/inp1:Customer\/Address<br \/>\n* Select Country.<br \/>\n* Click &#8216;Insert Into Expression&#8217;.<br \/>\n* Specify the country as &#8220;US&#8221;: \/inp1:Customer\/Address\/Country=&#8217;US&#8217;<br \/>\n7. Click OK.<\/p>\n<span id=\"Register_Services_with_Oracle_ESB\"><h2>Register Services with Oracle ESB<\/h2><\/span>\n<p>* Right click &#8216;Application Navigator\/Applications\/ESBSamples\/CustomerData\/&#8217;<br \/>\n* Select &#8216;Register with ESB\/LocalIntegrationServer&#8217;<br \/>\n* Click OK<\/p>\n<span id=\"View_Services_in_Control_Console\"><h2>View Services in Control Console<\/h2><\/span>\n<span id=\"Running_the_Tutorial\"><h2>Running the Tutorial<\/h2><\/span>\n<p>* Copy &#8216;C:\\Customer\\LegacyCustomer.xml&#8217; to &#8216;C:\\Customer\\In&#8217; directory.<br \/>\n* &#8216;C:\\Customer\\In\\LegacyCustomer.xml&#8217; disappears.<br \/>\n* Query OLite<\/p>\n<pre lang=\"sql\">\r\n...OracleAS_1\\integration\\esb\\olite\\bin>msql.exe system\/any@jdbc:polite4@127.0.0.1:1531:oraesb\r\n\r\nSQL> select customerid,name,country from customer_data;\r\nCUSTOMERID | NAME                  | COUNTRY\r\n-----------+-----------------------+--------\r\nA22-9AXC2  | Deserae International | US\r\n\r\n1 row(s) returned<\/pre>\n<span id=\"References\"><h2>References<\/h2><\/span>\n<p>* <a href=\"http:\/\/download.oracle.com\/docs\/cd\/B31017_01\/integrate.1013\/b28212.pdf\">http:\/\/download.oracle.com\/docs\/cd\/B31017_01\/integrate.1013\/b28212.pdf<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Setup JDev * Install JDev 10.1.3.3 Create a new Application Server connection * Click &#8220;Connections&#8221; tab, * Right click &#8220;Application Server&#8221;, * Select &#8220;New Application Server Connection&#8230;&#8221; Name: LocalApplicationServer Connection Type: Oracle Application Server 10g 10.1.3 User name: oc4jadmin Pass: &hellip; <a href=\"https:\/\/jianmingli.com\/wp\/?p=1564\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[48,35],"tags":[],"class_list":["post-1564","post","type-post","status-publish","format-standard","hentry","category-esb","category-oracle"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8cRUO-pe","_links":{"self":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1564","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1564"}],"version-history":[{"count":2,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1564\/revisions"}],"predecessor-version":[{"id":1566,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1564\/revisions\/1566"}],"wp:attachment":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1564"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1564"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1564"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}