0

如何为 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 on

context = new ServiceContext(oauthValidator, realmId, IntuitServicesType.QBO);
4

1 回答 1

1

这里有两篇关于在 SDK 中启用 .Net 或 Java 日志的论坛帖子,还有一篇关于 Java .Net 的博文 https://ipp.developer.intuit.com/0010_Intuit_Partner_Platform/0200_DevKits_for_Intuit_Partner_Platform/0100_IPP_.NET_DevKit/0600_Logging

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

谢谢贾里德
_

于 2013-03-05T11:50:41.187 回答