如何在.Net DevKit V2中启用请求和响应日志记录



如何为XML启用日志记录?

我试着按照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);

这里有两篇关于在SDK中启用.Net或Java登录的论坛文章,也是一篇Java博客文章网https://ipp.developer.intuit.com/0010_Intuit_Partner_Platform/0200_DevKits_for_Intuit_Partner_Platform/0100_IPP_.NET_DevKit/0600_Logging

Javahttp://ippblog.intuit.com/blog/2012/07/ipp-java-devkit-logger.html

谢谢
Jarred

最新更新