Plug Into J2EE-.NET Interoperability (Continued)
The Interoperability Technologies
Almost all interoperability technologies are based on either IIOP or SOAP. In addition, each solution can be placed into one of two categories: open and proprietary. Open technologies are created by consortiums such as OASIS or by standards bodies such as the W3C. Proprietary technologies are created by software companies such as Borland with the intent of selling them as a commercial product.
Open Technologies Such as Web Services
One of the open technologies is Web services. Web services are built on SOAP and define the use of other related specifications such as Web Services Description Language (WSDL), Universal Description Discovery and Integration (UDDI), and WS-Security. Web services support is built into Microsoft .NET. Sun has also expanded the J2EE platform to support Web services. So using Web services to interoperate between Microsoft .NET and J2EE becomes a no-brainer, for example:
Call .NET Web Services From J2EE
- Step 1: Define XML Schemas that describe the request and response SOAP message contents.
- Step 2: Use the xsd.exe tool that ships with Microsoft .NET to create .NET classes from the XML Schemas.
- Step 3: Create the .NET Web services that use the classes you created in Step 2.
- Step 4: On the J2EE side, use a tool that reads the WSDL of the Web service to create Java stubs that will call the Web service. I typically use Apache Axis, which is an open source SOAP implementation and Web service platform in Java. Apache Axis has a useful tool called wsdl2java that converts the WSDL into Java stub classes.
- Step 5: Create your Java classes that call the stubs generated in Step 4.
If you're consuming existing .NET Web Services, simply start from Step 4.
As I mentioned, software companies create proprietary technologies with the intent of selling them as commercial products. An example of a recent technology that generated news waves is Borland Janeva. Janeva allows developers to invoke J2EE and CORBA objects/services from .NET clients. To do so, the developer uses a Janeva compiler to create .NET stubs from the Java or CORBA Interface Definition Language (IDL) interfaces. The .NET developer uses these stubs to invoke the J2EE/CORBA services. Internally these stubs use IIOP to communicate with the J2EE/CORBA side.
Using IIOP gives Janeva some advantages over Web services (which use SOAP):
- As mentioned earlier, IIOP is a binary protocol and in most cases will outperform communications that use SOAP.
- SOAP (and Web services) is mostly used over HTTP, which is a connectionless protocol. IIOP is connection-oriented and allows a richer interaction model that uses stateful services and additional protocol-based services such as load balancing and fault tolerance.
There are a few limitations as well:
- Janeva is a proprietary product and therefore has all the limitations associated with a product that's tied to and dependent on a vendor.
- You can't use Janeva to call .NET services from J2EE and CORBA.
Whether your preferred platform is J2EE or .NET, you will be required to interact with software developed on both platforms. In this article, I presented an overview of the need, the standards, and the types of available technologies to achieve this interoperation with the least amount of pain and the highest degree of confidence that your solutions will continue to work as both J2EE and .NET mature and evolve.
About the Author
Tarak Modi is a senior specialist with North Highland, a management and technology consulting company. His professional experience includes working with COM, MTS, COM+, .NET, J2EE, and CORBA. He is a coauthor of Professional Java Web Services (Wrox Press, 2002). Visit his personal Web site at http://www.tekNirvana.com.
Back to top