How to enable logging for the XML?

I tried to follow the directions from http://docs.developer.intuit.com/0025_Intuit_Anywhere/0200_DevKits/0100_IPP_.NET_DevKit/0600_Logging

I put the code in a test program derived from the HelloIntuitAnywhere for a Transaction Add

So I put it under the normal setting in our InvoiceAdd procedure

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";

//////////////////////////////////////////

But get InvalidTokenException on

context = new ServiceContext(oauthValidator, realmId, IntuitServicesType.QBO);
share|improve this question
1  
When the ServiceContext is instantiated for QBO, the DevKit makes a call to get the realm's base URL: docs.developer.intuit.com/0025_Intuit_Anywhere/… This is where it is failing. The OAuth tokens are expired or not valid for the realm you are making the call for. You can test the tokens in the API Explorer: apiexplorer.developer.intuit.com – peterl yesterday

1 Answer

Your Answer

 
or
required, but never shown
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.