如何为 XML 启用日志记录?
我将代码放在从 HelloIntuitAnywhere 派生的测试程序中进行事务添加
所以我把它放在我们的 InvoiceAdd 过程中的正常设置下
realmId = HttpContext.Current.Session["realm"].ToString();
accessToken = HttpContext.Current.Session["accessToken"].ToString();
accessTokenSecret = HttpContext.Current.Session["accessTokenSecret"].ToString();
consumerKey = ConfigurationManager.AppSettings["consumerKey"].ToString(CultureInfo.InvariantCulture);
consumerSecret = ConfigurationManager.AppSettings["consumerSecret"].ToString(CultureInfo.InvariantCulture);
intuitServiceType = (IntuitServicesType)HttpContext.Current.Session["intuitServiceType"];
oauthValidator = new OAuthRequestValidator(accessToken, accessTokenSecret, consumerKey, consumerSecret);
context = new ServiceContext(oauthValidator, realmId, intuitServiceType);
commonService = new DataServices(context);
////////////////////////////////////////////
//OAuthRequestValidator
oauthValidator = new OAuthRequestValidator("<<accessToken>>",
"<<accessTokenSecret>>",
"<<consumerKey>>",
"<<consumerSecret>>");
//ServiceContext
context = new ServiceContext(oauthValidator, realmId, IntuitServicesType.QBO);
context.EnableServiceRequestsLogging = true;
context.ServiceRequestLoggingLocation = @"c:\IPPlogs";
//////////////////////////////////////////
但是得到 InvalidTokenException on
context = new ServiceContext(oauthValidator, realmId, IntuitServicesType.QBO);