当前位置: 首页> 教育> 就业 > 广州正佳广场在哪里_企业管理系统作用_百度seo优化按年收费_搜狗网

广州正佳广场在哪里_企业管理系统作用_百度seo优化按年收费_搜狗网

时间:2025/7/9 13:41:42来源:https://blog.csdn.net/dwjnhkbc123/article/details/142375817 浏览次数:0次
广州正佳广场在哪里_企业管理系统作用_百度seo优化按年收费_搜狗网

SAP NetWeaver RFC library

This cross-platform library allows you to call SAP NetWeaver RFC functions from .NET 5, .NET Core and the .NET Framework.

The library is fully tested and production ready. Supported operating systems are Windows, Linux and macOS.

Also supports connection pooling for more complex applications, see below.

Get it on NuGet

dotnet add package SapNwRfc

or

PM> Install-Package SapNwRfc

Prerequisites

This library requires the SAP NetWeaver RFC Library 7.50 SDK C++ binaries that should be installed locally. For download and installation instructions see SAP Note 2573790.

You can either place the DLL's in your project output folder or put them in a folder available in the systems PATH (Windows), LD_LIBRARY_PATH (Linux) or DYLD_LIBRARY_PATH (macOS) environment variable.

On Windows, the 7.50 version of the SAP binaries also require you to install the 64-bit version of the Visual C++ 2013 Redistributable package which can be downloaded and installed from here.

MacOSX and DYLD_LIBRARY_PATH

When your application is started as a child-process (f.e. when running it using Visual Studio for Mac), it is possible that the DYLD_LIBRARY_PATH is not forwarded to the child-process. This is because of this runtime protection Apple has added to OSX.

The simplest solution to this problem is to make sure the SAP binaries are placed in the working directory of your application.

or to use the NativeLibrary.SetDllImportResolver method in your application.

A more flexible workaround is to set the import resolver for the SapLibrary using the SetDllImportResolver-method like this:

NativeLibrary.SetDllImportResolver(assembly: typeof(SapLibrary).Assembly,resolver: (string libraryName, Assembly assembly, DllImportSearchPath? searchPath) =>{if (libraryName == "sapnwrfc"){NativeLibrary.TryLoad(libraryPath: Path.Combine("<your_sap_rfc_binaries_path>", libraryName),handle: out IntPtr handle);return handle;}return IntPtr.Zero;});

Call function with input parameters but no output parameters

class SomeFunctionParameters
{[SapName("SOME_FIELD")]public string SomeField { get; set; }
}using var someFunction = connection.CreateFunction("BAPI_SOME_FUNCTION_NAME");
someFunction.Invoke(new SomeFunctionParameters
{SomeField = "Some value",
});

Call function with input and output parameters

class SomeFunctionParameters
{[SapName("SOME_FIELD")]public string SomeField { get; set; }
}class SomeFunctionResult
{[SapName("RES_ABC")]public string Abc { get; set; }
}using var someFunction = connection.CreateFunction("BAPI_SOME_FUNCTION_NAME");
var result = someFunction.Invoke<SomeFunctionResult>(new SomeFunctionParameters
{SomeField = "Some value",
});// Do something with result.Abc
关键字:广州正佳广场在哪里_企业管理系统作用_百度seo优化按年收费_搜狗网

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: