NET 6 Blazor WASM 处理 SAP 集成问题

发布于 2025-01-11 10:33:41 字数 1972 浏览 0 评论 0原文

我正在尝试将我的 blazor wasm 应用程序集成到 sap 中。但是当我调用下面的代码时,IIS 池正在停止。但是当我在我的视觉工作室上运行项目时,它运行成功。我认为 IIS 无法将 SAP dll 注入到 wasm 中。我该如何解决这个问题?

当我调用此代码时捕获错误:sapConnection.Connect();

我的代码:

 public async Task<Result<SAPOrderResponse>> GetOrderByOrderNum(string orderNum, string kalemInfo = null)
    {
        SAPOrderResponseModel response = new SAPOrderResponseModel();
        Log.Information("GetOrderByOrderNum");
        try
        {
            Log.Information("GetOrderByOrderNum 1");
            using (var scopeFactory = serviceProvider.CreateScope())
            {
                Log.Information("GetOrderByOrderNum 2");
                using (sapConnection = new SapConnection(GetConnectionString()))
                {
                    Log.Information("GetOrderByOrderNum 3");
                    sapConnection.Connect();
                    Log.Information("GetOrderByOrderNum 3.5");
                    using (var sapFunction = sapConnection.CreateFunction("ZDYS_SIPARIS_ISYERI"))
                    {
                        Log.Information("GetOrderByOrderNum 4");
                        SAPOrderRequest orderRequest = new SAPOrderRequest
                        {
                            KalemInfo = kalemInfo,
                            OrderNum = orderNum,
                        };
                        Log.Information("GetOrderByOrderNum 5");

                        response = sapFunction.Invoke<SAPOrderResponseModel>(orderRequest);
                        Log.Information("GetOrderByOrderNum 6");
                        return await Result<SAPOrderResponse>.SuccessAsync(response.OrderResponse);
                    }
                }
            }
        }
        catch (Exception ex)
        {
            Log.Error(ex.Message);
            Log.Error(ex.Message + "\n" + ex.StackTrace);
            return await Result<SAPOrderResponse>.FailAsync(ex.Message);
        }

I'm trying to integrate my blazor wasm app to sap. But when i call below code the IIS pool is stopping. But when i run project on my visual studio it's working successfully. I think IIS can't inject the SAP dll's to wasm. How can i fix this problem ?

Error catching when i call this code: sapConnection.Connect();

My Code :

 public async Task<Result<SAPOrderResponse>> GetOrderByOrderNum(string orderNum, string kalemInfo = null)
    {
        SAPOrderResponseModel response = new SAPOrderResponseModel();
        Log.Information("GetOrderByOrderNum");
        try
        {
            Log.Information("GetOrderByOrderNum 1");
            using (var scopeFactory = serviceProvider.CreateScope())
            {
                Log.Information("GetOrderByOrderNum 2");
                using (sapConnection = new SapConnection(GetConnectionString()))
                {
                    Log.Information("GetOrderByOrderNum 3");
                    sapConnection.Connect();
                    Log.Information("GetOrderByOrderNum 3.5");
                    using (var sapFunction = sapConnection.CreateFunction("ZDYS_SIPARIS_ISYERI"))
                    {
                        Log.Information("GetOrderByOrderNum 4");
                        SAPOrderRequest orderRequest = new SAPOrderRequest
                        {
                            KalemInfo = kalemInfo,
                            OrderNum = orderNum,
                        };
                        Log.Information("GetOrderByOrderNum 5");

                        response = sapFunction.Invoke<SAPOrderResponseModel>(orderRequest);
                        Log.Information("GetOrderByOrderNum 6");
                        return await Result<SAPOrderResponse>.SuccessAsync(response.OrderResponse);
                    }
                }
            }
        }
        catch (Exception ex)
        {
            Log.Error(ex.Message);
            Log.Error(ex.Message + "\n" + ex.StackTrace);
            return await Result<SAPOrderResponse>.FailAsync(ex.Message);
        }

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

忘年祭陌 2025-01-18 10:33:41

我添加了名为的 SAP 库
“sapnwrfc.dll,icuuc50.dll,icuin50.dll,icudt50.dll”到system32和sysWow64文件夹解决了我的问题,

您可以访问此链接并解决此问题。

https://github.com/huysentruitw/SapNwRfc/issues/37

I was added the SAP libraries named
"sapnwrfc.dll, icuuc50.dll, icuin50.dll, icudt50.dll" to system32 and sysWow64 folder is fixed my problem,

you can visit this link and solve this problem.

https://github.com/huysentruitw/SapNwRfc/issues/37

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文