on 03-18-2014 2:45 PM
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,
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");
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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()
{
}
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
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.