Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

wsimport not using complex input types

When I use wsimport to generate proxies for some services, the resulting method signature for each port does not seem to use the complex types specified in the WSDL; but yet I've noticed that with some other services it does.

This has happened on multiple services, but the most recent example is Amazon's AWSEConsumerService (link to WSDL). When I generate the service proxy code using wsimport, I get method signatures such as the following for each port.

@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);

I would expect this method take the single complex parameter specified by the WSDL (in this case an ItemLookup object). Am I fundamentally misunderstanding something or is there something abnormal happening with the code generation?

like image 296
Jeffrey P Avatar asked Nov 04 '11 17:11

Jeffrey P


1 Answers

I ran into a similar problem with AWS. I followed the API setup description for Java (page 10 of this pdf

In step 2 (it says for Eclipse 3.2) you should create a file (sugessted name is jaxws-custom.xml) with the following content:

<jaxws:bindings wsdlLocation="http://webservices.amazon.com/AWSECommerceService/AWSECommerceService.wsdl" xmlns:jaxws="http://java.sun.com/xml/ns/jaxws">
 <jaxws:enableWrapperStyle>false</jaxws:enableWrapperStyle>
</jaxws:bindings>

and then run the wsimport command with the option -b jaxws-custom.xml

I haven't figured out what exactly the problem is, but that did the trick for me.

like image 187
Claude Avatar answered Nov 11 '22 21:11

Claude