0

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);
        }
Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
Enes Kartal
  • 137
  • 1
  • 9

1 Answers1

0

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

Enes Kartal
  • 137
  • 1
  • 9