Oracle service bus cookbook pdf


 

Oracle Service Bus 11g Development Cookbook - Selection from Oracle Service Bus 11g Development Cookbook [Book]. of the Oracle Service Bus 11g Development Cookbook, Packt Publishing, Did you know that Packt offers eBook versions of every book published, with PDF. Oracle Service Bus 11g Development Cookbook – FreePdfBook. Oracle Oracle Database Migration Assistant For Unicode Release Notes · Oracle 11g Anti.

Author:MILDRED BRUNICK
Language:English, Spanish, Hindi
Country:Latvia
Genre:Business & Career
Pages:124
Published (Last):22.12.2015
ISBN:311-6-68671-514-4
Distribution:Free* [*Registration Required]
Uploaded by: MONTY

45901 downloads 172981 Views 10.72MB PDF Size Report


Oracle Service Bus Cookbook Pdf

To develop and test the recipes in this book, an Oracle Service Bus 11g file is a PDF document named terney.info This recipe explains the usage and peculiarities of Oracle Service Bus in an easy This recipe is based on an introduction text published in my Middleware and. November Documentation for developers that describes how to use the. Oracle Service Bus Console and Oracle JDeveloper to create and configure proxy.

Oracle Real-Time Integration Business Insight gives business owners the ability to monitor key metrics of their enterprise in real time using pre-configured dashboards. A differentiating feature of this product is its ability to extract these metrics even if backing data sources do not contain the raw data in a traditional store, such as a database. Business users follow a simple three-step process to define, map, and monitor business metrics. First, a model of the business is created using a simple browser-based designer. The model defines concepts important to the business, such as milestones, measures, and dimensions. Second, the model is mapped by an architect to application services and components so that business-level metrics can be extracted during normal business activity. Architects can select services and components for mapping using simple visualizations of application structure in their browser. Finally, the model is activated and the collection of metrics begins immediately. Stakeholders can start tracking metrics using pre-configured dashboards, tables, and reports. Customized dashboards and reports can also be created that let business owners prioritize metrics that are most important to their success.

Open CustomerPS and navigate to Transport configuration as shown below. So service consumers can access your proxy service using URL http: These changes would resolve the errors in Proxy Service and observe all red marks are gone. Now your Service Bus Overview Editor should look like below. Left swim lane is for services providing an entry point to application so limited to Proxy Services.

Middle swim lane is for components providing routing and transformation so limited to Pipelines and Split-joins. Right swim lane is for references providing communication with actual service providers so limited to Business Services or Proxy Services. For more information refer to this link. Creating Message Flow In 12c, message flow is separated from Proxy Service and incorporated in separate component called Pipeline.

In this section, you will see creating message flow in Pipeline. As observed in previous section, the CustomerPSPipeline already inherited the initial message flow from pipeline template.

So in this section, you will start modifying this message flow and add more activities in placeholders provided by pipeline template. Now your message flow should look like below. Validating Payload In this section, you will complete the Payload and Email format validation. For Location property bring up expression editor by clicking icon. Drag or shuttle Customer element into Expression field as shown below and click OK.

Now you can observe all red marks are no longer visible for CreateCustomer branch as you set required properties. In Properties tab, bring up expression editor for Condition property and give the Expression as: Alternatively, you can drag fn: You can remove Else branch by selecting Delete on right click.

This way, basically you are defining different properties that can be used in Message Flow along with initial values. The domain names PropertyName represent configurable properties and PropertyValue represents property values respectively. For current scenario, give property name as ValidateAddress and its value as Y. Remember you need to create a session before modifying anything.

Bring up expression builder for Value property and give expression as shown below. Address Validation business service should be invoked only when the value of this configuration property 'Y'. Service Bus provides Service Callout, Routing and Publish activities to route incoming request to an appropriate business service. Routing and Service Callout are used for Synchronous where as Publish activity is used for one-way communication.

As mentioned earlier, Routing node always depicts end of message flow so you can't place any activities after Routing node. Hence we use Service Callout for all intermediate service calls in pipeline. Since you are using the 'Configure Soap Body' option, make sure that request variable is populated with complete payload including SOAP Body element soap-env: Next task is transforming the received payload to the structure expected by address validation business service.

One of the added features in 12c is JDeveloper has complete design time support for XQuery as well. First we will get hands-on in using XQuery files so let us start creating one serving your purpose.

Click browse icon and select Customer element in CustomerPS. Now click pencil icon for Target to bring up Function Result Type window. Click OK thrice to bring up transformation editor. Do the initial mapping of attributes as shown below. You can map the fields by connecting source element to target element. Address Validation service expects address lines with ',' as delimiter, so go to XQuery Source tab and modify concat function as shown below. Its always advisable to test your XQuery mapping to verify that mapping is working as expected.

Click List of variables button highlighted above to bring Edit Variable window and select the options as shown below so that sample input will be generated automatically.

Click Run and verify the mapping is working as expected. You can also verify sample source and target files created in your XQueries folder. Now use another Assign activity to enclose the payload in soap-env: Body element. Bring up expression builder for Value property and give the expression as shown below.

Once response is received, you have to raise error or proceed with message flow depending on status. The red line denotes namespace alias addr is not a valid one. Here you need to give the namespace used by response schema of address validation service. Click OK and observe red line is no longer visible. Defaulting In this section, you will default CustomerType element if the value is not sent.

Drag If-Then activity into this stage from Flow Control and give condition as shown below. Alternatively, you can select fn: Set other properties as shown below so that CustomerType element will be inserted in body context variable after DOB element in request payload. Instead of hard-coding these values in your message flow, you can use Service Account feature provided by Service Bus to store credentials which can be referenced in message flow using XQuery function.

Choosing the option 'Configure Payload Document' allows you to send request and receive response payload without soap-env: Body tag. The XQuery function fn-bea: This function returns following XML fragment. UsernamePasswordCredential xmlns: If you observe red lines, register new namespace http: Drag another Assign activity and set properties as given below to populate payload for business service. Next task is transforming the received payload to the structure expected by CustomerService business service.

Complete Source parameter selection as shown below and you can refer to previous sections for actual navigation steps. Complete Target selection as shown below and you can refer to previous sections for actual navigation steps. In Properties tab, bring up expression editor for Value property and choose above transformation. Set other properties as shown below. Set condition as shown below and add namespace alias cust with namespace urn: Drag Assign activity into If branch from Message Processing and set properties as shown below to store unsuccessful response in faultVar variable.

The actual Fault Response will be sent from Proxy Service Error Handler that will be discussed later in this tutorial.

Complete Source parameters selection as shown below and you can refer to previous sections for actual navigation steps. Bring up expression builder for Value property and select above XQuery map as shown below.

Testing Deploy both projects or run Pipeline directly as shown in Deploying and Testing section. Run your pipeline with sample payloads given here and observe Flow Trace and Variables as shown below. You can also run Proxy Service but you will not observe any Flow Trace. CustomerType element Validation:. Update Customer In this section, you will complete message flow for UpdateCustomer operation.

Since we have discussed each and every step in detail and extensive manner in previous sections, we will go with brief explanation from here onwards. In this case, Email element validation has to be done only when it's sent in request. Use Actions placeholder in Validation stage to do this. Give the following expression in top-level If-Then condition to find whether Email element is available and length is greater than zero.

Since this is Update operation, service consumer should send CustomerID mandatorily in input and your message flow should enforce the same. You can also do the Address Validation similar to CreateCustomer operation, as user can always update the address.

But we are not going to discuss this again in this section. Now click Browse for Target to bring up Select Schema screen. And click Browse for Select Schema and select the target element as shown below. Since we are doing update of customer information, you should not send null values to business service; hence target elements should be mapped only when corresponding source element is available.

You can achieve this behavior automatically in XSL Map editor by setting a preference. Go back to XSL Map editor and finish the initial mapping by mapping respective source and target elements as shown below. Observe that xsl: Click on concat functions and modify them as shown below by adding new elements. This would append , between the elements and is expected by business service.

Now go to Source for XSL map. Its always advisable to test your XSL map to see whether mapping is working as expected. Click OK and observe both source and target xml files get created. You can also modify source xml and retest your XSL map again.

Finish Response Action in Routing similar to CreateCustomer as response structure of business service is same for all the operations. CustomerType element validation:. Delete Customer In this section, you will complete message flow for DeleteCustomer operation. Since this is Delete operation, service consumer should send CustomerID mandatorily in input and your message flow should enforce the same.

In Properties tab, bring up expression builder for Value property and choose above XQuery map. Now your Routing node should look like below. No CustomerID element:. Merge Customer In this section, you will complete message flow for MergeCustomer operation.

As per business requirements, merge operation should create customer if it does not exist in system otherwise update existing customer. So you should reuse the existing message flow created for Create and Update customer operations.

The message flow should perform following: This operation returns Y for existing customer and N otherwise. Move CreateCustomer and UpdateCustomer message flows intto this new pipeline.

Modify CreateCustomer and UpdateCustomer pipelines to call respective operations of new pipeline. Modify MergeCustomer operational branch to call CreateCustomer or UpdateCustomer operations of new pipeline based on customer existence. You can verify customer existence only when CustomerID is present in input payload. So drag If-Then activity from Flow Control and set condition as shown below. Drag a Service Callout into If branch from Communication. And you already completed these actions as part of CreateCustomer and UpdateCustomer operational branches.

So its not a good idea to repeat all of this logic again for this merge operation. If your requirement is just within Service Bus project you can create Pipeline having common message flow and call from main Pipeline or ProxyService. If you require this across projects you can create Proxy Service having common message flow with local transport.

This way, your common proxy service will not be exposed to external consumers and can only be invoked internally in message flow. In this section, you will create new pipeline having common message flow using Service Bus Overview editor. Go back to Service Bus Overview editor by finishing pipeline creation wizard and it should look like below.

You can also verify new pipeline got created in Pipelines folder. Finish Validate activity in both branches as shown previously in respective sections. This would resolve build issues and your message flow should look like below.

Next task is moving the activities from CustomerPSPipeline to here. So move the following activities and nodes to their respective placeholders in this pipeline. Create Customer: If you see redlines for If condition in Response Action of the routing activity, add namespace urn: Also observe that, you are unable to copy any of the activities inherited from pipeline templates like Validate activity.

Because of this, validation will happen twice in CustomerPSPipeline and in this pipeline. In your actual development, you should take care of this by creating new pipeline template for common pipelines or some other means.

Here, we did this way to demonstrate the features of pipeline template like having common functionality in template. Also your service bus overview should look like as shown below showing different interactions and interfaces exposed to consumers.

Merge operation has 2 possible routings based on Customer existence. Run your pipeline with sample payloads given for CreateCustomer and UpdateCustomer operations and observe Flow Trace and Variables as shown below. Invalid Customer Type:. You can repeat test cases for UpdateCustomer operation.

Valid Payload and existing Customer ID:. Migrate Customer In this section, you will complete message flow for MigrateCustomer operation.

Please note that, migration will not happen this way in real world, and Service Bus may not be the right candidate to perform data migration. Here we consider this case only to demonstrate the parallel processing capabilities of Service Bus. Since this is Migrate operation, service consumer should send CustomerID mandatorily in input and your message flow should enforce the same.

Creating Split Join In this section, you will aggregate customer information using Split Join by invoking appropriate Business Services in parallel. Split join allows you to split request payload so that you can call multiple services concurrently as opposed to sequential processing. This way, you will achieve improved service performance. You can come up with your own WSDL or use the one provided with this tutorial from here.

Customer ID as input. Customer information including Customer, Orders and Accounts Info as output. Copy CustMigrationSplitJoin. Make sure that you select SplitJoins folder as the location in wizard.

Drag Parallel activity after Receive as shown below from Flow Control and add another branch by clicking. In Properties tab, modify Name for all the Scope activities as shown below. Drag Invoke Service activity into each of these Scope activities in all 3 parallel branches from Communication so that you can invoke Business services. Also modify Name property for Invoke activities in Properties tab. For InvokeCustomer, create Request and Response variables as shown below.

Request Variable can be created as local variable as you dont use it outside the scope. Now local variables created for each Scope activity should look like below.

Oracle SOA Suite 12c Handbook

This will populate the request variable with the payload expected by CustomerServiceBS. Since there are not many fields to map, we have chosen this way to populate the payload avoiding new transformations. This would fetch Customer, Order and Account information concurrently by invoking respective business services.

You need to transform all these responses into one before returning back to caller. So you need a transformation to do this. Similarly add 2 more parameters as shown below to accept Account and Orders information as the input. Finish the mapping as required and shown below. Observe the sources and target structures.

You may want to test your XQuery using steps mentioned in previous sections. Now you have to use this XQuery map in Split join to merge 3 different responses into one and reply with merged payload. So drag Assign after Parallel activity from Assign Operations and set properties as shown below. With this, you have finished message flow for Split Join and let us finish error handling before proceeding with testing.

The WSDL used for split join has generic fault structure and you will use the same structure to return all type of faults to caller.

So we will do the fault handling at complete split join level. In Properties tab, set the properties as shown below by creating new fault variable. This enables split join to return a fault in case of any error to Pipeline.

Modify name to AssignFault and set properties as shown below. Since you are using 'Configure Payload Document' option, you just need to populate the request variable with required payload. The response of Split Join is same as the payload required by CustomerServiceBS with different namespace so you could use Rename activity instead of another transformation. So drag Replace activity after Rename from Message Processing and set properties as shown below. Error Handling In this section, you will learn how to do error handling in Pipeline.

As you know, service provider can send error to consumer in following ways: As a normal response, by populating fields like ErrorNumber and ErrorMesssage assuming that these fields are defined in response message of operation in WSDL.

So you need to understand the message context variables that can be used for this transformation. When HTTP response code is received, Service Bus treats it as a normal response and proceeds further with message flow. When response code is received, Service Bus runtime control goes to Service Error Handler if it exists or any other low level Error Handlers depending on where you received. The following table summarizes this discussion: Scenario Raise Error activity Fault Response from business service System fault while calling business service Raise Error activity Fault Response from business service System fault while calling business service.

With this background, let us go back to Pipeline to add required Error Handlers.

In this case, the business service WSDL does not define any Fault structure and all errors will be sent as normal response with status E. But you should consider all possible cases for Error Handling. Your Pipeline uses both Service Callout and Routing in message flow so you can do the fault handling in following manner in pipeline template CustomerPipelineTemplate so that concrete pipelines would inherit the message flow.

Add Service Error Handler. CustomerPipelineTemplate In this section, you will finish error handling in pipeline template. In Properties tab, set Condition property for all branches as shown below in expression builder. Remember adding the namespace http: Branch If. Purpose To handle fault received in Routing.

To handle error response received in Routing. To handle fault received in Service Callout or Raise Error cases. All other possible cases.

Drag Replace activity into each of these branches from Message Processing and set properties as shown below. Here you are extracting the error code and error message from received SOAP fault received in Routing, this way you are forwarding actual error from service provider to consumer of your proxy service.

ErrorStatusMsg xmlns: Here you are extracting the error code and error message from error response received in Routing, this way you are forwarding actual error from service provider to consumer of your proxy service. Here you are extracting the error code and error message from SOAP Fault received in Service Callout, this way you are forwarding actual error from service provider to the consumer of proxy service.

In Properties tab, select property as With Failure. Alternatively, you can come up with XQuery map accepting these parameters to take care of all these scenarios and return SOAP fault. Now your ErrorHandler stage should look like below. Run your pipeline with sample payloads given in previous sections and observe Flow Trace and Variables as shown below. Following screenshots show response of CustomerCmnPipeline for different error scenarios. Routing System Error Update Customer:. CustomerPSPipeline Similarly, run this pipeline with sample payloads given in previous sections and observe that you always receive fault message as the response.

Securing Proxy Service Security is one of the main aspects while developing any service and is no different from our regular web applications. Also these services are reusable and can be invoked by either internal or external customers, so you should consider securing your Service Bus Proxy Services so that only valid users will be able to invoke. You can use these any of these OWSM policies to secure your proxy services based on your service security requirements.

First step is creating users. Here you will see how to create users using sbconsole. But this is not the recommended way and typically an Organization will have a list of valid users in some LDAP directory and you have to configure one of the Authenticators in Weblogic to access that LDAP for authentication purpose.

This configuration will not be discussed here in this tutorial. Navigate to Policies tab and select option as shown below. Launch sbconsole and create a new session.

Click Attach Policies icon highlighted above. Select required policy as shown below and click Attach. Refer to http: Open request editor for any operation and paste the following as one of the SOAP headers. You can also observe username and password fields.

Security soapenv: Service Bus 12c - A Hands-on Tutorial. Flag for inappropriate content. Related titles.

Jump to Page. Search inside document.

Oracle Service Bus 11g Development Cookbook

Service Bus Common Requirements 1. MergeCustomer The input structure should be same as CreateCustomer operation. Enter Connection Name and select appropriate Connection Type as shown below. Click Next and give valid credentials. Click Next and give the server details and Weblogic Domain as shown below. Click Next and do Test Connection.

Give name as CustomerServiceBS. Give folder as WSDLs as shown below. Also Refactor all your business services using steps mentioned below. Finish the deployment as shown below. Accept defaults and click Finish. Creating Pipeline Template In this section, you will learn how to create pipeline templates considering requirements.

A pipeline template defines the general shape or pattern of your message flow. Use XYZCustomer project to create all of your resources unless explicitly mentioned. Give name as CustomerPipelineTemplate. Click Finish and verify that new pipeline template has been created and is opened as a separate tab as shown below. Pipeline templates are the right candidates to keep common logic or enforce pattern of message flow that should be followed across Proxy services. For this tutorial, you may not be creating number of Proxy Services but following are common activities for different operations that your Proxy Service should support.

So we will incorporate the following functionality in this Pipeline template. So let us get started with Pipeline template message flow suiting these requirements.

When consumers call proxy service, it has to take different execution paths based on operation being called. The Service Bus provides Operational Branch node serving this purpose. So drag Operational from Template Placeholders onto Pipeline template where yellow circle is shown.

As a best practice, always give meaningful labels for Nodes and other activities wherever applicable. Now your pipeline template should look like below. Service Bus provides Validate activity to do payload validation against schema. So drag Validate activity into Validation stage from Message Processing.

In Properties tab, set Location property value as body and other properties as shown below. Here we dont select any schema or WSDL for validate activity as its just template and we will not have any payload available. There may be additional validations to be performed while designing message flow for concrete pipelines and requires a place holder.

So drag Actions into Validation stage as shown below from Template Placeholders. Delete Stage1 in Response Pipeline by selecting Delete option on right click. Also you may need to create several Stage nodes in your concrete Pipelines message flow.

Service Bus 12c - A Hands-on Tutorial.pdf

So create place holder for the same in template. Now your Pipeline should look like below. Routing node always depicts end of message flow and you can't place any other activities after this node. Observe Actions placeholder which allows user to place any type of activity while designing message flow for your concrete pipelines.

Error handling is another aspect of message flow where you should follow similar approach for different Proxy Services that you create. So you can always create placeholder in your template. You will finish this ErrorHandler stage later in Error Handling section.

With this, you are done with pipeline template and can proceed with creation of other pipelines using this template. Creating Proxy Service In this section, you will learn how to create pipeline using pipeline template and expose it as Proxy Service. First things is, you should come up with a WSDL having Create, Update, Delete and Merge operations as mentioned in business requirements section that can be used for creating Proxy Service.

You can come up with a WSDL or can get it from here. Click Search icon to bring up Resource Chooser and select pipeline template created in previous section. Choose CustomerPS. Verify that WSDL and binding is being selected. Also observe that new tab is opened showing CustomerPSPipeline. Observe that your pipeline had inherited all placeholders, names and properties from pipeline template. Since a few of the properties which are mandatory in concrete pipelines but not mentioned in template, you are seeing red marks both in editors and Project Explorer.

Open CustomerPS and navigate to Transport configuration as shown below. These changes would resolve the errors in Proxy Service and observe all red marks are gone. Now your Service Bus Overview Editor should look like below. Left swim lane is for services providing an entry point to application so limited to Proxy Services.

Middle swim lane is for components providing routing and transformation so limited to Pipelines and Split-joins. Right swim lane is for references providing communication with actual service providers so limited to Business Services or Proxy Services.

For more information refer to this link. Creating Message Flow In 12c, message flow is separated from Proxy Service and incorporated in separate component called Pipeline.

In this section, you will see creating message flow in Pipeline. As observed in previous section, the CustomerPSPipeline already inherited the initial message flow from pipeline template. So in this section, you will start modifying this message flow and add more activities in placeholders provided by pipeline template. Now your message flow should look like below. Create Customer In this section, you will complete message flow for CreateCustomer branch.

Validating Payload In this section, you will complete the Payload and Email format validation. For Location property bring up expression editor by clicking icon. Drag or shuttle Customer element into Expression field as shown below and click OK. Now you can observe all red marks are no longer visible for CreateCustomer branch as you set required properties.

Now your properties tab for Validate activity should look like below. You can remove Else branch by selecting Delete on right click.

Now your Validation stage should look like below. This way, basically you are defining different properties that can be used in Message Flow along with initial values. The domain names PropertyName represent configurable properties and PropertyValue represents property values respectively.

For current scenario, give property name as ValidateAddress and its value as Y. Remember you need to create a session before modifying anything. Bring up expression builder for Value property and give expression as shown below. Set Variable property as ConfigVar. Now your Properties tab should look like below. Address Validation business service should be invoked only when the value of this configuration property 'Y'. Service Bus provides Service Callout, Routing and Publish activities to route incoming request to an appropriate business service.

Routing and Service Callout are used for Synchronous where as Publish activity is used for one-way communication. As mentioned earlier, Routing node always depicts end of message flow so you can't place any activities after Routing node. Hence we use Service Callout for all intermediate service calls in pipeline. Next task is transforming the received payload to the structure expected by address validation business service. One of the added features in 12c is JDeveloper has complete design time support for XQuery as well.

First we will get hands-on in using XQuery files so let us start creating one serving your purpose. Click browse icon and select Customer element in CustomerPS.

Now click pencil icon for Target to bring up Function Result Type window. Click OK thrice to bring up transformation editor.

Related articles:


Copyright © 2019 terney.info.
DMCA |Contact Us