Ipedo Ipedo Blogs
My Photo

« June 2006 | Main | December 2006 »

From ER Modeling to XML Web Services Using Ipedo XIP

A guest post from Jamie Wang on ER modeling and Web Services. Jamie is Ipedo's Director of Engineering. -S.P.

One thing we hear more and more about from customers is wanting to service-enable existing relational databases.  With Ipedo XIP, it’s quite easy to do.  You can even use existing data models from ER modeling tools to speed things up.   Let me walk you through the process.

In the XIP 4.2 release, exposing relational data through Web Services was made even easier, now requiring just a few clicks. For this entry, I will use the same HR model used in Peter’s last installment “Reusing Ipedo Views in Modeling Tools”. I will first explain how to use graphical modeling tool as an aid to understand complex relationships among relational data and I will then demonstrate how to quickly build Web Services to deliver data to the user community using Ipedo XIP.

Understanding ER Diagrams and Data Relationships

Hr_without_view

The diagram above shows a main entity Employee and other entities that have direct or indirect relationships to the Employee. The relationships are represented by the edges connecting entities. For example, looking at the diagram you can understand that some of Employee’s attributes, such as employee name and hire date is described in the Employee entity. Other attributes, such as department and location, are described in other entities - Departments and Locations respectively. Moreover, looking at attributes under each entity closely, one can gain another level of understanding of the relationships how Department is related to Employee and Countries (attribute relationships, defined primary and foreign keys, and constraints etc.).

Identify and Build Aggregated Information View

Now, with better understanding of various relationships in the diagram, we can methodically identify and build aggregated information for a specific subject. The employee detail view in the diagram below shows all information you need to know about an employee and is presented in a single entity (or an aggregated view of many related entities).

Hr_with_view

Publishing Ipedo View as Web Services

There are a number of ways you can build views easily in Ipedo. For example, you can map existing relational views as a remote table in Ipedo, or use the Ipedo View Builder to combine views, remote tables and XML tables to create additional views. You can even write your own SQL DDL statement to create views in Ipedo. Here, I will show you how to map an existing view already built in a remote database and publish it as a Web Service.

To create a view combining disparate remote databases in Ipedo, you’ll need to define one or more remote data sources first. This provides the necessary connection information and credential for accessing to the remote information.

Creating Data Source and Remote Table using Ipedo Administrator

Create_datasource

Right click on Data Source element in the navigation tree in the Administrator and choose New Data Source. Entering appropriate information in the New Data Source wizard and create a HUMANRESOURCE data source as show in the picture above.

Next use remote table wizard to map a relational view as Ipedo remote table EMP_DETAILS_VIEW. Right click on Remote Tables element in the navigation tree. Choose New Remote Tables and following instructions of the Remote table wizard as shown below.

Remotetable

Create a Web Service Name

In the navigation tree, left click on Data Service and right click on Web Services to enter the Web Service name HRDataSvc as in the picture below.

Webservicename_2

Use Web Service Publishing Wizard to Publish EMP_DETAILS_VIEW

Right click on EMP_DETAILS_VIEW under remote tables and choose Publish. In the publishing wizard, select Web Service type and select HRDataSvc. Enter a name for the remote table you want to publish as Web Service. By default, the name of the remote table name is used in the name field. Enter a description if you want to. Click OK to save and the Web Service will be displayed under Data Services as shown in green.

Publishingwizard

That’s all it takes to publish relational data as Web Services. In fact, this process can be used to publish any constructs in the relational model whether it is a remote table as shown here or a XML table or a dimensional view.  If you have a lot of tables to combine and publish, everything you’ve seen here can be easily scripted.

In the next installment, I will show you different ways you can consume Web Services data using Ipedo.