1

我从 Intellij 中的 Amazon WSDL 生成了Java 代码。它似乎工作得很好。但是,当我按照此页面上的教程进行操作时,我遇到了一个问题。Java 代码的最后一行是从 AWSECommerceServicePortType 类调用方法 itemSearch。为该方法生成的唯一方法描述是

@WebMethod(operationName = "ItemSearch", action = "http://soap.amazon.com/ItemSearch")
             @RequestWrapper(localName = "ItemSearch", targetNamespace = "http://webservices.amazon.com/AWSECommerceService/2011-08-01", className = "com.shopit.amazon.ItemSearch")
             @ResponseWrapper(localName = "ItemSearchResponse", targetNamespace = "http://webservices.amazon.com/AWSECommerceService/2011-08-01", className = "com.shopit.amazon.ItemSearchResponse")
             public void itemSearch(
    @WebParam(name = "MarketplaceDomain", targetNamespace = "http://webservices.amazon.com/AWSECommerceService/2011-08-01")
    String marketplaceDomain,
    @WebParam(name = "AWSAccessKeyId", targetNamespace = "http://webservices.amazon.com/AWSECommerceService/2011-08-01")
    String awsAccessKeyId,
    @WebParam(name = "AssociateTag", targetNamespace = "http://webservices.amazon.com/AWSECommerceService/2011-08-01")
    String associateTag,
    @WebParam(name = "XMLEscaping", targetNamespace = "http://webservices.amazon.com/AWSECommerceService/2011-08-01")
    String xmlEscaping,
    @WebParam(name = "Validate", targetNamespace = "http://webservices.amazon.com/AWSECommerceService/2011-08-01")
    String validate,
    @WebParam(name = "Shared", targetNamespace = "http://webservices.amazon.com/AWSECommerceService/2011-08-01")
    ItemSearchRequest shared,
    @WebParam(name = "Request", targetNamespace = "http://webservices.amazon.com/AWSECommerceService/2011-08-01")
    List<ItemSearchRequest> request,
    @WebParam(name = "OperationRequest", targetNamespace = "http://webservices.amazon.com/AWSECommerceService/2011-08-01", mode = WebParam.Mode.OUT)
    Holder<OperationRequest> operationRequest,
    @WebParam(name = "Items", targetNamespace = "http://webservices.amazon.com/AWSECommerceService/2011-08-01", mode = WebParam.Mode.OUT)
    Holder<List<Items>> items);

它要求我传递比示例中更多的参数,并且在编译时会给出错误。我是否需要使用不同的设置来生成 java 代码。

4

2 回答 2

0

您可以将 amazon-ecs.jar 用于亚马逊产品 api

于 2013-12-15T22:17:29.453 回答
-2

我认为最好使用官方的 aws sdk for java:http ://aws.amazon.com/sdkforjava/

于 2013-03-29T06:27:36.363 回答