| By Haleh Mahbod, Raymond Feng, Simon Laws | Article Rating: |
|
| November 9, 2007 08:30 AM EST | Reads: |
39,570 |
Based solely on this information Tuscany SCA makes three things available automatically;
• The Catalog JSONRPC service
• The JSONRPC service description (SMD)
• A generated JavaScript JSONRPC proxy for accessing this service
A browser-based application can access this service directly using either the generated JSONRPC proxy or whatever JSONRPC client the application developer is familiar with, for example, the store sample uses the following JavaScript to access the Catalog service:
catalog = (new JSONRpcClient("../Catalog")).Catalog;
catalog.get(catalog_getResponse);
Clearly this pattern can be extended to any service your Web 2.0 style application is required to communicate with. The full range of SCA features is then available to these services. For example, our Catalog service could easily be exposed as a Web service (binding.ws) by extending the SCA configuration description of the service.
...
<service name="Catalog">
<t:binding.jsonrpc/>
<binding.ws/>
</service>
...
Note that no changes to the Catalog component code are required. The Tuscany SCA runtime is doing all the hard work.
SCA has provided services to the Web 2.0 application with very little effort on behalf of the developer. What effort is expended is not particular to supporting Web 2.0 applications as the services are now part of the wider enterprise service orientation approach.
Tuscany SCA supports other modes of operation that will be of interest to Web 2.0 application developers. For example, the Tuscany Java SCA Chat sample [9] uses binding.dwr to implement a Direct Web Remoting [10] connection between a JavaScript browser-based application and an SCA service. Using this binding, service-to-browser communication is supported alongside browser to service communication (see Figure 3).
Data Integration
In a typical enterprise, business data comes from many different sources and is presented in many different formats. Tuscany SCA provides a databinding framework that seamlessly handles data format mapping and therefore frees the developers from such concerns.
Let's look at a simple scenario that deals with aggregation of XML data from different sources. This demo will be available in a future release of Tuscany. The business function here calculates the total value of all the accounts (checking, savings and stock) that a customer owns (see Figure 4).
In this scenario, data is received from various data sources and manipulated as XML. The following data exchanges are occurring.
- Use an RSS feed to retrieve currency exchange rates from the Web.
- Load the account data for a customer from an XML file or database.
- Invoke a live Web service to get quotes for a list of symbols.
- Calculate the total value by joining the XML data from 2 and 3.
The handling of different data formats in the enterprise can be complex. For example, business data may be represented in many different ways, even if they are for the same infoset. A Customer business object can be defined as JavaBean, SDO, JAXB, XMLBeans, or DOM. At the same time, protocol implementation stacks require different data representations. For example, in the Web service domain, Axis1 uses DOM, Axis2 uses AXIOM, and JAX-WS uses JAXB. Implementation technologies may also impose requirements on the data as well; for example, the Apache ODE BPEL engine consumes/produces data using DOM and the SAXON XQuery engine consumes/produces data using NodeInfo.
Application developers should have the freedom to choose their preferred data representation without being restricted by the above concerns and worrying about the mappings. Tuscany SCA automatically handles this for them. Tuscany provides the most popular databindings including SDO, JAXB, XMLBeans, AXIOM, JSON, DOM, SAX, and StAX. There are more than 50 transformers to convert data between the databindings. With the transformer graph, Tuscany SCA supports point-to-point transformations as well as multiple-hop transformations. This approach greatly reduces the number of transformers required and makes it possible to transform data without direct transformation logic.
In the sample, the exchange rate is retrieved (step 1) using the feed binding (binding.rss) as follows.
<reference name="exchangeRate">
<tuscany:binding.rss
uri="http://ansuz.sooke.bc.ca/rippy/exchange/?M=R&B=USD&F=CAD,CNY,EUR&T=F&S=O&I=S" />
</reference>
Step 3 uses the Web service binding (binding.ws) to retrieve stock from the Internet.
<reference name="StockQuoteReference" promote="AccountService/stockQuote">
<binding.ws wsdlElement="http://swanandmokashi.com#wsdl.port(StockQuotes/StockQuotesSoap)" />
</reference>
The Java interface is interesting. The example uses StAX to streamline XML data exchange over Web services. The Tuscany SCA databinding framework allows component developers to choose their preferred XML Java databinding technology such as JAXB, SDO, DOM, or StAX no matter how the SOAP message is represented in the Web services stack (AXIOM is used by Axis2).
@Remotable
public interface StockQuote {
public XMLStreamReader GetStockQuotes(XMLStreamReader input);
}
The various XML data are joined together using XQuery (implementation.xquery) in step 4. With the help of the databinding framework, XQuery mediates data from many services. The capability of XQuery can be extended by invoking other SCA components.
@Remotable
public interface StockValue {
double calculate(XMLStreamReader quotes, XMLStreamReader accounts);
}
Published November 9, 2007 Reads 39,570
Copyright © 2007 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Haleh Mahbod
Haleh Mahbod is a program director with IBM, managing the team contributing to the Apache Tuscany as well as SOA for PHP open source. She has extensive development experience with database technologies and integration servers.
More Stories By Raymond Feng
Raymond Feng is a senior software engineer with IBM. He is now working on the Service Component Architecture (SCA) runtime implementation in Apache Tuscany project as a committer. Raymond has been developing SOA for more than 4 years and he was a key developer and team lead for WebSphere Process Server products since 2002.
More Stories By Simon Laws
Simon Laws is a member of the IBM Open Source SOA project team working with the open source Apache and PHP communities to build Java, C++, and PHP implementations of the Service Component Architecture (SCA) and Service Data Object (SDO) specifications. Prior to this role he was working in the distributed computing space building service-oriented solutions for customers with a particular interest in grid computing and virtualization.
![]() |
anonymous 03/12/08 06:13:08 PM EDT | |||
SCA sounds a lot like CORBA.. |
||||
![]() |
anonymous 11/11/07 09:28:46 PM EST | |||
SCA = CORBA |
||||
- Kindle 2 vs Nook
- Why IBM’s Server Chief Got Busted
- Is Cloud Computing Like Teenage Sex?
- Industry Experts Discuss the State of Cloud Computing
- Performance Tuning Essentials for Java
- Confessions of a Ulitzer Addict
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- It's the Java vs. C++ Shootout Revisited!
- Cloud Computing Can Revitalize Your Career as Software Developer
- IBM Could "Reinvent" Java: Mills
- Oracle & Cloud Computing: Exclusive Q&A with SVP Richard Sarwal
- A Brief History of Cloud Computing
- Kindle 2 vs Nook
- Cloud CEOs, CTOs & SVPs to Speak at 4th International Cloud Computing Expo
- Why IBM’s Server Chief Got Busted
- Is Cloud Computing Like Teenage Sex?
- Industry Experts Discuss the State of Cloud Computing
- Performance Tuning Essentials for Java
- The Difference Between Web Hosting and Cloud Computing
- Cloud Computing Expo: Exclusive Q&A with Yahoo! SVP Cloud Computing
- Ajax in RichFaces 3.3, JSF 2 and RichFaces 4
- Confessions of a Ulitzer Addict
- My Thoughts on Ulitzer
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- A Cup of AJAX? Nay, Just Regular Java Please
- Java Developer's Journal Exclusive: 2006 "JDJ Editors' Choice" Awards
- The i-Technology Right Stuff
- JavaServer Faces (JSF) vs Struts
- Rich Internet Applications with Adobe Flex 2 and Java
- Java vs C++ "Shootout" Revisited
- Bean-Managed Persistence Using a Proxy List
- Reporting Made Easy with JasperReports and Hibernate
- Creating a Pet Store Application with JavaServer Faces, Spring, and Hibernate
- What's New in Eclipse?
- Why Do 'Cool Kids' Choose Ruby or PHP to Build Websites Instead of Java?
- i-Technology Predictions for 2007: Where's It All Headed?




































