当我使用 wsimport 为某些服务生成代理时,生成的每个端口的方法签名似乎没有使用 WSDL 中指定的复杂类型;但我注意到它与其他一些服务一样。
这发生在多项服务上,但最近的例子是亚马逊的 AWSEConsumerService(链接到 WSDL)。当我使用 wsimport 生成服务代理代码时,我会为每个端口获得如下方法签名。
@WebMethod(operationName = "ItemLookup", action = "http://soap.amazon.com/ItemLookup")
@RequestWrapper(localName = "ItemLookup", targetNamespace = "http://webservices.amazon.com/AWSECommerceService/2011-08-01", className = "com.aws.CommerceService.ItemLookup")
@ResponseWrapper(localName = "ItemLookupResponse", targetNamespace = "http://webservices.amazon.com/AWSECommerceService/2011-08-01", className = "com.aws.CommerceService.ItemLookupResponse")
public void itemLookup(
@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 = "Validate", targetNamespace = "http://webservices.amazon.com/AWSECommerceService/2011-08-01")
String validate,
@WebParam(name = "XMLEscaping", targetNamespace = "http://webservices.amazon.com/AWSECommerceService/2011-08-01")
String xmlEscaping,
@WebParam(name = "Shared", targetNamespace = "http://webservices.amazon.com/AWSECommerceService/2011-08-01")
ItemLookupRequest shared,
@WebParam(name = "Request", targetNamespace = "http://webservices.amazon.com/AWSECommerceService/2011-08-01")
List<ItemLookupRequest> 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);
我希望此方法采用 WSDL 指定的单个复杂参数(在本例中为 ItemLookup 对象)。我是从根本上误解了什么还是代码生成发生了异常?