17 June 2008

Java Exchange Connector and EWSJ

Just saw this on TheServerSide.com.  The Exchange Web Services for Java (EWSJ - what happened to the 4?).  It's a Java class library that uses the Apache AXIS web services stack to connect connects to Microsoft Exchange Server 2007, via the published and supported Exchange Web Services interfaces.   

What you can do with this is connect to Exchange 2007 from any Java app.  A good example is when building an HR or group scheduling app, in Java.  (While I love .NET, not everyone has seen the light! and some poor developers are relegated to using Java even for new applications.)   In the scenario where you write in Java and the enterprise messaging standard is Exchange, the EWSJ library may come in handy.

There's a beta of the Exchange Web Services for Java out now; it looks like the company updates the beta fairly regularly. They mention a free academic license, so I guess they will be licensing EWSJ for a fee for other purposes.

The company also has something called the JEC, which I guess is the Java Exchange Connector.  I don't understand the difference between EWSJ and JEC.  Based on reading, I'm guessing they do the same thing - provide access for Java apps into the Exchange store - but  I think the JEC is based on the older WebDAV interface into Exchange, and EWSJ uses the web services interfaces.  Just a guess... I don't know.  Maybe someone can enlighten me.

This EWSJ works with the Web services interfaces supported by Exchange 2007.  By the way, those are the same web services interfaces I use from a Windows Forms app running in .NET, and the same interfaces I use from a Windows Mobile app running on my smartphone.

It brings up an interesting question - why pay for EWSJ - or any third-party library that wraps web services interfaces - when the webservices interfaces are public and free-of-charge?  I mean, if you have the WSDL and XML Schema, and you have access to good Web services tooling (Apache AXIS for Java, WCF in .NET), then you could just build (generate) the client-side proxies and classes and  get connected, right?  But, there's an opportunity to add in value to the interface - like caching of content, caching of credentials, simplifying the interface, integrating with other frameworks, and so on.  The approach I took with my .NET work was to use the tools and published interfaces. But I can see value in depending on a third party library that adds some additional capability. I don't know much about EWSJ, so I don't know what's been added, but I see the opportunity for the company to deliver something interesting there.

By the way, I have also previously demonstrated the use of WebDAV interfaces to get to Exchange Server from Java, prior to version 2007, as the JEC does it.  You can get from a JSP to Exchange 2003 for example, using WebDAV.  The way I did it was, like the JEC approach, to depend on the Apache libraries. In my case, just as with the JEC, I used the now-retired Jakarta Slide library and the httpclient from the commons package. I can publish this source code if you like. (But if you are running Exchange 2003, you really should upgrade. E2007 is much much better, and the web services interface is just one aspect.)

I was surprised to see that Jakarta Slide has been retired! Apparently it didn't attract enough developers. But it looks like there is a new WebDAV implementation in the Apache Jackrabbit project.  I guess this is a challenge facing all open-source projects. With so much attention focused on AJAX and pretty web interfaces, internetworking protocols like WebDAV take a back seat.  Good to see WebDAV is not totally dead at Apache.

EWSJ looks like one more interesting interop opportunity.

 

Filed under: , ,
 

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# Kris said:

The problem I believe is that for some open source developer to build a small library for Exchange is the inability to set up the infrastructure and run exchange server on their boxes. Granted there is VPC which alleviates the problem, but there is still a lot of infrastructure work required to set up Exchange. Virtual Labs can come in handy but it is difficult to move the code one has developed on them and also the Java tools are not available on the same. Just my 2c...

17 June 08 at 12:37 PM
# DotNetInterop said:

Kris, I can see that - it's difficult to set up the infrastructure.  For a test & development set  up, I'd guess the difficulty of setting up Exchange Server is about the same as the effort required to set up an Oracle database; maybe Exchange is a little less familiar to people, but the effort is about the same.  

There are VPCs that you can get, if you have a MSDN subscription, that makes it easier.   Also there are third-party hosting providers - basically you can just sign up for an Exchange account - either as a SaaS (you get a set of mailboxes on a shared Exchange server), or as hosted infrastructure, where you have your own standalone Exchange Server, hosted.

Even with those options, I agree there is a non-trivial bar to get over, just to get started in developing against Exchange, whether you use Java or PHP or .NET or whatever.

BUT, that problem is the present even for someone just *evaluating* the EWSJ library, isn't it?  I mean, you can't test out the EWSJ unless you have an Exchange Server.  You still need a server. . .

Listen, I'm gonna make an offer - if anyone needs assistance getting an Exchange Server set up for development purposes, contact me directly and I will see what I can do for you.  Point you in the right direction, lay out some options, etc.  The same goes for any server-side Microsoft infrastructure - Sharepoint, SQL, BizTalk Server, ISA, and so on.  Gimme a buzz and I'll try to help you out, regardless of the language or platform you are developing ON.

17 June 08 at 5:48 PM
# Eli Hasson said:

Hi,

Just a small correction to the acticle above, EWSJ does not use Apache Axis, it generates itself all the Web Services communication, this allows use greater flexibility better performance, and avoiding Web Services standardizations problems.

Eli Hasson,

JEC Team

28 June 08 at 3:20 PM
# DotNetInterop said:

Hey Eli, any comments on the differences between JEC and EWSJ, and also, the value-add that you offer?  

thanks

-Dino

30 June 08 at 4:56 PM
# Eli Hasson said:

Hi Dino,

JEC uses WebDav while EWSJ use EWS.

The 2 API's will have more or less the same operations and features.

The Value-add EWSJ offers (other using AXIS or JAX-WS)  is:

1. simplicity:

   here is a code snippet for getting public contacts (4 lines of code):

   ExchangeConnectorFactory factory = new ExchangeConnectorFactory();

       EWSConnectorInterface connector = null;

       connector = factory.createEWSConnector(_exchangeHost,

                                              _applicationUserAccountName,

                                              _applicationUserPassword,

                                              _prefix, _useSSL, _mailboxName);

       ArrayList contacts = connector.getPublicContacts();

2. preformance: this API is tailored to Exchange server, while Axis  and JAX-WS are general purpose.

3. minimum jar dependencies, we don't depend on Other WS library, we build our WS layer from ground, we don't have http dependence either.

To sum it up, in about 4 mins you'll be able to communicate with exchange server using EWSJ and your favorite application server.

Eli

01 July 08 at 12:05 PM
# Joe said:

I've actually looked at Moonrug - it uses neither EWS or WebDAV (which is dying anyway, see the developer roadmap).  It is a MAPI based java connector, their work is very promising, and uses no web services.

14 July 08 at 3:11 PM
# Peter said:

I would appreciate seeing the code for the WebDav access using Slide and httpclient - if it isn't too much of a hassle.

Thanks for your consideration.

14 July 08 at 5:13 PM
# DotNetInterop said:

I will look into publishing that Java code I wrote, along with a recipe .

15 July 08 at 11:42 AM
# Eli Hasson said:

I've check Moonrug, It sure looks very interesting, this people are crazy enough to reverse engineer MAPI, looks like they have only started their implementation, and have a way to go, but what a glorious way this can be!

20 July 08 at 4:04 AM
# All About Interop said:

Earlier I mentioned a Java Exchange Connector I had seen, and in that post I also said that I had some

23 July 08 at 11:21 AM
# NewToWS said:

Can anybody help me on how do i get going with storing information to MS Exchange server calendar using Web service

06 August 08 at 6:51 AM

Leave a Comment

Comment Policy: No HTML allowed. URIs and line breaks are converted automatically. Your e–mail address will not show up on any public page.

(required) 
(optional)
(required) 
Page view tracker