XML.com: XML From the Inside Out
oreilly.comSafari Bookshelf.Conferences.

advertisement

Data Sources as Web Services

October 25, 2007

WSO2 (WS OH 2) is growing in popularity and the team continues to produce quality products. The WSO2 (a.k.a. Web Services Oxygen Tank) team that has pulled together a platform around Apache SOA projects, producing an application server, ESB, Web 2.0 mashup engine, and more. Most recently, they have released Version 2.1 of the Web Services Application Server (WSAS). The release includes a lot of compelling features, but this article focuses upon WSO2 Data Services.

This article introduces WSO2 Data Services, a new feature available in WSO2's WSAS 2.0 platform (the latest release is version 2.1). I will begin by introducing Data Services, examining their architecture and utilization, and then exploring pros and cons of this convenient feature.

Introducing Data Services

Once you move past novelty web services that echo a string you sent or perform some sort of trivial mathematical computation (e.g., MySquareRootService or CalculatorService), services are either facilitating the insertion or retrieval of data. Whether you want to retrieve customer and product data via a service request or you want to be able to expose supply chain operations to key business partners, folding your data access layer into your SOA architecture is key. WSO2 Data Services provide a convenient and well-engineered mechanism for service orienting your data.

In Figure 1, a conceptual WSO2 enterprise deployment is illustrated. Data services are standard web services that have been configured within WSAS to map to data source calls to one or more backend data sources. Configuration is captured in XML and can either be performed by hand and uploaded as a complete deployment module, or deployed via the web-based Data Service configuration wizard. Once deployed, these services can either be consumed by other WSAS services or be made available to external* clients.

Figure 1
Figure 1

*Exposing select services outside the firewall (as depicted in Figure 1) is not a feature that is explicitly supported by WSAS. It is, however, representative of industry best practices for SOA and is supported by a variety of implementation solutions (proxy server, selective firewall configuration, SOA networking appliance, etc.).

With the recent production release of WSAS 2.1, the following data sources are supported:

  • Relational databases (including support for calling stored procedures)
  • CSV data sources (both local and remote files via HTTP)
  • Excel data sources (both local and remote files via HTTP)
  • JNDI data sources

When configuring a WSO2 data service, you'll need data source connection info (varies depending upon the source type). Then you specify the queries, input/output mappings (map XML element names to column names), and finally map each query to a service operation. Once deployed, these services can then be configured like any other service with various security requirements, policies, and AXIS runtime processing handlers.

Data Services Architecture and Utilization

Data Services are essentially the SOA-equivalent of the Data Access Object pattern. Granted, Data Services are at a much higher level of abstraction, but they serve a similar role in a layered architecture. They enable higher level services or even client applications to access underlying datasets without regard for the implementation details involved. Consider the SOA reference architecture depicted in Figure 2. Data services function in a similar fashion to standard Web services. The key difference is that they provide more direct access to underlying data (albeit with operation-to-query mapping and element-to-column mapping) rather than accessing data indirectly via applications and business objects (EJBs, POJOs, etc.).

Figure 2
Figure 2

To explore WSO2 Data Services for yourself, a number of resources are available, including:

If you should decide to make WSO2 Data Services an option for SOA solutions, governance will be important. The simplicity of Data Services can potentially lead to ill-conceived utilization of this convenient capability. It's funny, but it almost makes it too easy to expose data as services. Consequently, developers may be tempted to generate one or more services based off of existing data sources as a quick fix, rather than designing the solution appropriately and developing the architectural layers that are really needed to ensure a robust and reusable solution. In a similar vein, creation of Data Services may promote more of a bottom-up approach to service orientation. This is not an inherently bad thing, but often a top-down strategy will yield a better alignment with long-term business goals. If it is too easy to expose existing data sets as services, developers are not forced to critically analyze the requirements and evaluate whether or not the current data sets really address the problem at hand. All of this points to a need for stronger governance regarding how and under what circumstances this particular capability can be acceptable leveraged.

Advantages of WSO2 Data Services

WSO2 Data Services offer some significant benefits to enterprises that are interested in service orientation, including the following:

  • Convenient service orientation of existing data sources such as RDBMS, CVS, Excel, and JNDI data sources
  • Ability to service orient RDBMS stored procedures
  • Configurable Data Service Layer including service operation mapping and element name mapping
  • Apply role-based security to data access, including digital signatures, encryption, and various security tokens
  • Apply WS-policy assertions to data access services
  • Selectively expose underlying datasets through queries and XML mapping
  • Great for proof-of-concept SOA projects to quickly expose data via simple Web services

WSO2 Data Services clearly have a lot going for them. They provide a convenient way to quickly service orient data, but still allow for enterprise-grade configuration and architectural decisions to be made.

Disadvantages of WSO2 Data Services

WSO2 Data Services also have some drawbacks that need to be considered, including the following:

  • Exposing data tables as services is easy, but does not really promote the architecture aspect of SOA
  • Creation of data services may promote a bottom-up service orientation approach, when a top-down strategy might yield better results
  • Data service queries cannot span multiple data sources (each service is tied to one data source)

The great irony of WSO2 Data Services is that their very strength (quick, convenient exposure of enterprise data) is also their biggest weakness. In some respects, it is too easy to expose these services. Moreover, although it is possible to incorporate this into a well-planned architecture, the simplicity may lead some to just deploy these services and consider it good enough without really thinking through the architectural implications. The take away here is to ensure that strong governance is in play to guide the utilization of the powerful and simple and feature.

Service-Oriented Data Access

The heart of any enterprise application is data. Applications provide the ability to view, sort, filter, edit, create, and delete data. In a SOA, access to data is also paramount. Typically this involves wrapping an existing business object (EJB or POJO) with a web service. Another option is to bypass this additional layer and directly expose data capabilities via WSO2 Data Services. Data services are convenient, configurable, and great for service oriented data for a demo or even as a part of a SOA. When you get the chance, swing by WSO2 and take WSAS 2.X and Data Services for a spin.



1 to 35 of 35
  1. NIce Post
    2010-07-29 00:22:30 aina123
    • NIce Post
      2010-09-05 15:49:40 businessstart
    • XML
      2010-08-18 09:38:01 Gee27
    • NIce Post
      2010-08-16 00:50:34 aasiwal
  2. NIce Post
    2010-07-29 00:22:11 aina123

  3. 2010-07-27 00:11:10 sswfnhtu

  4. 2010-07-23 00:55:59 Utbcs
  5. Nice and amazing post
    2010-07-18 06:28:04 triathlon bike

  6. 2010-07-11 22:49:53 christina112

    • 2010-07-14 08:08:01 vedavyas

  7. 2010-07-09 23:40:07 aina123

    • 2010-07-11 10:04:30 free wow accounts

  8. 2010-07-07 01:10:20 kinner123

    • 2010-07-09 23:34:46 aina123

    • 2010-07-07 01:30:22 Cartier Jewelry

  9. 2010-07-02 17:46:17 shinsweera
    • yes
      2010-08-20 07:21:04 Jason111

  10. 2010-07-02 17:45:48 shinsweera
  11. Good job
    2010-07-02 02:35:01 construction games

  12. 2010-07-01 03:13:26 shinsweera

  13. 2010-07-01 03:13:13 shinsweera

  14. 2010-06-30 07:12:59 shinsweera

  15. 2010-06-30 07:12:27 shinsweera

  16. 2010-06-29 20:09:30 Master Cleanse
  17. Good job
    2010-06-29 19:11:51 construction games
  18. nice work
    2010-06-20 07:56:46 devus
  19. data
    2010-06-16 11:45:26 fanindy

  20. 2010-06-15 02:29:34 jirban
  21. wedding dresser for sale
    2010-06-10 19:59:09 weEdding
  22. beneficial
    2010-06-08 05:10:03 devus

  23. 2010-05-29 19:21:42 chris251984

  24. 2010-05-28 04:09:03 AshRo
  25. Thanks
    2010-05-28 04:05:17 AshRo

  26. 2010-05-27 18:54:26 RB22
  27. Vinfotech
    2010-05-23 23:11:05 Vinfotech
  28. Carpet Cleaners Rugs Cleaning Upholstery Cleaning West Los Angeles 1-310-925-1720
    2009-06-11 15:04:10 whats
  29. WSO2 Data Services 1.0
    2008-09-26 19:37:24 sumedha rubasinghe
  30. online marketing advertising and directory submit. Website Marketing Services
    2008-07-13 12:14:39 0
  31. WSO2 Data Services bags Gold Award!
    2008-04-08 07:58:06 afkham@gmail.com
  32. New Data Services Release - 2.2
    2008-01-24 22:33:56 afkham@gmail.com

  33. 2008-01-24 22:33:37 afkham@gmail.com
    • wty
      2010-07-21 00:44:20 cosplay
  34. Great to have WSO2 joining in on data services
    2007-12-05 06:53:50 billxa
    • Agree
      2010-07-26 10:03:41 carpet cleaner monterey
  35. Pros and cons of data sources webservices
    2007-11-08 04:12:54 ggiunta
1 to 35 of 35