Hi
I tried out the axis castor article by IBM
(http://www-106.ibm.com/developerworks/webservices/library/ws-castor/
). But when I tried to run wsdl2java on the wsdl below, I got the
error:
java.io.IOException: Element {http://w3.ibm.com/schemas/services/2002/11/15/stoc
kquote}getStockQuote is referenced but not defined.
at org.apache.axis.wsdl.symbolTable.SymbolTable.checkForUndefined(Symbol
Table.java:527)
at org.apache.axis.wsdl.symbolTable.SymbolTable.add(SymbolTable.java:422
)
at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.jav
a:408)
at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.jav
a:393)
at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:245)
at java.lang.Thread.run(Unknown Source)
C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\axis\WEB-INF\clas
ses\axisCastor>
I have tried changing the schemaLocation to local directory and
setting the classpath accordingly but it still throws the same error.
I am including my wsdl and xsd file . Please help
Thanks in advance
Krish
wsdl file:
xxxxxxxxxxxxxxxxxx
<definitions
targetNamespace="http://w3.ibm.com/schemas/services/2002/11/15/stockquote/wsdl"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://w3.ibm.com/schemas/services/2002/11/15/stockquote/wsdl"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:types="http://w3.ibm.com/schemas/services/2002/11/15/stockquote"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<types>
<xsd:schema elementFormDefault="qualified"
targetNamespace=
"http://w3.ibm.com/schemas/services/2002/11/15/stockquote/wsdl/importtypes">
<import namespace=
"http://w3.ibm.com/schemas/services/2002/11/15/stockquote"
schemaLocation="http://localhost:8080/StockQuote.xsd" />
</xsd:schema>
</types>
<message name="getStockQuoteReq">
<part name="parameters" element="types:getStockQuote" />
</message>
<message name="getStockQuoteResp">
<part name="parameters" element="types:getStockQuoteResponse" />
</message>
<portType name="StockQuotePortType">
<operation name="getStockQuote">
<input message="tns:getStockQuoteReq" />
<output message="tns:getStockQuoteResp" />
</operation>
</portType>
<binding name="StockQuoteSOAPBinding" type="tns:StockQuotePortType">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
<operation name="getStockQuote">
<soap:operation style="document"
soapAction="getStockQuote" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
</binding>
<service name="StockQuoteService">
<port name="StockQuoteSOAPPort"
binding="tns:StockQuoteSOAPBinding">
<soap:address
location=
"http://localhost:8080/axis/services/StockQuoteService" />
</port>
</service>
</definitions>
schema file:
xxxxxxxxxxxxxxx
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema
targetNamespace="http://w3.ibm.com/schemas/services/2002/11/15/stockquote"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://w3.ibm.com/schemas/services/2002/11/15/stockquote">
<xsd:element name="quote">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="symbol" type="xsd:string"/>
<xsd:element name="volume" type="xsd:integer"/>
<xsd:element name="lastTrade"
type="lastTradeType"/>
<xsd:element name="change" type="changeType"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:complexType name="changeType">
<xsd:sequence>
<xsd:element name="dollar" type="xsd:float"/>
<xsd:element name="percent" type="xsd:float"/>
<xsd:element name="positive" type="xsd:boolean"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="lastTradeType">
<xsd:sequence>
<xsd:element name="price" type="xsd:float"/>
<xsd:element name="date" type="xsd:long"/>
</xsd:sequence>
</xsd:complexType>
<!-- Methods signatures -->
<xsd:element name="getStockQuote">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="symbol" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="getStockQuoteResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="quote"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>