title: SOAP Response Schema
body: <p>I am exploring SOAP WS right now and I created a very simple
  class that I am exposing as a Web Service.</p>
  
  <pre><code>@WebService
  public class StudentWS {   
      @WebMethod
      public Student getStudent(){
        Student stud = new Student();
        stud.setId(99);
        stud.setFirstName("John");
        stud.setLastName("Doe");
        stud.setGpa(2.1);
        return stud;
      }
  }
  </code></pre>
  
  <p>When I call this Web Service, the returned SOAP response follows
  this format.</p>
  
  <pre><code>&lt;S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"&gt;
     &lt;S:Body&gt;
        &lt;ns2:getStudentResponse xmlns:ns2="http://annotation/"&gt;
           &lt;return&gt;
              &lt;firstName&gt;John&lt;/firstName&gt;
              &lt;gpa&gt;2.1&lt;/gpa&gt;
              &lt;id&gt;99&lt;/id&gt;
              &lt;lastName&gt;Doe&lt;/lastName&gt;
           &lt;/return&gt;
        &lt;/ns2:getStudentResponse&gt;
     &lt;/S:Body&gt;
  &lt;/S:Envelope&gt;
  </code></pre>
  
  <p>My question is, is there some way that I could influence the SOAP response to follow some sort of Schema like below.</p>
  
  <pre><code>&lt;S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"&gt;
     &lt;S:Body&gt;
        &lt;ns2:getStudentResponse xmlns:ns2="http://annotation/"&gt;
          &lt;student gpa="2.1"&gt;
              &lt;id&gt;99&lt;/id&gt;
              &lt;name&gt;
                  &lt;firstName&gt;&lt;/firstName&gt;
                  &lt;lastName&gt;&lt;/lastName&gt;
              &lt;/name&gt;
          &lt;/student&gt;
        &lt;/ns2:getStudentResponse&gt;
     &lt;/S:Body&gt;
  &lt;/S:Envelope&gt;
  </code></pre>
  
  <p>My data comes from a POJO class like this.</p>
  
  <pre><code>@XmlRootElement
  public class Student {
      private int id;
      private String firstName;
      private String lastName;
      private double gpa;
      //getters and setters
  }
  </code></pre>
  
  <p>Thanks.</p>