title: Spring web service dynamic wsdl not generating message for a schema element
body: <p>I have the following schema:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
  xmlns:m="http://ws.mypackage.com" 
  xmlns:xmime="http://www.w3.org/2005/05/xmlmime" elementFormDefault="qualified"
  targetNamespace="http://ws.mypackage.com" 
  attributeFormDefault="unqualified"&gt; 
  
      &lt;xs:element name="downloadMessageRequestSaaj"&gt;
          &lt;xs:complexType/&gt;
      &lt;/xs:element&gt;
  
      &lt;xs:element name="downloadMessageRequest"&gt;
          &lt;xs:complexType/&gt;
      &lt;/xs:element&gt;   
  
      &lt;xs:element name="downloadMessageResponseSaaj" type="m:downloadResponseSaajType" /&gt;
  
      &lt;xs:complexType name="downloadResponseSaajType"&gt;
              &lt;xs:sequence&gt;
                  &lt;xs:element name="requestName" type="xs:string"/&gt;
                  &lt;xs:element name="payLoad"&gt;
                      &lt;xs:complexType&gt;
                          &lt;xs:sequence&gt;
                              &lt;xs:element name="messagePayLoad" type="xs:base64Binary" xmime:expectedContentTypes="multipart/related"/&gt;
                          &lt;/xs:sequence&gt;
                      &lt;/xs:complexType&gt;
                  &lt;/xs:element&gt;
              &lt;/xs:sequence&gt;
       &lt;/xs:complexType&gt;
  
      &lt;xs:element name="downloadMessageResponse" type="m:downloadResponseType" /&gt;
  
      &lt;xs:complexType name="downloadResponseType"&gt;
              &lt;xs:sequence&gt;
                  &lt;xs:element name="requestName" type="xs:string"/&gt;
                  &lt;xs:element name="payLoad"&gt;
                      &lt;xs:complexType&gt;
                          &lt;xs:sequence&gt;
                              &lt;xs:element name="messagePayLoad" type="xs:base64Binary" xmime:expectedContentTypes="multipart/related"/&gt;
                          &lt;/xs:sequence&gt;
                      &lt;/xs:complexType&gt;
                  &lt;/xs:element&gt;
              &lt;/xs:sequence&gt;
       &lt;/xs:complexType&gt;
  
  
       &lt;xs:element name="localDTMRequest"&gt;
          &lt;xs:complexType/&gt;
      &lt;/xs:element&gt;
  
      &lt;xs:element name="localDTMResponse"&gt;
          &lt;xs:complexType&gt;        
              &lt;xs:sequence&gt;
                  &lt;xs:element name="localDTM" type="xs:dateTime"/&gt;
              &lt;/xs:sequence&gt;          
          &lt;/xs:complexType&gt;
      &lt;/xs:element&gt;    
  
  &lt;/xs:schema&gt;
  </code></pre>
  
  <p>And configured Spring to auto-generate the WSDL file as shown below:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;ws:dynamic-wsdl id="serviceDefinition" portTypeName="myService"
          locationUri="http://localhost:8080/springWsTest/webservice"&gt;
          &lt;ws:xsd location="/WEB-INF/schemas/schema.xsd" /&gt;
      &lt;/ws:dynamic-wsdl&gt;
  </code></pre>
  
  <p>The generated WSDL file is missing the "messages" for downloadMessageRequestSaaj and downloadMessageResponseSaaj. Why is that?</p>
  
  <p>Here is the generated wsdl file..</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:sch="http://ws.mypackage.com" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://ws.mypackage.com" targetNamespace="http://ws.mypackage.com"&gt;
    &lt;wsdl:types&gt;
      &lt;xs:schema xmlns:m="http://ws.mypackage.com" xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://ws.mypackage.com"&gt;   
  
      &lt;xs:element name="downloadMessageRequestSaaj"&gt;
          &lt;xs:complexType/&gt;
      &lt;/xs:element&gt;
  
      &lt;xs:element name="downloadMessageRequest"&gt;
          &lt;xs:complexType/&gt;
      &lt;/xs:element&gt;   
  
      &lt;xs:element name="downloadMessageResponseSaaj" type="m:downloadResponseSaajType"/&gt;
  
      &lt;xs:complexType name="downloadResponseSaajType"&gt;
              &lt;xs:sequence&gt;
                  &lt;xs:element name="requestName" type="xs:string"/&gt;
                  &lt;xs:element name="payLoad"&gt;
                      &lt;xs:complexType&gt;
                          &lt;xs:sequence&gt;
                              &lt;xs:element name="messagePayLoad" type="xs:base64Binary" xmime:expectedContentTypes="multipart/related"/&gt;
                          &lt;/xs:sequence&gt;
                      &lt;/xs:complexType&gt;
                  &lt;/xs:element&gt;
              &lt;/xs:sequence&gt;
       &lt;/xs:complexType&gt;
  
      &lt;xs:element name="downloadMessageResponse" type="m:downloadResponseType"/&gt;
  
      &lt;xs:complexType name="downloadResponseType"&gt;
              &lt;xs:sequence&gt;
                  &lt;xs:element name="requestName" type="xs:string"/&gt;
                  &lt;xs:element name="payLoad"&gt;
                      &lt;xs:complexType&gt;
                          &lt;xs:sequence&gt;
                              &lt;xs:element name="messagePayLoad" type="xs:base64Binary" xmime:expectedContentTypes="multipart/related"/&gt;
                          &lt;/xs:sequence&gt;
                      &lt;/xs:complexType&gt;
                  &lt;/xs:element&gt;
              &lt;/xs:sequence&gt;
       &lt;/xs:complexType&gt;
  
  
       &lt;xs:element name="localDTMRequest"&gt;
          &lt;xs:complexType/&gt;
      &lt;/xs:element&gt;
  
      &lt;xs:element name="localDTMResponse"&gt;
          &lt;xs:complexType&gt;        
              &lt;xs:sequence&gt;
                  &lt;xs:element name="localDTM" type="xs:dateTime"/&gt;
              &lt;/xs:sequence&gt;          
          &lt;/xs:complexType&gt;
      &lt;/xs:element&gt;    
  
  &lt;/xs:schema&gt;
    &lt;/wsdl:types&gt;
    &lt;wsdl:message name="localDTMRequest"&gt;
      &lt;wsdl:part element="tns:localDTMRequest" name="localDTMRequest"&gt;
      &lt;/wsdl:part&gt;
    &lt;/wsdl:message&gt;
    &lt;wsdl:message name="localDTMResponse"&gt;
      &lt;wsdl:part element="tns:localDTMResponse" name="localDTMResponse"&gt;
      &lt;/wsdl:part&gt;
    &lt;/wsdl:message&gt;
    &lt;wsdl:message name="downloadMessageRequest"&gt;
      &lt;wsdl:part element="tns:downloadMessageRequest" name="downloadMessageRequest"&gt;
      &lt;/wsdl:part&gt;
    &lt;/wsdl:message&gt;
    &lt;wsdl:message name="downloadMessageResponse"&gt;
      &lt;wsdl:part element="tns:downloadMessageResponse" name="downloadMessageResponse"&gt;
      &lt;/wsdl:part&gt;
    &lt;/wsdl:message&gt;
    &lt;wsdl:portType name="myService"&gt;
      &lt;wsdl:operation name="localDTM"&gt;
        &lt;wsdl:input message="tns:localDTMRequest" name="localDTMRequest"&gt;
      &lt;/wsdl:input&gt;
        &lt;wsdl:output message="tns:localDTMResponse" name="localDTMResponse"&gt;
      &lt;/wsdl:output&gt;
      &lt;/wsdl:operation&gt;
      &lt;wsdl:operation name="downloadMessage"&gt;
        &lt;wsdl:input message="tns:downloadMessageRequest" name="downloadMessageRequest"&gt;
      &lt;/wsdl:input&gt;
        &lt;wsdl:output message="tns:downloadMessageResponse" name="downloadMessageResponse"&gt;
      &lt;/wsdl:output&gt;
      &lt;/wsdl:operation&gt;
    &lt;/wsdl:portType&gt;
    &lt;wsdl:binding name="myServiceSoap11" type="tns:myService"&gt;
      &lt;soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/&gt;
      &lt;wsdl:operation name="localDTM"&gt;
        &lt;soap:operation soapAction=""/&gt;
        &lt;wsdl:input name="localDTMRequest"&gt;
          &lt;soap:body use="literal"/&gt;
        &lt;/wsdl:input&gt;
        &lt;wsdl:output name="localDTMResponse"&gt;
          &lt;soap:body use="literal"/&gt;
        &lt;/wsdl:output&gt;
      &lt;/wsdl:operation&gt;
      &lt;wsdl:operation name="downloadMessage"&gt;
        &lt;soap:operation soapAction=""/&gt;
        &lt;wsdl:input name="downloadMessageRequest"&gt;
          &lt;soap:body use="literal"/&gt;
        &lt;/wsdl:input&gt;
        &lt;wsdl:output name="downloadMessageResponse"&gt;
          &lt;soap:body use="literal"/&gt;
        &lt;/wsdl:output&gt;
      &lt;/wsdl:operation&gt;
    &lt;/wsdl:binding&gt;
    &lt;wsdl:service name="myServiceService"&gt;
      &lt;wsdl:port binding="tns:myServiceSoap11" name="myServiceSoap11"&gt;
        &lt;soap:address location="http://localhost:8080/springWsTest/webservice"/&gt;
      &lt;/wsdl:port&gt;
    &lt;/wsdl:service&gt;
  &lt;/wsdl:definitions&gt;
  </code></pre>
  
  <p>I have gone through the schema file a million times and just cannot see any difference between the messages that are generated and those that are not. Can you see why they are not?</p>