public bool GetMarketplaceUserPreference() { // create and init the API Context var context = new ApiContext(); context.ApiCredential = RequestHelper.ApiCredential; context.SoapApiServerUrl = RequestHelper.ServiceUrl; try { // create the preference feed var preferenceType = new GetUserPreferencesRequestType { ShowOutOfStockControlPreference = true, ShowSellerPaymentPreferences = true, }; var apiCall = new GetUserPreferencesCall(context); var response = apiCall.ExecuteRequest(preferenceType); if (response.Ack == AckCodeType.Success) { return(true); } // log the error _logger.LogError(LogEntryType.eBayProductProvider, string.Format("{0} - Error in getting user preference - Message: {1}", ChannelName, response.Errors[0].LongMessage), string.Join(",", response.Errors[0].ErrorParameters)); return(false); } catch (Exception ex) { _logger.LogError(LogEntryType.eBayProductProvider, string.Format("Unexpected error in getting user preference\". Err Message: {0}", EisHelper.GetExceptionMessage(ex)), ex.StackTrace); return(false); } }
/// <summary> /// /// </summary> /// <param name="ApiContext">The <see cref="ApiCall.ApiContext"/> for this API Call of type <see cref="ApiContext"/>.</param> public GetUserPreferencesCall(ApiContext ApiContext) { ApiRequest = new GetUserPreferencesRequestType(); this.ApiContext = ApiContext; }
/// <summary> /// /// </summary> public GetUserPreferencesCall() { ApiRequest = new GetUserPreferencesRequestType(); }