This statement:  <part name="body" element="xsd1:Ping" />

means that the part references an element type:

<element name="Ping".../>

There is no such beast in your WSDL. Your WSDL has a complexType called "Ping", so changing "element=" to "type=" finds the complex type.

Russell Butek
[EMAIL PROTECTED]

Please respond to [EMAIL PROTECTED]

To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
cc:
Subject: WSDL Question



I'm having a problem with the following wsdl example:

    <?xml version="1.0" ?>
    <definitions name="urn:FooBar"
      <!-- type defs -->
      <types>
        <xsd0:schema targetNamespace="urn:FooBar2"
        xmlns:xsd0="
        http://www.w3.org/1999/XMLSchema" >
          <xsd0:complexType name="Status">
          <xsd0:sequence>
            <xsd0:element name="Status" type="xsd0:string" />
            </xsd0:sequence>
          </xsd0:complexType>
          <xsd0:complexType name="Ping">
            <xsd0:sequence>
            <xsd0:element name="Ping" type="xsd0:string" />
          </xsd0:sequence>
          </xsd0:complexType>
      </xsd0:schema>
      </types>


      <!-- message declns -->
      <message name="PingRequest">

      <part name="body" element="xsd1:Ping" />
      </message>
      <message name="PingResponse">

      <part name="body" element="xsd1:Status" />
      </message>


      <!-- port type declns -->
      <portType name="FooBar">
        <operation name="ping">
        <input message="tns:PingRequest"/>
        <output message="tns:PingResponse"/>
      </operation>
      </portType>


      <!-- binding declns -->
      <binding name="FooBarSOAPBinding" type="tns:FooBar">
        <soap:binding style="document"
        transport="
        http://schemas.xmlsoap.org/soap/http"/>
          <operation name="ping">
          <soap:operation soapAction=""/>
          <input>
              <soap:body use="literal"
              namespace="urn:FooBar2" />
            </input>
            <output>
              <soap:body use="literal"
              namespace="urn:FooBar2" />
          </output>
          </operation>
      </binding>

      <!-- service decln -->
      <service name="FooBarService">
        <port name="FooBar" binding="tns:FooBarSOAPBinding">
        <soap:address
location="http://localhost:8080/axis/services/FooBar"/>
</port>
      </service>
    </definitions>
When I issue the following command:

$ java org.apache.axis.wsdl.WSDL2Java -s -d Session -Nurn:FooBar2=mypkg
blah.wsdl

I get the following exception:
    java.io.IOException: Type urn:FooBar2:Ping is referenced but not defined.
    at
org.apache.axis.wsdl.toJava.SymbolTable.checkForUndefined(SymbolTable.java:4
05)

at
org.apache.axis.wsdl.toJava.SymbolTable.add(SymbolTable.java:331)
          at org.apache.axis.wsdl.toJava.Emitter.emit(Emitter.java:188)
          at org.apache.axis.wsdl.toJava.Emitter.emit(Emitter.java:155)
          at
org.apache.axis.wsdl.WSDL2Java$WSDLRunnable.run(WSDL2Java.java:725)
at java.lang.Thread.run(Unknown Source)


If I change the message-type attribute from 'element' to 'type' it works!?!


Any help would be appreciated.

Thanks,

Jeff Edwards
[EMAIL PROTECTED]

Reply via email to