title: Return an object on wsdl response
body: <p><em>This is part of <a href="https://stackoverflow.com/questions/40173994/message-part-myclass-was-not-recognized-does-it-exist-in-service-wsdl">that question</a>.</em></p>
  
  <p>I want to integrate one system and the system strong required <strong>input/output</strong> params. The system works by wsdl. That's why I created a <code>web-service</code> on <code>java</code> :</p>
  
  <pre><code>import javax.jws.WebMethod;
  import javax.jws.WebParam;
  import javax.jws.WebService;
  import javax.jws.soap.SOAPBinding;
  import java.util.Date;
  
  @SOAPBinding(style=SOAPBinding.Style.DOCUMENT)
  public class WebServices {  
  
      @WebMethod
      public PerformTransactionResult Test2(){
          PerformTransactionResult performTransactionResult = new PerformTransactionResult();
          performTransactionResult.setErrorMsg("test");
          return performTransactionResult;
      }
  }
  </code></pre>
  
  <p>my PerformTransactionResult class is: </p>
  
  <pre><code>import org.apache.cxf.aegis.type.java5.XmlType;    
  import javax.xml.bind.annotation.XmlAccessType;
  import javax.xml.bind.annotation.XmlAccessorType;
  import javax.xml.bind.annotation.XmlRootElement;
  
  @XmlRootElement(name = "PerformTransactionResult")
  @XmlAccessorType(XmlAccessType.FIELD)
  @XmlType(name = "PerformTransactionResult")
  public class PerformTransactionResult {    
  
      private String errorMsg;
  
      public String getErrorMsg() {
          return errorMsg;
      }
  
      public void setErrorMsg(String errorMsg) {
          this.errorMsg = errorMsg;
      }  
  
  }
  </code></pre>
  
  <p>System, which I'm integrating want to get response like that:</p>
  
  <pre><code>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"&gt;
      &lt;s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
          &lt;uws:PerformTransactionResult xmlns:uws="http://uws.provider.com/"&gt;
              &lt;errorMsg&gt;Ok&lt;/errorMsg&gt;     
          &lt;/uws:PerformTransactionResult&gt;
      &lt;/s:Body&gt;
  &lt;/s:Envelope&gt;
  </code></pre>
  
  <p>My <code>web-service</code> is getting response:</p>
  
  <pre><code>&lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt;
      &lt;soap:Body&gt;
          &lt;ns1:Test2Response xmlns:ns1="http://wservices.myhost.lan/"&gt;
              &lt;return xmlns:ns2="http://wservices.myhost.lan/"&gt;
                  &lt;errorMsg&gt;test&lt;/errorMsg&gt;
              &lt;/return&gt;
          &lt;/ns1:Test2Response&gt;
      &lt;/soap:Body&gt;
  &lt;/soap:Envelope&gt;
  </code></pre>
  
  <p>As you see, response should return <code>PerformTransactionResult</code>, not <code>Test2Response</code>. How to I implement that task ?</p>