Archive for October, 2014

Service Bus 12c–Creating Proxy Service using Pipeline Template

In this post, you will learn to create Pipeline and expose it as Proxy Service using Pipeline Template created in previous post.

You need a WSDL to be used in Proxy Service and you can get the one used in this post from here. You can copy WSDL into any of your Service Bus project directory in file system directly. And click Refresh in Project Explorer so that these resources will be shown. We will use the following Projects.


Right click Pipelines folder and select New -> Pipeline.


Give name as CustomerPSPipeline and select the option From Template as shown below.


Click Search icon to bring up Resource Chooser and select Pipeline Template.


Click OK to go back to Create Pipeline Service window and click Next.


Click Browse WSDLs icon (highlighted above) and select CustomerPS.wsdl from XYZCustomer project as shown below and click OK.


Verify that WSDL and binding is selected. Click Search icon for Proxy Location and select ProxyServices folder as shown below.


Click Select and modify Proxy Name to CustomerPS. Now your Create Pipeline Service window should look like below.


Click Finish. Verify both Pipeline and Proxy Service are created in Pipelines and ProxyServices folders respectively as shown in Project Explorer.


Observe that new tab is opened showing CustomerPSPipeline had inherited all placeholders, names and properties from your Pipeline Template. You can modify/add activities in placeholders and the properties of inherited activities. Since a few of the properties to be specified mandatorily in concrete pipelines and are not mentioned in template, you will see red marks (see below) both in Project Explorer and editor.


Open CustomerPS and navigate to Transport configuration as shown below. Modify Endpoint URI as /entity/CustomerService. So your service consumers can access your proxy service using following URL:



Go to Message Handling tab and select SOAPAction Header as Selection Algorithm. This would enable proxy service to determine operation at runtime based on SOAP Action sent in HTTP header. These changes should resolve errors in Proxy Service and you can observe that red marks are not seen now.


To resolve errors in Pipeline you should set the properties of Validate activity. In Properties tab of Validate activity, for Schema property click Search icon and select Customer element from proxy service WSDL as shown below. This would enable Service Bus validate input payload against the selected schema at runtime.


For Location property, bring up expression editor by clicking iconclip_image003. Drag or shuttle Customer element into Expression field as shown below and click OK. Now you can observe that all red marks are gone for Pipeline as well.


Now your properties tab for Validate activity should look like below.


Now your Service Bus Overview Editor should look like below.



Service Bus 12c – Creating Pipeline Template

In this post, you will learn how to create Pipeline Templates in Service Bus 12c.

A Pipeline Template defines general shape or pattern of your message flow. We use Service Bus project XYZCustomer shown below for the demonstration purpose and we intended to create proxy service performing CRUD operations on objects like Customer.


Note: You can create new folders by navigating to File -> New -> From Gallery -> General -> Folder.

Right click Pipelines folder and select New -> Pipeline Template.


Give a meaningful name. Here we are using name CustomerPipelineTemplate.




Click Next. In this screen, you can choose service type depending on your requirement. Here we want to create WSDL based proxy service, so choose Service Type as WSDL SOAP as shown below.


Click Finish and verify that new Pipeline Template is created and opened in a separate tab as shown below.


Pipeline templates are the right candidates to keep common logic or enforce pattern of message flow to be followed across Proxy services. Typically, you may want to perform following common activities for different operations that your Proxy Service supports.

  • Validation of payload against schema
  • Routing to a business service (e.g: CustomerServiceBS)
  • Error Handling

Along with above functionality, your Pipeline Template needs to have nodes like Operational branch, Pipeline Pair, Stages etc…

When consumers call Proxy Service, it has to take different execution paths based on operation 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.


Note: All Nodes or activities used in message flow for Pipeline or Pipeline template are available in Components -> Message Flow under different sections. If you don’t see Components window, get it by selecting Window -> Components.



Click BranchNode1 and set name as CustomerOperation in Properties tab as shown below. As a best practice, always give meaningful labels for Nodes and other activities (wherever applicable).


Now drag Pipeline Pair from Nodes into Branch and give name as PipelinePair and rename Stage1 node in Request Pipeline to Validation in Properties tab.  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 you will not select any schema or WSDL for validate activity as it’s just template and we will not have any payload available.


There may be additional validations to be performed while designing message flow in concrete Pipelines which 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 Pipeline’s message flow. So create a place holder for the same in your template. Drag Stages into pipeline after Validation stage and in Response Pipeline from Template Placeholders. Now your pipeline pair node should look like below.


Routing node always depicts end of your message flow and you will not be able to place any other activities after this node. So drag and place Route after PipelinePair from Template Placeholders and set name as Route in Properties tab. 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 may want to follow similar approach for all Proxy Services. So drag Error Handler onto CustomerPipelineTemplate from Nodes. And in Properties tab, set name as ErrorHandler for Stage1 as shown below.


We will see Error Handling in detail in separate post. For the time being, you can drag Actions placeholder into ErrorHandler stage.

With this, you are done with Pipeline Template and can proceed with creation of Pipelines using this template.

Service Bus 12c – Deploying and Testing

During development, you may often deploy and test your Business and Proxy services to verify that you are able to send request and receive response as expected. And typically, if the service provider is external to your organization, you have to configure your business service to use HTTP proxy server.

Note: HTTP Proxy Server is a global resource to be created in Service Bus Application and can be attached to business service in Advanced Settings of Transport Details tab.

In Service Bus 12c, you can use either Integrated or Standalone WLS to test business/proxy services.

Integrated WLS:

Right click business/proxy service and select Run.


If Default Domain does not exist, JDeveloper will prompt for credentials to create Integrated WLS. Enter credentials click OK to start server.


Once the server starts, Test Console is opened as shown below. This Test Console shows all available operations (If it’s based on WSDL), Request Document section (to enter payload), Transport section (to enter transport headers) and Attachments section.


Click Execute and observe that you are able to send request and receive response as shown below. You can use Back to modify payload and repeat your test scenarios.


Standalone WLS:

You can also deploy your service bus project to standalone WLS from JDeveloper and test from sbconsole. Right click XYZCommon project and choose Deploy as shown below.


Finish deployment using steps shown below.




Once deployment is done, login to sbconsole using http://host:port/sbconsole. Clicking arrow icon (highlighted below) will bring up the same Test Console shown earlier.


Another option is exporting your projects as Configuration Jar and deploy to either Integrated or Standalone WLS. To do this, right click XYZCommon project and select Export as shown below.


Select Service Bus Resources option as shown below.


Select Configuration Jar as destination.


Click Next. Give Jar file name including file system path as shown below and click Finish.


Open sbconsle. Create new session by clicking Create to import configuration jar.


Click Import icon in Resources tab.


Select configuration jar using Choose File button as show below.


Click Next. Accept defaults and click Import.


Click Close on confirmation screen and verify new project is shown as below in Resources tab.


Click Activate and confirm the session so that your changes will be effective.



Similarly, you can export service bus project directly to server by choosing Server as shown below in Export Service Bus Resources window shown earlier.


Click Next and choose Destination Server as shown below.


Click Next. Accept defaults and click Finish. Once export is successful, you can launch sbconsole and test your business and proxy services as shown above.


Note: Developer can choose any of the above options for deploying and testing business/proxy services.

Service Bus 12c – Creating Business Services

In Service Bus, Business Services provide abstraction layer and take care of communication with Service Providers. In this post, you will see different ways of creating Business Service in Service Bus project using JDeveloper based on a WSDL. And for the demonstration purpose, we will consider the Service Bus project and WSDLs shown below.


Method 1:

Right click Service Bus project and select New -> Business Service.


Give a meaningful name for Business Service as shown below.


Click Browse WSDLs icon (shown above) and choose CustomerService WSDL as shown below.


Click OK to go back to Create Business Service wizard.


Method 2:

Open the Service Bus overview file (file with same name as your project) and drag HTTP adapter into from Components –> Service Bus –> Technology –> HTTP into External Services swim lane to bring up Create Business Service wizard as shown below.




Give meaningful name for Business Service and click Next. Select the option WSDL and choose WSDL as shown in previous method by clicking Browse WSDLs icon.



Method 3:

Right click WSDL in Service Bus project and select Service Bus –> Generate Business Service as shown below.


Verify that Create Business Service wizard has come up showing WSDL and binding selected.


And the following steps are common irrespective of the above methods you choose to create Business Service.

Click Next and enter Endpoint URI of the service.


Click Finish to bring up a new tab showing CustomerServiceBS.bix.


Service Bus 12c – Creating Service Bus Application and Project

In Service Bus development, you make use of different resources like Proxy Service, Business Service, WSDL, XSD, XQuery, XSLT etc. Also there are other resources like SMTP Server, JNDI Provider called Global resources. Service Bus Project acts as a container for different resources and Service Bus Application is a high-level container for all these Service Bus projects and Global resources.

You usually start development activity with creation of new Service Bus Application. Create one by navigating to File -> New -> From Gallery -> Service Bus Tier. Select Service Bus Application and give meaningful name and click Finish. Here we are using ServiceBusAppl as Application Name.



Creating Service Bus Projects

Now you can proceed with the creation of Service Bus Projects considering reusability and modularity. Create new Service Bus Project by navigating to File -> New -> From Gallery -> Service Bus Tier. Select Service Bus Project and give meaningful name and click Finish. Here we are using XYZCommon as Project Name.



Now your Project Explorer should look like below showing Service Bus Application and Service Bus Project containing 2 files (pom.xml and XYZCommon). You will see a file with same name as your project called project overview file which opens up Service Bus Overview editor when opened.


 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.




Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 372 other followers

Enter your email address to follow this blog and receive notifications of new posts by email.