C# eBayAPIInterfaceClient 错误:Web 服务 eBayAPI 未正确配置或未找到并被禁用

发布于 2024-11-07 23:11:22 字数 1126 浏览 2 评论 0原文

我正在尝试使用 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:Web 服务 eBayAPI 未正确配置或未找到并已禁用。

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

I am trying to interface with the ebay API in C#. The sample code in C# that they give to get the time works fine. This seems to be using a "web reference" in VS (I'm using 2008 Express).

When I have a go by adding a "service reference" to my project I have to use the eBayAPIInterfaceClient in the following way (I can't find a reference to any ebayAPIInterfaceService like their example uses):

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

Anyway, it doesn't work (obviously I am using the same settings such as AppID, token etc.). It gives me back:

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

Any ideas? I mean I'm assuming I'm not doing anything really dumb here :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

标点 2024-11-14 23:11:22

看来您忘记设置网址了。您需要指定 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...

Looks like you forgot to set the url. You need to indicate the appropriate url for the webservice, to indicate whether you're trying to use the live environment or the sandbox.

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

Try this instead (for live):

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

// etc...
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文