On Saturday 01 March 2008, Michael Nelson wrote: > For non-trivial methods, WSDL2Java forces me to deal with > request/response wrapper classes in the client code it generates (see > the 1st method as compared to the 2nd method). Is there a way to > prevent this?
Probably not. There are very explicit rules about when we can unwrap the type into the second form. Section 2.3.1.2 of the JAX-WS spec: (i) The operation’s input and output messages (if present) each contain only a single part (ii) The input message part refers to a global element declaration whose localname is equal to the operation name (iii) The output message (if present) part refers to a global element declaration (iv) The elements referred to by the input and output message (if present) parts (henceforth referred to as wrapper elements) are both complex types defined using the xsd:sequence compositor (v) The wrapper elements only contain child elements, they MUST not contain other structures such as wildcards (element or attribute), xsd:choice, substitution groups (element references are not permitted) or attributes; furthermore, they MUST not be nillable. Hope that helps explan things a bit. Dan > > Thanks, > -mike > > Examples: > > @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE) > @WebResult(name = "getCustomerResponse", targetNamespace = " > http://customer.acme.com", partName = "parameters") > @WebMethod > public com.acme.customer.GetCustomerResponse getCustomer( > @WebParam(partName = "parameters", name = "getCustomer", > targetNamespace = "http://customer.acme.com") > GetCustomer parameters > ) throws CustomerNotFoundFault; > > @RequestWrapper(localName = "deleteCustomer2", targetNamespace = " > http://customer.acme.com", className = > "com.acme.customer.DeleteCustomer2") @ResponseWrapper(localName = > "deleteCustomer2Response", targetNamespace = > "http://customer.acme.com", className = " > com.acme.customer.DeleteCustomer2Response") > @WebMethod > public void deleteCustomer2( > @WebParam(name = "id", targetNamespace = > "http://customer.acme.com") long id > ); -- J. Daniel Kulp Principal Engineer, IONA [EMAIL PROTECTED] http://www.dankulp.com/blog
