我正在尝试与 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.
有任何想法吗?我的意思是我假设我在这里没有做任何愚蠢的事情:)