Crazy idea: Connect .NET and SAP with SAP JCo using IKVM.NET
- by Kottan
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 a third party products like ERPConnect, but I want to do this with tools from SAP.
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 SAP Java Connector to connect .NET with SAP is a good idea or is it nonsens ? Perhaps someone had already the same idea ;-)
2) How can the above exception be solved ?