ebay API - C# eBayAPIInterfaceClient 错误:Web 服务 eBayAPI 未正确配置

本文关键字:eBayAPI 服务 配置 Web API eBayAPIInterfaceClient 错误 ebay | 更新日期: 2023-09-27 17:56:45

我正在尝试与C#中的ebay API接口。他们提供的 C# 中用于获取时间的示例代码工作正常。这似乎是在VS中使用"网络引用"(我使用的是2008 Express)。

当我尝试向我的项目添加"服务引用"时,我必须通过以下方式使用该eBayAPIInterfaceClient(我找不到像他们示例使用的任何ebayAPIInterfaceService的引用):

eBayAPIInterfaceClient client = new eBayAPIInterfaceClient();
CustomSecurityHeaderType credentials = new CustomSecurityHeaderType();
credentials.Credentials = new UserIdPasswordType();
credentials.Credentials.AppId = AppSettings.EbayAppID;
credentials.Credentials.DevId = AppSettings.EbayDevID;
credentials.Credentials.AuthCert = AppSettings.EbayCertID;
credentials.eBayAuthToken = AppSettings.EbayToken;
GeteBayOfficialTimeRequestType ebayTimeReq = new GeteBayOfficialTimeRequestType();
ebayTimeReq.Version = "551";
GeteBayOfficialTimeResponseType response = client.GeteBayOfficialTime( ref credentials, ebayTimeReq );

无论如何,它不起作用(显然我使用相同的设置,例如AppID,令牌等)。它给了我回报:

com.ebay.app.pres.service.hosting.WebServiceDisabledException: The web service eBayAPI is not properly configured or not found and is disabled.

有什么想法吗?我的意思是我假设我在这里没有做任何真正愚蠢的事情:)

ebay API - C# eBayAPIInterfaceClient 错误:Web 服务 eBayAPI 未正确配置

看起来你忘了设置网址。您需要指示 Web 服务的相应 URL,以指示您是尝试使用实时环境还是沙盒。

请参阅 https://ebay.custhelp.com/app/answers/detail/a_id/861/~/error---webservicedisabledexception

试试这个(实时):

eBayAPIInterfaceClient client = new eBayAPIInterfaceClient();
client.Url = "https://api.ebay.com/wsapi";
// etc...