无法找到eBayAPIInterfaceService

use*_*944 4 c# ebay-api

我似乎无法获得最基本的Ebay Api Call工作.我正在尝试做这里的教程:

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

但是我一直收到一个错误:

"无法找到类型或命名空间'eBayAPIInterfaceService'(您是否缺少using指令或程序集引用?)

(使用Visual Studio 2012)

我添加了服务参考http://developer.ebay.com/webservices/latest/ebaySvc.wsdl

我确保添加using语句.所有其他ebay Api对象都被识别为CustomSecurityHeaderType,GeteBayOfficialTimeRequestType和GeteBayOfficialTimeResponseType未显示为错误.它似乎只是eBayAPIInterfaceService

我已经搜索了这个问题的解决方案,似乎其他人在过去遇到过这个问题,但我找不到任何解决方案.

Seb*_*ski 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);
Run Code Online (Sandbox Code Playgroud)

我没有eBay API密钥或任何其他所以我无法真正测试它.

  • 然后请将我的答案标记为已接受. (2认同)