Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java SOAP "wsimport" - force wrapped binding from document/literal wrapped WSDL?

The Java 6 JAX-WS "wsimport" utility does a great job of generating a web service skeleton (interface) given a WSDL file but with one personally annoying exception.

When given a WSDL that uses the SOAP Document/literal wrapped style (also described here) it generates a service interface with a "bare" SOAP binding parameter style (with multiple arguments and return values expanded as "holder" objects in the method signatures) instead of the simple wrapped parameter and return value specified by the WSDL. Other tools, such as Axis2 wsdl2java simply use the wrapper elements as the input parameter and return value instead of automatically "unwrapping" them.

Is it possible to tell "wsimport" to keep the SOAP binding parameters as "wrapped" instead of "bare"?

like image 336
maerics Avatar asked Aug 11 '11 20:08

maerics


1 Answers

AFAIK, you'd need to specify a custom binding file to disable the wrapper style:

<bindings
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    wsdlLocation="OperationService.wsdl"
    xmlns="http://java.sun.com/xml/ns/jaxws">
        <!-- Disable default wrapper style -->
        <enableWrapperStyle>false</enableWrapperStyle>
</bindings>

and then invoke wsimport

$ wsimport -b binding.xml OperationService.wsdl
like image 63
beny23 Avatar answered Sep 17 '22 04:09

beny23