Search code examples
javaweb-servicesjax-ws

WebServices : bare vs wrapped?


I generate some WebServices out of some existing wsdl

I use Maven to do this but some webservices are generated with

@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)  

and the others with

@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.WRAPPED) 

Jaxb or xjc does this automatically ? because i do not have any differences in the wsdls...


Solution

  • BARE webservices are generated when the 'operation' name, the 'message' name and the 'element' name are different in some shape or form. To auto generate your client or service stubs as WRAPPED, all of those three elements must be the same.

    The workaround to that is to write your own stubs and use the @RequestWrapper/@ResponseWrapper annotations.

    PS: All of the portType operations must have a 'wrapped' style request/response. Even the slightest deviation and it will default to BARE.