C# eBayAPIInterfaceClient 错误:Web 服务 eBayAPI 未正确配置或未找到并被禁用
我正在尝试使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看来您忘记设置网址了。您需要指定 Web 服务的适当 URL,以指示您是尝试使用实时环境还是沙箱。
请参阅 https://ebay.custhelp.com/ app/answers/detail/a_id/861/~/error---webservicedisabledexception
试试这个(实时):
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):