Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

[Bug] NCo 3.1.2 WebSocket connection fails with "Cert store is not initialized, check trace."

dallmair
Discoverer
0 Kudos
219

Use the following code. It tries to connect to a SAP system via the newly supported WebSocket approach and invoke RFC_PING:

var configParams = new RfcConfigParameters();

configParams[RfcConfigParameters.Name] = "...";
configParams[RfcConfigParameters.SystemID] = "...";
configParams[RfcConfigParameters.SystemNumber] = "..";
configParams[RfcConfigParameters.Client] = "...";
configParams[RfcConfigParameters.Language] = "..";
configParams[RfcConfigParameters.User] = "...";
configParams[RfcConfigParameters.Password] = "...";
configParams[RfcConfigParameters.WebsocketHost] = "...";
configParams[RfcConfigParameters.WebsocketPort] = "...";

var destination = RfcDestinationManager.GetDestination(configParams);
var repository = destination.Repository;
var pingFunction = repository.CreateFunction("RFC_PING");
pingFunction.Invoke(destination);
That does not work however, and it fails with:
SAP.Middleware.Connector.RfcCommunicationException: Cert store is not initialized, check trace.
RETURN CODE: PARAMETER_ERROR
   at SAP.Middleware.Connector.X509CertificateHandlerClient..ctor(RfcDestination destination)
   at SAP.Middleware.Connector.RfcChannelDriverFactory.CreateTCPDriver(RfcProgramType type, RfcConnection rfcConn, RfcDestination destination, Int32& port, String& host, HttpProxy proxy)
   at SAP.Middleware.Connector.RfcChannelDriverFactory.CreateChannelDriver(RfcProgramType type, RfcConnection rfcConn, RfcDestination destination)
   at SAP.Middleware.Connector.RfcConnection.ConnectAsClient(RfcDestination destination, Boolean forRepository)
   at SAP.Middleware.Connector.RfcConnectionPool..ctor(RfcDestination destination, Boolean forRepositoryCalls)
   at SAP.Middleware.Connector.RfcConnectionPool.GetPool(RfcDestination destination, Boolean forRepository, Boolean create)
   at SAP.Middleware.Connector.RfcDestination.GetClient(Boolean forRepository)
   at SAP.Middleware.Connector.RfcDestination.SetAttributeValues()
   at SAP.Middleware.Connector.RfcDestination.get_SystemAttributes()
   at SAP.Middleware.Connector.RfcRepository.GetRepositoryForDestination(RfcDestination destination)
   at SAP.Middleware.Connector.RfcDestination.get_Repository()
   at SampleSAPWebSocketClient.Program.Main() in ...\SAPWebSocket\Program.cs:line 21

The trace does not contain anything relevant.

However, we could make it work by moving to RfcDestinationManager.RegisterDestinationConfiguration and using the RfcDestinationManager.GetDestination overload which accepts a string instead of the config parameters directly. As that is hard to do in our product, it would be great if this bug could be fixed.

Thanks!

0 REPLIES 0