Invoke an ESB Service in your User Interface and display the response of this service

How can you bind an ESB Service in your User Interface and more specifically how can I call an ESB Routing Service and get the Result back in my UI?

Let’s say I’m developing a JSF Application and I want to use my existing ESB Services for my binding layer. The way you bind a webservice inside a JSF Application can be resolved in 2 different ways:

  • Create a Webservice Data Control
  • Create a Web Service Proxy and call the endpoint of the webservice with a valid parameter using for example a backing bean

OK, now I’m able to call an ESB Service but how can I get the response of this service back into my User Interface …

You need to create a two-way ESB Routing Service, meaning you need to define a request- and response-operation in your routing service.
E.g. You’re invoking a select on a table and the resultset needs to be displayed in your UI. In other words you want to show a list of employees in your user interface, and this list is bound to an esb service.

The steps you need to perform to get this working:

  • Create a new ESB Project
  • Define a system/group for you Esb Services (in this way it isn’t published to the default system)
  • Create a Database Adapter where you define a select statement on a given table
  • Define a new Routing Service where you define the request parameter, being the selectInputParameters-tag which is provided in the xsd that was generated for your DB Adapter and the reply parameter of the Routing Service is the collection returned by this same xsd.
  • Publish the ESB Service to your ESB Server

Now you can test this ESB Service to see that the resultset of the database adapter is returned by your routing service.

The next step is to define a UI where we can call this ESB Service, the steps you need to perform:

  • Create a new project and define a new JSF-page in this project
  • Create a Web Service Data Control ‘which can be found in the ‘Business Tier’ categorie of the ‘new gallery’
  • In step 1 you need to define a meaningfull name for the web service and in the URL you need to copy/paste the ‘Concrete WSDL URL’ of your routing service which is available through the ESB Control’. Then click browse to get the methods/operations available in the ESB Service and click next
  • In step 2 you need to choose the operation ‘execute’ and add it to the ‘selected’ area, click next
  • Click finish

Now you’re almost there, you’ve defined the web service data control which let’s you bind your UI to your ESB Service. The last thing you need to do now is to create a jsf-page and drag and drop your object inside the jsf-page:

  • Create a JSF-page
  • Drag-and-drop a PanelPage component inside the JSF page to have a nice lay-out
  • Go to the Control Palette and choose the ‘employees’-collection, your resulting objects of the db adapter, and drag-and-drop it into your jsf page.
  • Choose a table-component to have a nice view of your data

And now it’s show time … run the page in your embedded container and have a look at how esb services can be seamlessly integrated into your UI.

About these ads

4 thoughts on “Invoke an ESB Service in your User Interface and display the response of this service

  1. Hi,I tried with your example and it helps out to fix call an esb from jsf page. I would like to know more on this information. Actually i have created an esb which has a filter select and update based on the filter it will route to the corresponding operations. I thought of creating a page which has 2 radio button namely select and update, then a name field, designation field and a submit button.Once the user enter the name that he wants to see the designation for that user, he will enter the name and select the radio button for select and press submit button.This will get the designation of that name and display in the designation field.If the user want to update the designation of the user, provide the name and change the designation value and select update radio button and click submit. This will update the record for the name provided.How do i create a UI for this, shall i create it jus like we create for any web application or not. Reply.Please.Thanks.Regards,Vijay.B

  2. You could create the page as you are explaining, use two radio buttons and depending on the choice of the end-user invoke thr wright operation on the esb using a backing bean and adf faces.

  3. Hi,I keep coming across your interesting and relevant blog articles in my Google searches, about my current issues with Oracle ESB services.I’ve done exactly what you’ve done here within the ESB (10.1.3.3). I’ve then tried consuming the resulting service using both Flex 2 and SoapUI. Neither of them tolerate the WSDL of the ESB service and seem to think it’s somehow invalid. Any ideas or suggestions would be greatly appreciated.Regards,Greg

  4. Hi Greg,Sorry I never answered your post regarding invoking an esb endpoint through soapui or flex.We’re experiencing the same problem, namely invoking an esb endpoint using soapui? Did you get any answers to that problem?Kind regards,Nathalie

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s