SAPBinding Hard-coded logon parameters not allowed when using a Destination Configuration in C#

32 views Asked by At

We're using SAPBinding with a WCF-Client, the first invocation returns OK, but the second returns "SAP Hard-coded logon parameters not allowed when using a Destination Configuration in C#". Any help? This is the code:

        string connectionUriTemplate = "sap://CLIENT={0};LANG=EN;@{1}/{2}/{3}?RfcSdkTrace=False&AbapDebug=False";

        string connectionUri = string.Format(connectionUriTemplate, SAP_CLIENT, SAP_TYPE, SAP_SERVER, SAP_SYSTEM_NUMBER);

        SAPBinding sapBinding = new SAPBinding()
        {
            ReceiveTimeout = TimeSpan.MaxValue,
            SendTimeout = TimeSpan.FromMilliseconds(SAP_TIMEOUT)
        };

        EndpointAddress address = new EndpointAddress(connectionUri);

        RfcClient client = new RfcClient(sapBinding, address);
        client.ClientCredentials.UserName.UserName = SAP_USER;
        client.ClientCredentials.UserName.Password = SAP_PASSWORD;  
0

There are 0 answers