2013-01-24 1 views
4

나는 가장 기본적인 이베이 (Ebay) API 호출을 작동시키지 못하는 것 같습니다. 내가 자습서를 할 노력하고있어 여기 :eBayAPIInterfaceService 찾을 수 없습니다

http://developer.ebay.com/DevZone/xml/docs/HowTo/FirstCall/MakingCallCSharp.html

그러나 내가 읽기 오류가 점점 계속 :

"형식 또는 네임 스페이스 'eBayAPIInterfaceService이'을 (를) 찾을 수 없습니다를 (당신이 누락 지시문 또는 어셈블리 참조를 사용?)

이 (비주얼 스튜디오 2012)

을 사용하여 I는 서비스 참조를 추가 http://developer.ebay.com/webservices/latest/ebaySvc.wsdl

using 문을 반드시 추가해야합니다. 다른 모든 이베이 Api 개체가 인식되고 있습니다. CustomSecurityHeaderType, GeteBayOfficialTimeRequestType 및 GeteBayOfficialTimeResponseType이 오류로 표시되지 않습니다. 그것만이 eBayAPIInterfaceService 인 것 같습니다

저는이 문제에 대한 해결책을 찾았습니다. 다른 사람들이이 문제를 가지고있는 것처럼 보이지만 해결책을 찾을 수없는 것 같습니다.

내가 무엇을 말할 수에서
+0

나는 컴파일 타임 오류 (런타임 오류가 아님)를 얻는다고 가정합니다. 맞습니까? VS에서 "Object Browser"를 사용하여'eBayAPIInterfaceService'를 찾을 수 있습니까? –

+0

예 컴파일 시간 오류입니다. 나는 객체 브라우저를 들여다 보았다.eBayAPIInterface, eBayAPIInterfaceClient 및 eBayAPIInterfaceChannel을 찾을 수 있지만 eBayAPIInterfaceService는 찾을 수 없습니다. – user1865944

답변

7

,이 코드는 작동합니다 :

eBayAPIInterfaceClient service = new eBayAPIInterfaceClient("eBayAPI"); 

// Set credentials 
CustomSecurityHeaderType requesterCredentials = new CustomSecurityHeaderType(); 
requesterCredentials.eBayAuthToken = "yourToken"; // use your token 
requesterCredentials.Credentials = new UserIdPasswordType(); 
requesterCredentials.Credentials.AppId = appId; 
requesterCredentials.Credentials.DevId = devId; 
requesterCredentials.Credentials.AuthCert = certId; 

// Make the call to GeteBayOfficialTime 
GeteBayOfficialTimeRequestType request = new GeteBayOfficialTimeRequestType(); 
request.Version = "405"; 
GeteBayOfficialTimeResponseType response = service.GeteBayOfficialTime(ref requesterCredentials, request); 
Console.WriteLine("The time at eBay headquarters in San Jose, California, USA, is:"); 
Console.WriteLine(response.Timestamp); 

정말 그것을 테스트 할 수 없습니다 그래서 더 이베이 API 키 또는 아무것도 없습니다.

+1

예, 성공했습니다. 나는 자습서가 오래되었다고 생각한다. 또는 나는 무엇인가 놓쳤다. 고맙습니다. – user1865944

+2

그런 다음 내 대답에 동의 표시를하십시오. –

+0

@Sebastian Krysmanski 어떻게 그걸 알아 냈습니까? 업데이트 된 의사의 링크? 감사합니다 – user1253073

4

이 페이지를 찾으면 API 안녕하세요 세계의 예를 잘못 찾고 있습니다. https://go.developer.ebay.com/developers/ebay/documentation-tools/sdks/dotnet

을 다음 : (당신은 당신이 이미하지 않은 경우 어쨌든이 작업을 수행 할 필요가)

다운로드를 이베이에서 eBayDotNET40sdk817.msi 파일을 설치 :이 예제의 최신 버전이 있습니다, 이것은 당신이 그것을 발견하는 방법입니다

두 튜토리얼은 \ 프로그램 파일 \ 이베이 \ 이베이 .NET SDK v817 릴리스 \ 자습서 \ C 번호 : Tutorial_HelloWorld.doc, Tutorial_ConsoleAddItem.doc C : 당신은 여기에 하드 드라이브에있는 두 개의 예제 튜토리얼을해야합니다

add-item 튜토리얼을 시험해 보았는데 코드를 복사하여 붙여 넣기 만하면 효과가있었습니다. 나는 hello world 튜토리얼을 시도하지 않았지만 업데이트 된 버전이며 eBayAPIInterfaceClient 또는 eBayAPIInterfaceService를 사용하지 않는다는 것을 알 수있다.

참고 사항 : 프로젝트에 추가해야하는 COM 참조는 C : \ Program Files \ eBay에 있습니다. (위) 세바스찬의 멋진 대답 작업의 코드를하려는 경우 다음과 같이 eBayAPIInterfaceClient를 인스턴스화 곳

마지막으로, 다음 requestURL을 넣어하는 것을 잊지 마세요 :

eBayAPIInterfaceClient service = new eBayAPIInterfaceClient("eBayAPI", requestURL); 

(I 편집하려고 자신의 대답했지만 작동하지 않았다)

행운을 빌어 요! :)

관련 문제