c# - 找不到 eBayAPIInterfaceService

标签 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

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

最佳答案

据我所知,这段代码应该可以工作:

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

我没有 eBay API key 或任何东西,所以我无法真正测试它。

关于c# - 找不到 eBayAPIInterfaceService,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14497452/

相关文章:

c# - ebay API - 从拍卖列表中获取 UPC

javascript - 如何使用 Response.Write ("&lt;script&gt;alert(' Center Page')&lt;/script&gt;") 设置警报页面样式

c# - 将字符串从 C++/CLI 类库传递到 C#

c# - 在 .NET 中获取所有格形式的本地化方法

python - 使用 ebay 列出 FixedPriceItem 的示例代码

c# - 使用 WCF 查询 eBay API

c# - 让 AutoMapper 的 map 忽略一些属性?

javascript - 使用多个下拉列表在单个 View 中过滤具有两个模型的数据表

node.js - 用于获取订单的 eBay Fulfillment API

html - 如何删除 eBay 上的导航栏?