You are on page 1of 42

Interoperability Between Java™

Technology and .NET: More


Than Just Web Services
Kevin Wittkopf
Solutions Architect
Microsoft
http://www.microsoft.com
Wayne Citrin
CTO
JNBridge
http://www.jnbridge.com
Session TS-3367
2005 JavaOneSM Conference | Session TS-3367 1
Java™ Technology
and .NET Interoperability
Techniques and Tools

Interoperability between Java Technology


and the .NET Framework when Web
Services aren’t an option

2005 JavaOneSM Conference | Session TS-3367 | 2


Agenda

What Does ‘Interoperability’ Mean


for This Session
Common Interoperability Scenarios
Interoperable Data
Point to Point Interoperability
Demo
Resource Tier Interoperability
Wrapup, Q&A
2005 JavaOneSM Conference | Session TS-3367 | 3
Agenda

What Does ‘Interoperability’ Mean


for This Session
Common Interoperability Scenarios
Interoperable Data
Point to Point Interoperability
Demo
Resource Tier Interoperability
Wrapup, Q&A
2005 JavaOneSM Conference | Session TS-3367 | 4
What Does
‘Interoperability’ Mean for This Session
• Communication between Java™ platform and .NET
based processes, either directly or indirectly
• Invocation of action over the wire
• Protocol + wire level format
• Think RMI, or Java™ Message Service (JMS) API
• Focus is on .NET clients and Java™ 2, Standard Edition,
J2SE™ server (common scenario)
• Not Web Services-based interoperability
• NOT interoperable code, e.g.,
• Compiling or translating Java source or binary to run on CLR
• Compiling or translating .NET source or binary to run on Java™
Virtual Environment, JVM platform
• NOT migration of Java source or binary to .NET/MSIL
2005 JavaOneSM Conference | Session TS-3367 | 5
Why Not Web Services?

• Interoperability—isn’t that what Web Services


are supposed to solve?
• Web Services can be used in many cases,
but they have limitations:
• Slow performance
• Lack of fine-grained interaction capability
• Poor cross-platform exception handling
• No support for callbacks
• Where Web Services fall short, class-level
interoperability solutions excel

2005 JavaOneSM Conference | Session TS-3367 | 6


Agenda

What Does ‘Interoperability’ Mean


for This Session
Common Interoperability Scenarios
Interoperable Data
Point to Point Interoperability
Demo
Resource Tier Interoperability
Wrapup, Q&A
2005 JavaOneSM Conference | Session TS-3367 | 7
2005 JavaOneSM Conference | Session TS-3367 | 8
2005 JavaOneSM Conference | Session TS-3367 | 9
2005 JavaOneSM Conference | Session TS-3367 | 10
2005 JavaOneSM Conference | Session TS-3367 | 11
Agenda

What Does ‘Interoperability’ Mean


for This Session
Common Interoperability Scenarios
Interoperable Data
Point to Point Interoperability
Demo
Resource Tier Interoperability
Wrapup, Q&A
2005 JavaOneSM Conference | Session TS-3367 | 12
2005 JavaOneSM Conference | Session TS-3367 | 13
Interoperable Data
Interoperability challenges
• Data types exist on one platform, but not on the other
• java.sql.ResultSet in Java
• System.Data.DataSet in .NET
• Similar functionality, different data
• Also, does a String on one == a String on the other?
• In general, accurate and reliable data exchange is
the number one challenge to building interoperable
solutions
• It’s all about Serialization
• Taking a data type on one platform and converting it such
that it can be transported to, and understood by the other

2005 JavaOneSM Conference | Session TS-3367 | 14


2005 JavaOneSM Conference | Session TS-3367 | 15
2005 JavaOneSM Conference | Session TS-3367 | 16
2005 JavaOneSM Conference | Session TS-3367 | 17
Interoperable Data
Mitigating risks of data interoperability
• Data first, then code
• Avoid merging schemas
• Use a static canonical schema
• Keep to XSD types
• Build and maintain unit tests
• Architect a central repository
• Uniform Naming Convention
• Consider repository for data types
within Organization

2005 JavaOneSM Conference | Session TS-3367 | 18


Agenda

What Does ‘Interoperability’ Mean


for This Session
Common Interoperability Scenarios
Interoperable Data
Point to Point Interoperability
Demo
Resource Tier Interoperability
Wrapup, Q&A
2005 JavaOneSM Conference | Session TS-3367 | 19
Interoperability Technologies
Types of interoperability
• Point to Point
• Direct, between two points
• Calls tend to be synchronous
• Arbitrated
• Indirect, involving one or more intermediate servers
or hubs (e.g., message-based, etc.)
• Calls tend to be asynchronous
• Resource Tier
• Shared access to resource (e.g., DB, Message store,
etc.) from heterogeneous clients
• Interop used to facilitate notification of resource
events (e.g., data updates) across clients
2005 JavaOneSM Conference | Session TS-3367 | 20
Point to Point Interoperability

• XML Web Services


• RMI/IIOP CORBA Channel
• .NET Remoting

2005 JavaOneSM Conference | Session TS-3367 | 21


Point to Point Interoperability
RMI/IIOP channel to CORBA
• OMG Specification
• .NET client proxy implementations
• Borland Janeva (http://www.borland.com)
• Remoting.Corba (http://remoting-corba.sourceforge.net)
• IIOP.NET (http://iiop-net.sourceforge.net)
• Interoperability Benefits
• Binary communication over TCP (Performance)
• No modifications required on the server (Simplicity)
• Good for .NET client -> Java server applications

2005 JavaOneSM Conference | Session TS-3367 | 22


Point to Point Interoperability
.NET remoting
• Similar to Remote Method Invocation (RMI)
• Remote object access via proxies
• Binary, SOAP, or custom serialization
• TCP, HTTP, or custom protocol
• Synchronous/Asynchronous
• Pass by reference
• Events and delegates

2005 JavaOneSM Conference | Session TS-3367 | 23


Point to Point Interoperability
.NET remoting
• Microsoft Specification (available to license)
• Third party implementations for Java 1.2+
• JNBridge Pro/ProEE (http://www.jnbridge.com)
• Intrinsyc J-Integra/Ja.NET (http://www.intrinsyc.com)
• Competitor or complimentary to Web Services?
• Interoperability Benefits
• Binary communication over TCP (Performance)
• Inter-process communication (Simplicity)
• Pass by reference (Flexibility)
• Windows Server 2003 Component Services support
• (via SOAP Activation)
2005 JavaOneSM Conference | Session TS-3367 | 24
Point to Point Interoperability
.NET remoting
.NET Platform Java Virtual Machine

C#,
C#, J#,
J#, C++,
C++, VB,
VB, etc.
etc. Java
Java Classes
Classes

Communications
.NET-Side .NET- via Shared Java-Side Runtime
Proxies Side Memory,
Runtime TCP/Binary or
HTTP/SOAP

Run Time

Generates Development Time This illustrates .NET


accessing Java.
Proxy The architecture for Java
Generation Tool accessing .NET is similar

2005 JavaOneSM Conference | Session TS-3367 | 25


DEMO
.NET Client to J2EE Server
.NET Remoting-based Bridging Using
JNBridge

2005 JavaOneSM Conference | Session TS-3367 | 26


Agenda

What Does ‘Interoperability’ Mean


for This Session
Common Interoperability Scenarios
Interoperable Data
Point to Point Interoperability
Demo
Resource Tier Interoperability
Wrapup, Q&A
2005 JavaOneSM Conference | Session TS-3367 | 27
Resource Tier Interoperability

• Arbitrated, mostly asynchronous, between two


or more points
• Can utilize point to point technology for connectivity
• For .NET and J2EE Interoperability
• Shared database
• Message queue
• Broker

2005 JavaOneSM Conference | Session TS-3367 | 28


2005 JavaOneSM Conference | Session TS-3367 | 29
Resource Tier Interoperability
Shared database
• Enabled by use of Open Access
Database Drivers
• Oracle OCI Driver for ADO.NET
• SQL Server 2000 Driver for JDBC
• Many vendor and Third Party Implementations
• Interoperability Benefits
• Easiest way to achieve interoperability
using resources
• Universally recognized way to store data
• Stored Procedures allow logic to be written once

2005 JavaOneSM Conference | Session TS-3367 | 30


2005 JavaOneSM Conference | Session TS-3367 | 31
2005 JavaOneSM Conference | Session TS-3367 | 32
Resource Tier Interoperability
Shared message queue
• Vendor-rich Selection
• MSMQ 3.0 (HTTP SRMP endpoint)
• IBM WebSphere MQ (.NET Adapter available via SupportPac)
• J2EE Application Server Vendor via JMS API
• .NET Remoting/RMI Bridging with JMS client
• Fiorano, Silverstream, Sonic, Tibco, etc.
• Interoperability Benefits
• Ideal for N-N Interoperability Scenarios
• Transaction Support
• Reliable Messaging Support
• Publish/Subscribe

2005 JavaOneSM Conference | Session TS-3367 | 33


2005 JavaOneSM Conference | Session TS-3367 | 34
Resource Tier Interoperability
Broker
• Technologies
• Microsoft BizTalk Server 2004
• Interoperability Benefits
• Ideal for N-N Interoperability Scenarios
• Transaction Support
• Multiple Adapter Support
• Connection to legacy and disparate systems
• Message Transformations
• Orchestration

2005 JavaOneSM Conference | Session TS-3367 | 35


Summary
• There are a number of Java and .NET interoperability
scenarios that may need to be supported
• Web Services may not be possible or optimal
• Design and testing for interoperable data is critical
and should be done up front
• Point to point interoperability using .NET Remoting-based
bridging allows for binary, RPC-style interoperability
between the two platforms
• Interoperability can also be achieved through shared
resources such as databases and message hubs,
and can be augmented with point to point approaches
to implement notifications and synchronization
2005 JavaOneSM Conference | Session TS-3367 | 36
For More Information
• Web Services Interoperability Sessions:
• TS-3552—“JavaTM Technology and .NET interoperability
using WS-* Web Services Architecture”
• TS-9866—“Advanced Web Services Interoperability”
• Interoperability Resources:
• http://msdn.microsoft.com/vstudio/java/interop/default.aspx
• http://msdn.microsoft.com/java
• http://www.microsoft.com/windowsserversystem/jplusn

2005 JavaOneSM Conference | Session TS-3367 | 37


For More Information
Available today!

Developer focused:
• Fundamentals
• Point to Point
• Asynchronous
• Advanced Interoperability

Amazon.com:
http://www.amazon.com/exec/obidos/
ASIN/0735619220/qid=1058741448

2005 JavaOneSM Conference | Session TS-3367 | 38


For More Information
Available today!
• Builds on concepts of the toolkit
• Shows ‘XBikes’ reference application
between .NET and IBM WebSphere

URL:
http://www.microsoft.com/practices

2005 JavaOneSM Conference | Session TS-3367 | 39


Q&A
Kevin Wittkopf—Solutions Architect,
Microsoft
Wayne Citrin—CTO, JNBridge

2005 JavaOneSM Conference | Session TS-3367 | 40


Submit Session
Evaluations for Prizes!
Your opinions are important to Sun
• You can win a $75.00 gift certificate to the on-site
Retail Store by telling Sun what you think!
• Turn in completed forms to enter the daily drawing
• Each evaluation must be turned in the same day as
the session presentation
• Five winners will be chosen each day (Sun will send
the winners e-mail)
• Drop-off locations: give to the room monitors or use any
of the three drop-off stations in the North and South Halls
Note: Winners on Thursday, 6/30, will receive and can redeem
certificates via e-mail.
2005 JavaOneSM Conference | Session TS-3367 | 41
Interoperability Between Java™
Technology and .NET: More
Than Just Web Services
Kevin Wittkopf
Solutions Architect
Microsoft
http://www.microsoft.com
Wayne Citrin
CTO
JNBridge
http://www.jnbridge.com
Session TS-3367
2005 JavaOneSM Conference | Session TS-3367 42