开发者

Crazy idea: Connect .NET and SAP with SAP JCo using IKVM.NET

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 topi开发者_高级运维c.

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 ?


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.


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


SAP .Net Connector 3 is released. I use it at work every day...


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

Regards


This sound like a classloader problem of IKVM. Take a look in the description in the wiki.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜