Take the 2-minute tour ×

I am tasked with writing an application to connect to the DoubleClick DART API and download ad creatives.

The API is currently Java only, but they are working on (eventually) releasing a SOAP version.

As a C# developer, I'd like to write the application in C# and access the Java API, until the SOAP API is available.

Can I do this? If so, how?

If not, I will learn Java, write the application, then redo it when the SOAP API is available, but this isn't the preferred course of action.

Thanks for the help.

share|improve this question

7 Answers 7

up vote 1 down vote accepted

Forget the Java DART API and switch to this new WebService API approach:


share|improve this answer
This is what I have been waiting for!!! –  Paige Watson Jul 8 '09 at 0:03

IKVM.NET might be your solution. It is a Java Virtual Machine which translates Java bytecode to .NET IL.

What you can do is to compile the Java API (provided as jar or source files) using ikvmc.exe into a .NET assembly and then reference this assembly from your C# project.

IKVM does have limited support for Java user interfaces (AWT), but since it is an API, this shouldn't be relevant.

I haven't tried this by myself, so I can't guarantee that this really works.

See http://weblog.ikvm.net/story.aspx/faq

share|improve this answer
I converted the jar files using IKVMC and was able to start using the API as soon as Google Eng granted access. Now to just wade through the documentation to figure out how to do what I need. –  Matthew Jun 10 '11 at 20:22

Is this a web-services API, or a JAR file that you've been provided? In the latter case, J# may be an option, and there's some other bridging options in this thread: http://www.velocityreviews.com/forums/t140810-java-c-interop.html

share|improve this answer

Yes, you can do this and we had to do something pretty similar a while back.

The Doubleclick API is Java based and is essentially a collection of methods to interrogate the database.

What you need to do is wrap these methods inside a web service using something like Axis2 and then deploy the web service to a Tomcat server (all of this is open source). That exposes the web service and you can then call the web service from anything you like.

So in your case, you add a web service reference inside Visual Studio and then your C# class will call the web service which invokes the Doubleclick Java method.

The actual Java code is minimal (aprox. 10 lines) since all it does is a call and then formats the output. It takes longer to deploy than it does to write the code!

Our Java development environment is Eclipse and I blogged about it here.

share|improve this answer

As an aside may I recommend writing your web service in a RESTful way, rather (or in conjunction with) then SOAP? The benefit will be interoperability between any language that you may want to consume your service in the future, rather then only ones that can generate code based on WSDL. Just a thought.

share|improve this answer

I would say that using a J# layer might be a good option. I've only used it once a while back, but it did the trick for me.

share|improve this answer

We actually went with a slightly different way of doing this.

  1. The C# web service now calls the Java class with javaw.exe (using Process) and passes in an id (GUID).
  2. The GUID is used as a filename for an XML file that is written by the java class.
  3. If the process (javaw) ends without error, the web service then opens the (GUID).xml file and retrieves the data.

While this is not the optimal method, it works for this process in the short term, and in the long term, when a SOAP solution becomes available, the web service is easily updated.

share|improve this answer

Your Answer


