title: SOAP WS - make @WebParam optional
body: <p>I have quite a simple method, which I use in WS API by JAX-WS annotations:</p>
  
  <pre><code>@WebMethod
  public MyResponse sendSingle2(
      @WebParam(name="username") String username,
      @WebParam(name="password") String password,
      @WebParam(name="newParam") String newParam) {
          // the code
      }
  </code></pre>
  
  <p>Now I want newParam to be optional. I mean I want the method still to work not only when parameter is empty in passed xml:</p>
  
  <pre><code>&lt;ws:sendSingle2&gt;
      &lt;username&gt;user&lt;/username&gt;
      &lt;password&gt;pass&lt;/password&gt;
      &lt;newParam&gt;&lt;/newParam&gt;
  &lt;/ws:sendSingle2&gt;
  </code></pre>
  
  <p>but also when it is absent:</p>
  
  <pre><code>&lt;ws:sendSingle2&gt;
      &lt;username&gt;user&lt;/username&gt;
      &lt;password&gt;pass&lt;/password&gt;
  &lt;/ws:sendSingle2&gt;
  </code></pre>
  
  <p>I need it not to break existing API, which works without the new param.</p>