Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Oracle OSB Tutorial 1


Published on

Getting the service description (WSDL)

Configure Service Bus

Import Resources

Configure Business Service

Config ure the Credit Card Validation Proxy

Configure Message Flow(Validate & Report)

Adding a Pipeline Pair ->Add Stage ->Add Action(Reporting) ->Add Validate Action

  • would you please share the download link of the three osb composite applications?
    Are you sure you want to  Yes  No
    Your message goes here
  • It is a very helpfull side. Thanks, Rakesh
    Are you sure you want to  Yes  No
    Your message goes here

Oracle OSB Tutorial 1

  1. 1. Oracle Service Bus – Lesson 1Name – Rakesh GujjarlapudiEmail Address –
  2. 2. The link for the OSB console ishttp://localhost:7001/sbconsole (login with weblogic/welcome1)The link for the EM Fusion Middle Control console ishttp://localhost:7001/em (login with weblogic/welcome1)The link for the Weblogic console ishttp://localhost:7001/console (login with weblogic/welcome1) BEFORE VIRTUALIZATION WITH OSB AFTER VIRTUALIZATION WITH OSBOnce completed, the overall Message Flow of the Oracle Service Bus Proxy should look like the followingpicture.
  3. 3. Creating Connection to Oracle WebLogic Server in JDeveloper Launch JDeveloper From the Application Menu, select New. In the New Gallery, in the Categories tree, select General, and then Connections. Select Application Server Connection Click OK. The Create Application Server Connection Type page is displayed. Enter MyAppServerConnection in the Connection Name field and select WebLogic 10.3 from the Connection Type list. Click Next
  4. 4. The Connection Authentication page is displayed.Enter weblogic for the User Name and thepassword welcome1 for that administrator in thePassword field.Click Next.The Configuration page displays.Enter the following values:Weblogic Hostname (Administration Server):localhostPort: 7001WLS Domain: soa_osb_domainClick Next.The Test page displays.Click Test Connection.The following status should appearIf the test is unsuccessful, ensure that OracleWebLogic Server status is RUNNING, and retry thetest.Click Next, and in the Finish page, click Finish.You will see the connection in the Resource Palette
  5. 5. Load SOA Composite solutions into JDeveloper Need to load three SOA Composites into JDeveloper 1. POProcessing 2. CreditCardValidation 3. ConsumeJMSFulfillmentApp From the Application Menu, select Open, Browse to the application location as shown below to load the application into JDeveloper. Let us start with the POProcessing application Repeat Step 1 for CreditCardValidation and ConsumeJMSFulfillmentApp applications.Deploying Composites to the Application Server After you open the composite application, you can deploy it to the server The Deploy command rebuilds the app and writes the binary to disk. It also brings up the deployment plan dialog before deploying. When the server is stopped and restarted, the applications will remain deployed. In the project menu – right-click on the POProcessing project name - select Deploy. Make sure you have the project menu and not the application menu in order to see this option Select Deploy to Application Server.
  6. 6. Click Next. If you redeploy the same compositemultiple times then check Overwrite any existingcomposites with the same revision ID if you intentto just test and hence over write the existingdeployed version of the composite. This willrender existing instances StaleClick Next. Do not check ApproveTaskDetails.Check ApproveTaskDetails if you are trying thetutorial on your local machine and deployingPOProcessing composite the first timeSelect the MyAppServerConnection to deploy. Ifthe Application Server connection does not showup in the list, click on on the top right. This shoulddisplay the MyAppServerConnection as shownbelow.Click Next
  7. 7. Click FinishNext the application is built and deployed. If thereare no compilation errors, you will see on the SOAlog, BUILD SUCCESSFUL and then the deploymentstarts.In the Deployment log, view the details of thedeployment.Wait for your application to be deployedRepeat Steps 1 – 12 for CreditCardValidation andConsumeJMSFulfillmentApp applications. Youselect the other composites from the ApplicationNavigator as shown belowYou are now ready to test the composites
  8. 8. Running and Verifying the application with EM Open your browser and navigate to EM. http://localhost:7001/em (The first time these screens are run after starting the server they will be slow as they are unpacked, compiled, and loaded into memory.) Login with weblogic/welcome1 (or appropriate password for your environment) The Enterprise Manager opens to the “farm” view. You can see the status of your Server as well as the deployed Java applications and SOA composites. Select validationForCC composite from the list of composites on the main farm view or on the left navigation bar. The composite page opens. On this page, you can see the Recent Instances (none yet), Faults, the Component Metrics (there is only one component in this composite), and the Services and References Metrics
  9. 9. Click Test button at the top of the screen. The Testpage opens.You can see the WSDL location, Operations list,and two tabs, Request and Response.Scroll down to the Input Arguments section.The first time you click on Test you might get thefollowing error. You can ignore this error. Click onTestagainSpecify your values for the payload. You can usethe HTML form on the Tree View, which is default,or the XML source on the XML View. For smalleramounts of the data, using the HTML form view isprobably easier. But for large payloads, its easierto copy-and-paste your data into the XML View.Enter the data “1234-1234-1234-1234” and clickTest Web Service.When the composite completes, the screenchanges to the Response tab and the returnedvalue shown. From here, you can jump directly tothis particular composite instance and view theflow.Click Launch Message Flow TraceThe Flow Trace screen opens and you can see theflow of your composite and the status of eachservice, component and reference
  10. 10. Click on the component to drill down into the Instance Details of the component Close the Flow Trace window, click on your composite to return to the composite page. You can see your Instance ID listed. You can return to the Flow Trace screen by selecting the Instance ID.Getting the service description (WSDL)You can get the service description, or WSDL, of your composite from the Test page. This is useful because youmay need it for applications to access your service, or to expose your service to others.Open the Test page for the composite you are interested in.In the Test page you see the WSDL location. You also can see the Endpoint URL for each of the Operationsdefined in the WSDL.
  11. 11. 1. Configure Service Bus Import Resources Check to see if the SOA-OSB server is running. Make sure your credit card validation service is running Log into OSB Web Console (http://localhost:7001/sbconsole) username weblogic, password: welcome1 Click Create button in left hand corner of screen to start a new session. In OSB, all changes are done in a sandbox called a session. You first create the sandbox by creating a session in the change center. After a set of related changes are done, you deploy all the changes in the session as a unit by clicking Activate in Change Center. We first need to create a project with sub folders. We could create it in the console, but instead we will import this to illustrate how configuration can be imported into OSB. If you chose to go directly to the solution, you can import the solution in the same way. Scroll down the left hand pane and click System Administration. Click Import Resources (selected by default). Click Browse and navigate to in your local file system. Select chap-1-starting-sbconfig.jar. Click Next then Import Click the Activate button to commit the OSB configuration change.
  12. 12. Then click the Submit buttonClick Project Explorer then Project Folders. You should see a top level project called Credit_Services withsub folder BusinessServices.Click Create in the Change Center to start a new session to start adding the required resources.Click Credit_ Services. Add ProxyServices folder and Resources folder under Credit_Services folder bytyping the folder names in the Enter New Folder Name field and pressing Add Folder. Whenfinished your project structure looks as depicted below.Navigate to the Resources folder. Click on Create Resources drop-down box and select Bulk - Resourcesfrom URL.You will import resources from the WSDL URL of SOA Suite Server. You can simply paste the URL of theWSDL into the URL/Path field as depicted below. The precise URL to the WSDL file can be obtained fromthe validationForCC test page in Enterprise Manager console ( http://localhost:7001/em ) or by clickingthe icon noted in the graphic below.
  13. 13. Be sure to remove any version numbering. It will be something like this.http://orabpm-server:7001/soa-infra/services/default/validationForCC/getStatusByCC?W SDLClick Next. Click Import. You now have imported the WSDL and schema needed to create theBusiness Service for the credit validation service on Oracle Service Bus.Configure Business ServiceA business service defines the interface and connection information for an endpoint OSB invokes. It issimilar to a composite reference.Navigate to the BusinessServices folder. From the Create Resources drop-down, select Business Service.
  14. 14. On the General Configuration tab, fill in the Service Name and Description.Click the Browse button. This will bring up the window to select WSDL for the Business Service.Click on link to WSDL imported in previous step, ValidateCredit_WSDL.
  15. 15. Select the execute_pt under the Ports and then press Submit.Click Next through each of the remaining configuration screens.Review options available to business services. Accept all of the defaults.Finally, on last screen showing all the options together in a table format, scroll down and press Save(don’t forget this step and navigate away from this page before hitting Save or you’ll lose your changes).
  16. 16. From the Project Explorer view, Click on your new Business Service.Click on Operational Settings Tab at top of page.Check the box Enabled next to Monitoring.Change the aggregation interval to greater than ten minutes.Enabling monitoring will collect metrics for your service such as average response time, average TPS andnumber of errors. You can define SLA alerts on these metrics.
  17. 17. The aggregation interval defines how often metrics will roll over. Generally for demos, you want toselect something longer than 10 minutes, say 25 to 30 minutes.Note all the operational settings can be set at fine-grained Service level.Click Update button to save your changes.Activate your changes by clicking the Activate button in left hand corner of screen.Add a Description to document what was done. This will help you identify later in the Change Center incase you would like to undo or re-do your changes.Click Submit. You are now ready to test your first OSB Business Service!Select the next to your new Business Service to bring up the Test Console.Before proceeding, ensure you can invoke the validationforCC service deployed to SOA.Set the credit card number to 1234-1234-1234-1234. The test XML should look like this.<cca:creditcardStatusRequest mlns:cca=""><cca:CCNumber>1234-1234-1234-1234</cca:CCNumber></cca:creditcardStatusRequest>Click Execute button.
  18. 18. Review the Response document for VALID, and close the test console window
  19. 19. Configure the Credit Card Validation ProxyA proxy service is the OSB mediation logic that virtualizes the endpoints OSB routes to and decouples itfrom the client. We will first just create a proxy service exposed to the client that just routes to thebusiness service. Later we will add more logic in the proxy service.Click the Create button in the Change Center to start a new session.Navigate to the ProxyServices folder. Click on Create Resources drop-down box and select Proxy Service.On General Configuration page, Service Name ValidateCredit. For the easiest way to create theProxy Service Routing to a Business Service follow Step 33. For the more lengthy process follow StepsOn the General Configuration page, Select Create From Existing Service, Select Business Service and clickon Browse to select the business service, validationForCC, you created. Click Last and Click Save (Don’tmiss clicking Save).
  20. 20. Click Activate on left hand side of screen to commit your changes to the session. Click Submit. Youare now ready to test your new Proxy!Navigate to the new Proxy Service and click on the to bring up the Test Console for the ProxyService. You can click on to see the Message Flow logic for the Proxy ServiceCut and paste the same XML you used to test the validationForCC business service, or enter the creditcard number of “1234-1234-1234-1234 into the Payload text box.Click on the Execute button. You should see output similar to when you tested your Business Servicedirectly. Close the “Proxy Service Testing” window when complete.Configure Message Flow.Navigate to the newly created Proxy Service via Project Explorer.Click on Create to start a new session in the Change Center.Click on the Message Flow icon next to ValidateCredit. This will take you to the Message FlowNotice a Route node has already been created to pass-through to the validateforCC business service.
  21. 21. Next you will add one stage (Stage allows grouping of related actions) with two actions to the MessageFlow.Validate action will validate the incoming request payload against a schema type definition and if thevalidation fails, you will configure an error handler to signal the failureReport action will track incoming messages and stream data as it arrives from the POProcessingcompositeClick on the envelope above ValidateCredit Select Add Pipeline Pair.Click on left Request_Pipeline and select Add Stage.Click on new Stage and select Edit Stage.
  22. 22. Now we will add 2 Actions, Report and Validate. The Report action allows you to record any payloadelements along with key-value pairs to a database.Validate action will allow us to check for valid input to credit card validation service and throw an errorif invalid input message is detected.Click on Add Action->Reporting->Report.You will see the Report action as belowFill in fields as follows:Expression: $body (Click on <Expression>, Enter $body in text area, Click Save) Click Add a key:KeyName: CCNumberKey Value: ./cca:creditcardStatusRequest/cca:CCNumberTo specify the Key Value, Click <XPath>
  23. 23. Either cut paste the above XPATH value into the text area OR select Variable Structures on the leftbottom. Select body from Drop Down, Expand $body – execute (request) and select CCNumber (asshown in the figure below)The Property Inspector field will be populated with the XPath as shown below. Click on Copy Propertyto copy the XPath automatically into the text area above. (Make sure the cursor is in the text areabefore you click Copy Property for the copy to work)Click SaveIn the in variable field type body and Click SaveAdd Validate Action – Click on Stage icon and Select Edit Stage, Add an Action – MessageProcessing – Validate
  24. 24. Fill in fields.XPath: ./* (dot slash star)variable: bodyResource: XMLSchema_-1537259875* ( Element = "creditcardStatusRequest" )Note: the schema resource name will not match exactly as the name specified above as the nameincludes hash code, which is generated based on the URLClick Save Button.Navigate to top of message flow and click on envelope.Select Add Service Error Handler.Click on Error HandlerSelect Add Stage.Click on stage and select Edit Stage.
  25. 25. Click on Add Action -> Reporting->Alert Configure the Alert as depicted below and click on Save All. Activate the session in Change Center.Re-wire POProcessing CompositeNext youll open your POProcessing composite and fix the getCreditCardStatus reference to invoke OracleService Bus.Open JDeveloper if not already open. Navigate to the POProcessing application.Double-click the composite.xml within “SOA_Content” folder in left hand pane open the Composite editor.
  26. 26. Double click the getCreditCardStatus reference link. In the Update Reference dialog click the iconnext to the WSDL URL field. In the SOA Resource Browser select Resource Palette from the drop down. Expandthe IDE Connections tree to select the ValidateCredit Proxy Service from OSB as shown below. Alternatively, youcan also create a WSIL Connection to OSB (http://orabpm- server:7001/sbinspection.wsil) and browse the ProxyService.Click OK. This will populate the WSDL URL pointing to the OSB ValidateCredit Proxy Service
  27. 27. Click OKSave the composite.xml and Re-deploy the POProcessing Composite. To keep things simple, be sure to overwriteany existing composites of the same version, as shown here. Also, do not forget to leave the ADF Task Flow un-selected.You are now ready to test your end-to-end scenario with Oracle Service Bus.Test the end-to-end applicationAfter deploying, in the EM console, click on the POProcessing application and then open the Test page.You might get the following error when navigating in the Enterprise Manager FWM Control. You can ignore thiserror and simply repeat the action again
  28. 28. Click XML View.Create a large order which the Mediator will route to the BPEL approval process.Copy the entire contents and paste them into the large text field in your browser:Click Test Web Service.Navigate back to the Oracle Service Bus console. Log in. Navigate to OperationsReview the Message Reports. You will see the report as shown below