title: How to force JAXB to write the xsi:type of a javax.jws.WebParam when sending a request (CXF implementation)
body: <p>I've generated classes using wsdl2java on a wsdl, the service interface looks like this</p>
  
  <pre><code>@WebService(targetNamespace = "http://www.sii.example.it/SWG1", name = "SWG1")
  @XmlSeeAlso({it.au.switchgas.swg1.messaggio.ObjectFactory.class, it.au.switchgas.swg1.strutturegenerali.ObjectFactory.class, it.au.switchgas.strutturegas.ObjectFactory.class, it.au.switchgas.swg1.flussi.ObjectFactory.class})
  @SOAPBinding(style = SOAPBinding.Style.RPC)
  public interface SWG1 {
  
      @WebMethod(operationName = "SWG1.0050", action = "SWG1.0050")
      @WebResult(name = "MessaggioSII", targetNamespace = "http://www.sii.example.it/SWG1", partName = "MessaggioSII")
      public it.au.switchgas.swg1.messaggio.AmmissibilitaRichiestaMessaggioSIIType swg10050(
          @WebParam(partName = "MessaggioSII", name = "MessaggioSII")
          it.au.switchgas.swg1.messaggio.RichiestaSwitchingMessaggioSIIType messaggioSII
      );
  }
  </code></pre>
  
  <p>the generated request is like this</p>
  
  <pre><code>&lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt;
      &lt;soap:Body&gt;
          &lt;ns1:SWG1.0050 xmlns:ns1="http://www.sii.example.it/SWG1"&gt;
              &lt;MessaggioSII 
                  xmlns:ns5="http://www.example.it/schemas/2010/SII_AU/MessaggioSII"&gt;
                      &lt;ns5:RichiestaSII xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns5:RichiestaSwitchingRichiestaSIIType"&gt;
                      &lt;ns5:AzioneRichiesta&gt;
                          &lt;ns5:Servizio&gt;XYZ&lt;/ns5:Servizio&gt;
                          &lt;ns5:Operazione&gt;ABC&lt;/ns5:Operazione&gt;
                      &lt;/ns5:AzioneRichiesta&gt;
                      &lt;ns5:Erogatore&gt;AXX&lt;/ns5:Erogatore&gt;
                      &lt;ns5:Fruitore&gt;UXXXXX&lt;/ns5:Fruitore&gt;
                  &lt;/ns5:RichiestaSII&gt;
                  &lt;ns5:DatiSII xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns5:RichiestaSwitchingDatiSIIType"&gt;
                  &lt;/ns5:DatiSII&gt;
              &lt;/MessaggioSII&gt;
          &lt;/ns1:SWG1.0050&gt;
      &lt;/soap:Body&gt;
  &lt;/soap:Envelope&gt;
  </code></pre>
  
  <p>the server (which I can not modify in any way) rejects the requests complaining about the missing <code>xsi:type</code> of the <code>MessaggioSII</code> element and requires this syntax</p>
  
  <pre><code>&lt;MessaggioSII xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns5:RichiestaSwitchingDatiSIIType"
  xmlns:ns5="http://www.example.it/schemas/2010/SII_AU/MessaggioSII"&gt;
  
  </code></pre>
  
  <p>Is there any way to force CXF/JAXB to write the xsi:type attribute?
  I've looked at <a href="https://cxf.apache.org/docs/transformationfeature.html" rel="nofollow noreferrer">cxf documentation</a> for transformations, sadly it's not very clear. I'd rather not modify the generated classes but I'm open to it.</p>