.NET WCF services and Java Web Services Interoperability - Part 1 of 3

.NET WCF services and Java Web Services Interoperability - Part 1 of 3

Recently I was involved in a discussion around the concept of interoperability with WCF services. Half of our I.T. shop develops in the Java world and the other half in.NET, so as we were designing our next WCF service we asked ourselves the question, " Will this service ever need to be consumed by a Java client?" The answer to that question would make a difference in our design approach since we were told by our consultants friends that if we were to use custom data types in.NET, we were foregoing the opportunity for our Java teams from ever utilizing the service. We decided not worry about interoperability drawbacks and go ahead and design the service with custom.NET data types, generic lists, enums, etc.

This article is designed to show you how you CAN actually have pretty solid interoperability between JWS and WCF using custom data types, generic lists, and enums both ways; a JWS service consumed by a.NET client as well as a WCF service consumed by a Java client. We'll break it down into three postings:

  1. An overview of our design approach
  2. Create the WCF service consumed by a Java client
  3. Create the Java Web Service consumed by a.NET client

Both the WCF and the JWS services will have the same class structure. Below you will find a class diagram that demonstrates the class layout:

Team.jpg

The services will return a list of "Teams" that contain some basic information for each including:

  • Team Name
  • Team Type
  • This will be an enumeration value of either "Soccer" or "Football"
  • Players
  • This will be a generic list of "Player"(s) that contain a Name and Age

As you will see the code for both platforms is very similar and there are only a couple of caveats to getting the solutions to work "out of the box", which we will discuss later.

For the Java development, we will be using NetBeans IDE version 6.8 and for the.NET development, we will be using Visual Studio 2008.

_This article is the first in a three part series demonstrating the interoperability between.NET WCF services and Java Web Services.

Article Series:_

  • Part II - Create the WCF service consumed by a Java client
  • Part III - Create the Java Web Service consumed by a.NET client

posted on Monday, December 28, 2009 3:25 PM Print

This article is part of the GWB Archives. Original Author: Michael Ballhaus

New on Geeks with Blogs

  • We Won The One Award I Actually Care About

    Full Scale made the Inc. 5000 for the fifth year straight, the 12th listing across my three companies. Here is why the one award you cannot buy is worth stopping for.

  • Your Customers Build the Features Now

    I let a tool I liked sit dead for a year rather than build the features I wanted. An MCP server meant I never had to, and your customers can do the same to your product.

  • Get the Size of a Directory in Linux the Easy Way

    du -sh for the quick answer, ncdu for the cleanup, df for the disk itself: every command for checking directory size in Linux, plus why du and df never agree.

  • Vim Search and Replace: The Ultimate Guide

    One :%s command replaces every match in a file before a find dialog would even open. The Vim substitute patterns worth the muscle memory: flags, ranges, capture groups, and multi-file edits.