Comments
Richard Davies wrote: The UK has a good crop of technology pioneers in cloud computing - for example ElasticHosts, FlexiScale, Flexiant, OnApp - and also some strong government initiatives such as G-Cloud. We will have to see whether this kind of technical leadership converts into swift mass-market adoption or not.
Cloud Computing
Conference & Expo
November 2-4, 2009 NYC
Register Today and SAVE !..
SYS-CON.TV
Today's Top SOA Links


EAServer 6.1 .NET Client Support
Enabling .NET to communicate with EAServer components using IIOP

The EAServer .NET client is one of the most important features in EAServer 6.1. This new feature enables .NET to communicate with EAServer components using IIOP. It provides underlying marshaling support for PowerBuilder's WinForm applications with EAServer and it's also a way to interoperate between .NET and J2EE distributed objects.

In this article, we'll introduce EAServer .NET client and illustrate how to invoke EJB in EAServer from ASP.NET and PowerBuilder WinForm application.

Note: The ${EAServer6.1} in this article refers to the EAServer 6.1 installed directory.

Overview of .NET Client
The EAServer 6.1 .NET client contains the following components:

•  NetCompiler - To generate C# stubs for existing components inside EAServer. You can invoke NetCompiler with the batch file, netcc.bat, located in ${EAServer6.1}\bin.

To generate stubs for EJB deployed at EAServer 6.1, use the following command:

${EAServer6.1}\bin\netcc.bat ejbjar-${ejb_package_name}

•  .NET Runtime Assemblies To provide runtime support for C# stubs to communicate with EAServer such as managing IIOP, SSL, compression, and so forth. The .NET runtime assemblies are located in the ${EAServer6.1}\lib directory. The two libraries of interest in the runtime assemblies are:
- com.sybase.iiop.net.dll - Provides basic runtime support such as marshaling, managing connection, SSL, compression, and so forth
- com.sybase.ejb.net.dll - Provides runtime support for invoking EJB using .NET

Preparing EJB for the C# Client
To begin with, we need to prepare an EJB for our sample. You can create the EJB using your favorite IDE. In this case, I created the EJB with Netbeans5.5. The EJB's remote interface has two methods:
•  String sayHello(String yourName) throws RemoteException
•  ResultSet getResultSet(String sql) throws RemoteException

The first method just concatenates yourName with the word "Hello." The second method uses the SQL statement provided to query the default connection cache of EAServer and sends back a java.sql.ResultSet of the query result to the client.

After obtaining the ejbjar, you need to deploy it to EAServer. You can deploy the ejbjar using EAServer's Web-based Management Console.

Generating the C# stubs with NetCompiler
The EJB package name is dotnetsample (the package name is lower case), which is the same as your ejbjar's filename without an extension. Now you're ready to execute the following using the NetCompiler to generate C# stubs:

${EAServer6.1}\bin>netcc.bat ejbjar-dotnetsample

NetCompiler generates both the C# stubs source files and the compiled assemblies. Normally, we don't have to worry about the C# source files since these *.cs files will be compiled and packed inside the output assembly as follows:

${EAServer6.1}\deploy\assemblies\dotnetsample.client.dll

There are two classes inside the assembly that we need to take note of:
•  com.sybase.net.sample.MyEJBRemote C# remote interface
•  com.sybase.net.sample.MyEJBRemoteHome C# remote home interface

The C# remote interface and remote home interface names are identical to Java. The interfaces are used for EJB remote stub and home stub.


About Guoping Zhang
Guoping Zhang is a developer with the EAServer team in Beijing. He is involved in developing the .NET client for EAServer 6.1.

In order to post a comment you need to be registered and logged in.

Register | Sign-in

Reader Feedback: Page 1 of 1

Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021

SYS-CON Featured Whitepapers
ADS BY GOOGLE