cancel
Showing results for 
Search instead for 
Did you mean: 

destination configuration already initialized

Former Member
0 Kudos

dear all

i started to use SAP .Net Connector 3.

it is wonderful.

but i am getting this error : destination configuration already initialized

please note that i am using: RfcDestinationManager.UnregisterDestinationConfiguration(myBackendConfig);

and i am still getting this error.

thanks,

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

i think i found  the problem.

this is a web service with "many requests using the same connection parameters"

and this is my  connection parameter:

parms.Add(RfcConfigParameters.AppServerHost, "192.168.1.48");

                parms.Add(RfcConfigParameters.SystemNumber, "40");

                parms.Add(RfcConfigParameters.SystemID, "PS1");

                parms.Add(RfcConfigParameters.User, "r.nashaat");

                parms.Add(RfcConfigParameters.Password, "edita1234");

                parms.Add(RfcConfigParameters.Client, "450");

                parms.Add(RfcConfigParameters.Language, "EN");

                parms.Add(RfcConfigParameters.PoolSize, "10");

Former Member
0 Kudos

this was my solution and it is working so far:

RfcDestination dest = null;

            MyBackendConfig myBackendConfig = new MyBackendConfig();

           

            bool xx = RfcDestinationManager.IsDestinationConfigurationRegistered();

            if (RfcDestinationManager.TryGetDestination("mySAPdestination") == null)

            {

                RfcDestinationManager.RegisterDestinationConfiguration(myBackendConfig);

                dest = RfcDestinationManager.GetDestination("mySAPdestination");

            }

            else

            {

                dest = RfcDestinationManager.GetDestination("mySAPdestination");

            }           

            try

            {

                RfcRepository repo = dest.Repository;

                IRfcFunction irfcZ_IS_GETSALES = repo.CreateFunction("FM_1");

               rest of the code......

}

catch()

{

}

MarkusTolksdorf
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Ramzy,

checking for a certain destinaton does not make sense. The destination might simply not be configured. Moreover, you've used IsDestinationConfigurationRegistered but don't use the result of it. Why? This would be a correct approach, Furthermore, you should understand that managing the destination configuration is something you could keep in a completely different module and do not mix it up with the actual application codin, which is then using the destinations. Your application code should simply assume that there is an IDestinationConfiguration registered already.

Best regards,

Markus