客户端从服务器收到 SOAP 错误:身份验证失败 ebay

Client received SOAP Fault from server: Authentication failed ebay

当我尝试 运行 java 应用程序从 ebay 查看商品时 api 我得到了 exp:

com.sun.xml.internal.ws.fault.ServerSOAPFaultException: Client received SOAP Fault from server: Authentication failed : Invalid Application:app key   Please see the server log to find more detail regarding exact cause of the failure.
    at com.sun.xml.internal.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:178)
    at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:124)
    at com.sun.xml.internal.ws.client.sei.StubHandler.readResponse(StubHandler.java:238)
    at com.sun.xml.internal.ws.db.DatabindingImpl.deserializeResponse(DatabindingImpl.java:189)
    at com.sun.xml.internal.ws.db.DatabindingImpl.deserializeResponse(DatabindingImpl.java:276)
    at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:104)
    at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:77)
    at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:147)
    at com.sun.proxy.$Proxy36.findItemsByKeywords(Unknown Source)
    at FindItem.main(FindItem.java:59)

我按照教程中的说明导入了 2 个 jar,但仍然有这个问题, 我从 ebay web of app key 获得了密钥。 我的代码是:

ClientConfig config = new ClientConfig();
config.setApplicationId("MY app key that taken from ebay");

//create a service client
FindingServicePortType serviceClient = FindingServiceClientFactory.getServiceClient(config);

//create request object
FindItemsByKeywordsRequest request = new FindItemsByKeywordsRequest();
//set request parameters
request.setKeywords("harry potter phoenix");
PaginationInput pi = new PaginationInput();
pi.setEntriesPerPage(2);
request.setPaginationInput(pi);

//call service
FindItemsByKeywordsResponse result = serviceClient.findItemsByKeywords(request);

还有一个问题,我怎样才能得到物品的规格? 希望你能帮助解决这个问题。

我认为您提供的用于连接 API 的 AppID 无效。

我的问题是

  1. 您有 eBay 提供的 DevID、AppID 和 CertID 吗?
  2. 如果有,请尝试从 SOAP UI 连接以检查它是否正常工作。