NET 6 Blazor WASM 处理 SAP 集成问题
我正在尝试将我的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我添加了名为的 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