Пример #1
0
        public static String getAuthenticateUrl(out String sessionId)
        {
            sessionId = "";

            ApiAccount apiAccount = new ApiAccount();
            apiAccount.Application = EbayAppId;
            apiAccount.Certificate = EbayCertId;
            apiAccount.Developer = EbayDevId;

            ApiContext localContext = new ApiContext();
            localContext.ApiCredential = new eBay.Service.Core.Sdk.ApiCredential();
            localContext.ApiCredential.ApiAccount = apiAccount;
            localContext.RuName = EbayRuName;
            localContext.SoapApiServerUrl = System.Configuration.ConfigurationManager.AppSettings.Get(AppSettingHelper.API_SERVER_URL);
            localContext.SignInUrl = System.Configuration.ConfigurationManager.AppSettings.Get(AppSettingHelper.SIGNIN_URL);

            GetSessionIDCall apiCall = new GetSessionIDCall(localContext);
            apiCall.RuName = EbayRuName;
            apiCall.Execute();

            sessionId = apiCall.SessionID;
            String authUrl = String.Format("{0}&RuName={1}&SessID={2}", localContext.SignInUrl, EbayRuName, sessionId);
            return authUrl;
        }