Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><a href="http://www.coderanch.com/t/501314/Web-Services/java/Simple-Unwrapped-Wrapped-SOAP-messages" rel="noreferrer">This discussion</a> at Java Ranch Forum cleared it for me. Specifically this example made by <strong>Jason Irwin</strong>: </p> <p><strong>BARE</strong> client generated interface (using wsimport):</p> <pre><code>@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE) public interface IMathServer { @WebMethod @WebResult(name = "addNumsResponse") public AddNumsResponse addNums(@WebParam(name = "addNums") AddNums parameters); } </code></pre> <p><strong>WRAPPED</strong> client generated interface (using wsimport):</p> <pre><code>@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.WRAPPED) public interface IMathServer { @WebMethod @WebResult(name = "addNumsResponse") public int addNums(@WebParam(name = "num1") int num1, @WebParam(name = "num2") int num2); } </code></pre> <p>This both pieces of code generate the same message:</p> <pre><code>&lt;S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"&gt; &lt;S:Body&gt; &lt;ns2:addNums xmlns:ns2="http://SoapStyles/"&gt; &lt;num1&gt;1&lt;/num1&gt; &lt;num2&gt;2&lt;/num2&gt; &lt;/ns2:addNums&gt; &lt;/S:Body&gt; &lt;/S:Envelope&gt; </code></pre> <p>As said by <strong>R Srini</strong> in the same discussion what is wrapped are the parameters, not the code. </p> <p>The only difference generating the clients is the way you are going to create the params in the client, but they both are going to generate the same message (wrapped or unwrapped) depending on the service WSDL. </p> <p><strong>With BARE you will have only a top element (parameter) with "sub-parameters" inside. This one BARE will be sent directly (without "wrapping" it). While with WRAPPED you will have all this "sub-parameters" in the first level, and the client automatically wrap them in another top element.</strong></p> <p>Quoting Jason Irwin:</p> <blockquote> <p>Only one parameter was passed ("addNums") and it was "Bare" in the body. In the second, the parameters were "bare" in the code, but "wrapped" at run-time by JAX-WS.</p> </blockquote> <p>Hope this helps!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload