You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by ja...@accenture.com on 2004/01/28 05:26:06 UTC

WSDL2Java java.io.IOException Type ... is referenced but not defined

I am having trouble generating a set of Java classes from an existing WSDL file that was originally generated for use in WebLogic Server 6.1. We are looking to duplicate the Web Service functionality in Axis/Tomcat. The WSDL and the generated SOAP messages must remain the same. It's the Java app that must work around this requirement. When I run the WSDL2Java app, I receive the following exception:
 
#>java -cp %AXISCLASSPATH%;. org.apache.axis.wsdl.WSDL2Java MeterEvent.wsdl
java.io.IOException: Type {java:com.dsn.centralizedmeter.domain}MeterEvent is referenced but not defined.
        at org.apache.axis.wsdl.symbolTable.SymbolTable.checkForUndefined(SymbolTable.java:667)
        at org.apache.axis.wsdl.symbolTable.SymbolTable.add(SymbolTable.java:547)
        at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:521)
        at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:498)
        at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:374)
        at java.lang.Thread.run(Thread.java:534)

This is the WSDL file I am using:
<?xml version="1.0" ?> 
  <definitions name="ADSN_MeterEventService" 
               targetNamespace="http://localhost:8081/MeterEventService/MeterEventService.wsdl" 
               xmlns="http://schemas.xmlsoap.org/wsdl/" 
               xmlns:tns="http://localhost:8081/MeterEventService/MeterEventService.wsdl" 
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
               xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
               xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
               xmlns:domain="java:com.dsn.centralizedmeter.domain">
    <types>
      <schema targetNamespace="java:com.dsn.centralizedmeter.domain" 
              xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
              xmlns:soap="http://schemas.xmlsoap.org/soap/encoding/" 
              xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
        <complexType name="MeterEvent">
          <element name="partyId" type="xsd:int" maxOccurs="1" minOccurs="1" /> 
          <element name="type" type="xsd:string" maxOccurs="1" minOccurs="1" /> 
          <element name="dateTime" type="xsd:int" maxOccurs="1" minOccurs="1" /> 
          <element name="product" type="xsd:string" maxOccurs="1" minOccurs="0" /> 
          <element name="source" type="xsd:string" maxOccurs="1" minOccurs="0" /> 
          <element name="market" type="xsd:string" maxOccurs="1" minOccurs="0" /> 
          <element name="segment" type="xsd:string" maxOccurs="1" minOccurs="0" /> 
          <element name="channel" type="xsd:string" maxOccurs="1" minOccurs="0" /> 
          <element name="orderItem" type="xsd:string" maxOccurs="1" minOccurs="0" /> 
          <element name="promotion" type="xsd:string" maxOccurs="1" minOccurs="0" /> 
          <element name="lifespan" type="xsd:long" maxOccurs="1" minOccurs="0" /> 
          <element name="quantity" type="xsd:int" maxOccurs="1" minOccurs="0" /> 
          <element name="media" type="xsd:string" maxOccurs="1" minOccurs="0" /> 
          <element name="size" type="xsd:double" maxOccurs="1" minOccurs="0" /> 
          <element name="price" type="xsd:double" maxOccurs="1" minOccurs="0" /> 
          <element name="transport" type="xsd:string" maxOccurs="1" minOccurs="0" /> 
          <element name="requestLocation" type="xsd:string" maxOccurs="1" minOccurs="0" /> 
          <element name="fulfillmentLocation" type="xsd:string" maxOccurs="1" minOccurs="0" /> 
        </complexType>
      </schema>
    </types>

    <message name="sendRequest">
      <part name="message" type="domain:MeterEvent" /> 
    </message>

    <message name="sendResponse">
      <part name="responseCode" type="xsd:int" /> 
    </message>

    <portType name="MeterEventServicePortType">
      <operation name="submitEvent">
        <input message="tns:sendRequest" /> 
        <output message="tns:sendResponse" /> 
      </operation>
    </portType>
  
    <binding name="MeterEventServiceBinding" type="tns:MeterEventServicePortType">
      <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http/" /> 
      <operation name="submitEvent">
      <soap:operation soapAction="urn:submitEvent" /> 
        <input>
          <soap:body use="encoded" 
                     namespace="urn:MeterEventService" 
                     encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> 
        </input>
        <output>
          <soap:body use="encoded" 
                     namespace="urn:MeterEventService" 
                     encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> 
        </output>
      </operation>
    </binding>
  
  <service name="MeterEventService">
    <documentation>This service is a real-time event level web service. This is used in 
                   conjunction with other sub-components of the Event Collection component.
    </documentation> 
    <port name="MeterEventServicePort" binding="tns:MeterEventServiceBinding">
      <soap:address location="http://localhost:8081/MeterEventService/submitevent" /> 
    </port>
  </service>
</definitions>

com.dsn.centralizedmeter.domain.MeterEvent is a Java class that maps to the MeterEvent complexType from the WSDL. If I change
    <message name="sendRequest">
      <part name="message" type="domain:MeterEvent" /> 
    </message>
to
    <message name="sendRequest">
      <part name="message" type="xsd:String" /> 
    </message>
to remove the reference to the complexType, WSDL2Java works without problems.
 
Can anyone tell me what I am missing or doing wrong in this scenario? I have found very little documentation regarding using custom Java classes as SOAP message types.
 
Thanks for your help.
 
--Jason
Jason Thompson


This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information.  If you have received it in error, please notify the sender immediately and delete the original.  Any other use of the email by you is prohibited.