title: Axis2 wsdl2java - parse error
body: <p>I'm trying to generate java classes from wsdl file. Originally this file was used with Axis 1.1 with no problems. Then Axis1 was replaced with Axis2 and now generation isn't working with the following error:</p>
  
  <blockquote>
  <pre><code> [java] Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerat
  </code></pre>
    
    <p>ionException: Error parsing WSDL
         [java]     at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.(Cod
    eGenerationEngine.java:175)
         [java]     at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
         [java]     at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)
         [java] Caused by: org.apache.axis2.AxisFault: There are no parts for fault
    message : {http://www.w3.org/2001/XMLSchema}createPolicyCustomLSPDTOFault
         [java]     at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
         [java]     at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.popul
    ateService(WSDL11ToAxisServiceBuilder.java:411)
         [java]     at org.apache.axis2.description.WSDL11ToAllAxisServicesBuilder.p
    opulateAllServices(WSDL11ToAllAxisServicesBuilder.java:107)
         [java]     at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.(Cod
    eGenerationEngine.java:169)
         [java]     ... 2 more</p>
  </blockquote>
  
  <p>Faulting line from wsdl file:</p>
  
  <pre><code>&lt;wsdl:operation name="createPolicyCustomLSPDTO"&gt;
    &lt;wsdl:input message="tns:createPolicyCustomLSPDTORequest"/&gt;
    &lt;wsdl:output message="tns:createPolicyCustomLSPDTOResponse"/&gt;
    &lt;wsdl:fault name="Fault" message="tns:createPolicyCustomLSPDTOFault"/&gt;
  &lt;/wsdl:operation&gt;
  </code></pre>
  
  <p>createPolicyCustomLSPDTOFault is defined as follows</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;wsdl:definitions
      xmlns="http://www.w3.org/2001/XMLSchema"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:tns="http://webservice.example.com"
      xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
      xmlns:hql="http://hql.webservice.example.com"
      targetNamespace="http://webservice.example.com"
  &gt;
  
      &lt;wsdl:types&gt;
          &lt;xsd:import namespace="http://webservice.example.com" schemaLocation="ServerMessageDTO.xsd"/&gt;
          &lt;xsd:schema
              xmlns:xsd="http://www.w3.org/2001/XMLSchema"
              targetNamespace="http://webservice.example.com"
          &gt;
              &lt;xsd:element name="createPolicyCustomLSPDTOFault" type="tns:ServerMessageDTO"/&gt;
          &lt;/xsd:schema&gt;
      &lt;/wsdl:types&gt;
  </code></pre>
  
  <p>How do I fix this?</p>