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);
}