title: Is there a way to coerce Axis1 to produce document literal WSDLs and SOAP?
body: <p>I use Apache Axis 1 to serve web services, which automatically converts Java objects into wsdl definitions and soap responses. However it seems that by default Axis serves rpc encoded data by default. Is there a way to coerce it into serving wrapped document literal data instead?</p>
  
  <p>So far the documentation has not helped me much. My service declaration looks like this:</p>
  
  <pre><code>&lt;service name="myservice" provider="java:RPC" use="literal" style="wrapped"&gt;
  
    &lt;parameter name="wsdlTargetNamespace" value="http://www.acme.com/"/&gt;
    &lt;parameter name="className" value="com.acme.MyService" /&gt;
  
    &lt;operation name="doSomething" returnQName="acme:Response"&gt;
      &lt;documentation&gt;Does something.&lt;/documentation&gt;
      &lt;fault name="MyException" type="acme:MyException" class="com.acme.MyException" /&gt;
    &lt;/operation&gt;
  &lt;/service&gt;
  </code></pre>
  
  <p>Apparently I need to declare fault to get Exceptions working <em>almost</em> properly. (See <a href="https://stackoverflow.com/questions/352275/axis-1-4-adds-elements-to-custom-fault-type">this</a> post for dealing with custom exceptions.)</p>
  
  <p>However, this still does not work and will give me an exception as-is. I've discovered that I need to add this static method to each of my objects:</p>
  
  <pre><code>public static void registerTypeMapping(Call call) {
    final String WSDL_TARGET_NAMESPACE = "http://www.acme.com/";
    final QName QNAME = new QName(WSDL_TARGET_NAMESPACE);
    call.registerTypeMapping(Reponse.class, QNAME, 
        new BeanSerializerFactory(Response.class, QNAME), 
        new BeanDeserializerFactory(Response.class, QNAME));
  }
  </code></pre>
  
  <p>This makes the exceptions go away which is not really a good thing because now nothing happens. I do not receive any XML responses from my service after making these changes. Besides that even if this worked it sucks to add weird static methods to all of my objects.</p>
  
  <p>Am I missing anything? What do I really need do to get proper wrapped document literal support out of Axis 1?</p>