2013-03-04 3 views
0

XML 로깅을 활성화하는 방법은 무엇입니까? .Net DevKit V2에서 요청 및 응답 로깅을 활성화하는 방법

나는 나는 그래서 우리 InvoiceAdd 절차

에서 일반 설정 아래에 넣어

추가 트랜잭션에 대한 HelloIntuitAnywhere에서 파생 된 테스트 프로그램에 코드를 넣어 http://docs.developer.intuit.com/0025_Intuit_Anywhere/0200_DevKits/0100_IPP_.NET_DevKit/0600_Logging

에서 지시 사항을 따르려고 노력

012에
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 3,516,

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

있습니다 ServiceContext가 QBO에 대해 인스턴스화되면 DevKit은 영역의 기본 URL을 가져 오기 위해 호출합니다. 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/ –

답변

1

여기의 SDK에서 닷넷이나 자바 로깅을 가능하게하는이 개 포럼 게시물, 자바 닷넷 https://ipp.developer.intuit.com/0010_Intuit_Partner_Platform/0200_DevKits_for_Intuit_Partner_Platform/0100_IPP_.NET_DevKit/0600_Logging

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

덕분에 또한 블로그 게시물
· 병

+0

이해가 안됩니다. InvoiceAdd와 관련된 코드를 어디에 두어야합니까? – QuickBooksDev

+0

동일한 ServiceConext를 사용하지만 새로운 OauthRequestValidator를 사용하기 위해 몇 가지 변경 사항을 적용하여 첫 번째 게시에 표시된대로 표시하고 로깅 위치 폴더에는 아무 것도 없습니다. 그 밖에 무엇이 완료되어야합니까? – QuickBooksDev

+1

로깅 매개 변수를 설정하는 ServiceContext 클래스를 인스턴스화하는 예외가 발생하므로 로깅되지 않습니다. 요청/응답을 캡처하려면 Fiddler 또는 Charles 프록시를 사용해야합니다. 결과를 여기에 게시하십시오. 위에서 언급 한대로 API 탐색기에서 토큰을 테스트 했습니까? –