Request和Response记录如何启用的XML日志?如何启用在.NET的devkit V2
我试图从 http://docs.developer.intuit.com/0025_Intuit_Anywhere/0200_DevKits/0100_IPP_.NET_DevKit/0600_Logging
按照指示我把代码从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
context = new ServiceContext(oauthValidator, realmId, IntuitServicesType.QBO);
当ServiceContext被实例化QBO时,的devkit进行调用以获取该领域的基础网址: HTTP://docs.develo per.intuit.com/0025_Intuit_Anywhere/0050_Data_Services/v2/0400_QuickBooks_Online/0100_Calling_Data_Services/0010_Getting_the_Base_URL 这是它失败的原因。 OAuth令牌已过期或无效,因为您正在呼叫的领域。您可以在API浏览器测试记号: http://apiexplorer.developer.intuit.com/ – 2013-03-04 21:47:01