'How can I resolve the binding failed error in doing wsdl2java

I am trying to (re)generate code again from a preexisting WSDL. I am not able to use wsimport as it is giving binding failed error. So I tried WSDL validator from CXF. It gives this error. Please see below for my WSDL.

WSDLValidator Error :
 Summary:  Failures: 1, Warnings: 0

 <<< ERROR!
Part <scheduledJob> in Message <{http://webservices.jobs.batch.prompt.com/}ImmJobWSIF_getScheduledJobResponse> referenced Type <{http://webservices.jobs.batch.prompt.com/}ScheduledJob> can not be found in the schemas

Here is the WSDL. Inline schema looks good comparing to some online schemas. I have no clue.

<?xml version="1.0" encoding="UTF-8"?>

<definitions    name="ImmJobWS" 
                xmlns="http://schemas.xmlsoap.org/wsdl/"
                xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
                xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
                targetNamespace="http://webservices.jobs.batch.prompt.com/"             
                xmlns:tns="http://webservices.jobs.batch.prompt.com/"
                
                xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" 
                xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
  

    <types>
        <xsd:schema elementFormDefault="qualified" 
        targetNamespace="http://webservices.jobs.batch.prompt.com/" 
        xmlns="http://webservices.jobs.batch.prompt.com/">
            <xsd:element name="ScheduledJob">
               <xsd:complexType>
                 <xsd:sequence>              
                    <xsd:element name="jobId" type="xsd:int"/>
                    <xsd:element name="jobName" type="xsd:string"/>
                    <xsd:element name="jobCategoryName" type="xsd:string"/>
                    <xsd:element name="jobClassName" type="xsd:string"/>
                    <xsd:element name="jobStatus" type="xsd:string"/>
                    <xsd:element name="nextExecutionDate" type="xsd:dateTime"/>                         
                 </xsd:sequence>
               </xsd:complexType>
            </xsd:element>
           </xsd:schema>
    </types>
    
  <message name="ImmJobWSIF_getScheduledJob">
    <part name="job_id" type="xsd:int"/>    
    <part name="user_ident" type="xsd:string"/>
  </message>
  <message name="ImmJobWSIF_getScheduledJobResponse">    
    <part name="scheduledJob" type="tns:ScheduledJob"/>
  </message>
  
  <message name="ImmJobWSIF_startSched">        
    <part name="user_ident" type="xsd:string"/>
  </message>
  <message name="ImmJobWSIF_startSchedResponse">
    <part name="result" type="xsd:string"/>
  </message>
  
  <message name="ImmJobWSIF_stopSched">        
    <part name="user_ident" type="xsd:string"/>
  </message>
  <message name="ImmJobWSIF_stopSchedResponse">
    <part name="result" type="xsd:string"/>
  </message>
  
  <portType name="ImmJobWSIF">
    
    <operation name="getScheduledJob" parameterOrder="job_id user_ident">
      <input message="tns:ImmJobWSIF_getScheduledJob"/>
      <output message="tns:ImmJobWSIF_getScheduledJobResponse"/>
    </operation>

    <operation name="startSched" parameterOrder="user_ident">
      <input message="tns:ImmJobWSIF_startSched"/>
      <output message="tns:ImmJobWSIF_startSchedResponse"/>
    </operation>
    
    <operation name="stopSched" parameterOrder="user_ident">
      <input message="tns:ImmJobWSIF_stopSched"/>
      <output message="tns:ImmJobWSIF_stopSchedResponse"/>
    </operation>    
    
  </portType>
  <binding name="ImmJobWSIFBinding" type="tns:ImmJobWSIF">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
        style="rpc" />
    
    <operation name="getScheduledJob">
        <soap:operation soapAction="" />
        <input>
            <soap:body use="literal" namespace="http://webservices.jobs.batch.prompt.com/" />
        </input>
        <output>
            <soap:body use="literal" namespace="http://webservices.jobs.batch.prompt.com/" />
        </output>
    </operation>
    
    <operation name="startSched">
        <soap:operation soapAction="" />
        <input>
            <soap:body use="literal" namespace="http://webservices.jobs.batch.prompt.com/" />
        </input>
        <output>
            <soap:body use="literal" namespace="http://webservices.jobs.batch.prompt.com/" />
        </output>
    </operation>
    
    <operation name="stopSched">
        <soap:operation soapAction="" />
        <input>
            <soap:body use="literal" namespace="http://webservices.jobs.batch.prompt.com/" />
        </input>
        <output>
            <soap:body use="literal" namespace="http://webservices.jobs.batch.prompt.com/" />
        </output>
    </operation>
    
  </binding>
  <service name="ImmJobWS">
    <port name="ImmJobWSIFPort" binding="tns:ImmJobWSIFBinding">
      <soap:address location="http://vm-prover.maleri.com:8782/projImmJobs/ImmJobWS"/>
    </port>
  </service>
</definitions>



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source