cancel
Showing results for 
Search instead for 
Did you mean: 

Using SAP Connector for .NET in a ASP.NET Web API project

0 Kudos

I want to transform my existing Desktop .NET Framework that uses SAP Connector (x64) for calling RFCs into an ASP.NET Web API running on IIS as a Single Sign On (SSO).

SSO for SAP is configured company wide and SSO is enable via SAP GUI Logon.

SSO is working by using SAP Connector for .NET as Desktop .NET Framework and calls of RFCs are possible.

I created an ASP.NET Web API project and reused the C# code for connecting SAP from the Desktop application.

Additionally I set RfcConfigParameters.SncLibraryPath to sapcrypto.dll. The Impl. of GetParameters from IDestinationConfiguration looks like:

var param = new RfcConfigParameters();
param[RfcConfigParameters.AppServerHost] ="<snip>";

param[RfcConfigParameters.SystemNumber] = "<snip>";

param[RfcConfigParameters.User] = "<snip>";

param[RfcConfigParameters.Client] = "<snip>";

param[RfcConfigParameters.Password] = string.Empty;

param[RfcConfigParameters.SncMode] = "1";

param[RfcConfigParameters.SncSSO] = "1";

param[RfcConfigParameters.SncQOP] = "9";

param[RfcConfigParameters.SncPartnerName] = "p/secude:CN=<...>, O=<my comp>, C=<my comp
country>";

param[RfcConfigParameters.SncLibraryPath] =
"<path>\sapcrypto.dll";

param[RfcConfigParameters.SncMyName] =
"p:CN=<myuser>, O=<my comp>, C=<my comp country>";

Register the configuration:

RfcDestinationManager.RegisterDestinationConfiguration(config);

Getting a RfcDestination instance:

var dest = RfcDestinationManager.GetDestination(...);

On Windows Server 2016 Standard with IIS 10, I created a web application, disabled Anonym. Authentication and enable Windows Authentication.

Calling a simple .aspx page

<p>Username: <%=System.Environment.UserName %></p><br><p>Domain: <%=System.Environment.UserDomainName %></p>

from the web client shows my current Username and Domain.

I implemented a simple controller which should call a RFC on a HTTP-GET. But calling

var repo = dest.Repository;

leeds into the following error:

LOCATION CPIC (TCP/IP) with Unicode ERROR GSS-API(maj): Miscellaneous failure GSS-API(min): A2200204:Unspecified internal error. See logs. target="p/secude:CN=...

RELEASE 721 COMPONENT SNC (Secure Network Communication) VERSION 6 RC -4 MODULE sncxxall.c LINE 3604 DETAIL SncPEstablishContext SYSTEM CALL gss_init_sec_context COUNTER 8

On the my server, SAP GUI with SSO is installed, configured and I am able to connect via SSO.

How can I get this scenario to work ? Where is the problem?

How can I find more information for ERR-Code A2200204 (mention "See logs.")

Thanks in advance

Christian

Accepted Solutions (0)

Answers (0)