tags:

views:

290

answers:

3

Because the SAP Connector for .NET is no longer maintained by SAP, I am now looking for an alternative to connect the Microsoft world with the SAP world. I know there are third party products like "ERPConnect", but I want to do this with tools from SAP (by the way I cannnot use the Enterprise Services, because the target SAP system is SAP 4.6C). Therefore there arised the crazy idea to use the SAP Java Connector in combination with the tool IKVM.NET (www.ikvm.net/devguide/net2java.html). IKVM.NET provides The IKVMC tool, which converts Java bytecode to .NET dll's and exe's. "No sooner said than done!" I converted the SAP JCo to .NET dlls and created a new Visual Studio solution. I put all the JCO files into a subdirectory of my solution. I set 2 references to the generated IKVM.OpenJDK.Core.dll and sapjco.dll. Great, all JCO classes where now available as .NET classes. Full of optimism I wrote some little code to connect to a SAP system.

JCO.Client client = null; client = JCO.createClient(...)

The compiliation of my testcode had no errors. "Wonderful !" I thought. Then I started my tetstapplication. Unfortunately I got an exception calling JCO.createClient:

Could not load middleware layer 'com.sap.mw.jco.rfc.MiddlewareRFC'\r\nno sapjcorfc in java.library.path

I have 2 questions on this topic.

1) Do you think my idea using the SAP Java Connector (SAP JCo) to connect .NET with SAP is a good idea or is it nonsense? Perhaps someone had already the same idea ;-)

2) How can the above exception be solved ?

+3  A: 

1) I don't think this approach is a good idea. The actual connection to sap is done not from java ( or from .net in the old .net connector). But from a c dll named, librfc32.dll. I believe that IKVM support of JNI is not complete.

It will maybe work, But, even than, it will be fragile.

Igal Serban
I agree, it would make more sense to spend your time to write a managed wrapper around librfc32.dll
Stefan Egli
+1  A: 

I would not recommend this way ! You should use the direct way. For example you can use the SAP RFC SDK.

uhu
A: 

I think you shold have a look at Web Services, it will be more easy and more flexible.

Regards

franblay