Hello,

Both wsdl2ws (Axis C/C++ 1.5) and wsdl2java (Axis Java 1.3) fail on the
first example (StockQuote; file attached) of
http://www.w3.org/TR/wsdl
The environmemnt for completeness is Win2K with Java 1.5.0_05.
The problem is that the wsdl2xxx cannot cope with element tags without type
attributes.
The C/C++ wsdl2ws Tool first gives warnings (note the gt sign in front)
java -cp C:\Programme\axis-c-1-5-win32\lib\axis\wsdl2ws.jar;...
org.apache.axis.wsdl.wsdl2ws.WSDL2Ws -ocpp -sclient tro.wsdl
ignoring anonymous type >TradePrice
ignoring anonymous type >TradePriceRequest
and then indeed doesn't generate any source code for TradePrice and
TradePriceRequest.
As i wrote in
http://marc.theaimsgroup.com/?l=axis-c-dev&m=113273914320619&w=2 (with full
example)
with more complex WSDL corrupt C++ source code is generated in this case
declaring and referencing items like (note again the gt sign)
class >t_Warning_Description;
With wsdl2java i get Java source code like (TradePrice.java)
typeDesc.setXmlType(new
javax.xml.namespace.QName("http://example.com/stockquote.xsd";,
">TradePrice"));
again with the infamous gt sign.
To fix this, i can either change
           <element name="TradePrice">
              <complexType>
                  <all>
                      <element name="price" type="float"/>
                  </all>
              </complexType>
to
           <complexType name="t_TradePrice">
                  <all>
                      <element name="price" type="float"/>
                  </all>
          </complexType>
            <element name="TradePrice" type="xsd1:t_TradePrice"/>
or to
           <complexType name="TradePrice">
                  <all>
                      <element name="price" type="float"/>
                  </all>
          </complexType>
and in that case change
       <part name="body" element="xsd1:TradePrice"/>
to
       <part name="body" type="xsd1:TradePrice"/>

Is this a known problem?
Note, that in the W3 example i had to make two small corrections to get it
working:
- Change StockQuoteSoapBinding to StockQuoteBinding
- Replace http://www.w3.org/2000/10/XMLSchema with
http://www.w3.org/2001/XMLSchema

Best regards

Franz

Dr. Franz Fehringer (Dipl. Math.)
____________________________________
ISO Software Systeme
Eichendorffstrasse 29
90491 Nürnberg
Deutschland

Tel. : +49/(911) - 99594-0
Fax  : +49/(911) - 99594-580

mailto:[EMAIL PROTECTED]
http://www.isogmbh.de
<?xml version="1.0"?>
<definitions name="StockQuote"

targetNamespace="http://example.com/stockquote.wsdl";
          xmlns:tns="http://example.com/stockquote.wsdl";
          xmlns:xsd1="http://example.com/stockquote.xsd";
          xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
          xmlns="http://schemas.xmlsoap.org/wsdl/";>

    <types>
       <schema targetNamespace="http://example.com/stockquote.xsd";
              xmlns="http://www.w3.org/2001/XMLSchema";>
           <complexType name="t_TradePriceRequest">
                  <all>
                      <element name="tickerSymbol" type="string"/>
                  </all>
           </complexType>
	   <element name="TradePriceRequest" type="xsd1:t_TradePriceRequest"/>
           <complexType name="t_TradePrice">
                  <all>
                      <element name="price" type="float"/>
                  </all>
          </complexType>
	  <element name="TradePrice" type="xsd1:t_TradePrice"/>
       </schema>
    </types>

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

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

    <portType name="StockQuotePortType">
        <operation name="GetLastTradePrice">
           <input message="tns:GetLastTradePriceInput"/>
           <output message="tns:GetLastTradePriceOutput"/>
        </operation>
    </portType>

    <binding name="StockQuoteBinding" type="tns:StockQuotePortType">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="GetLastTradePrice">
           <soap:operation soapAction="http://example.com/GetLastTradePrice"/>
           <input>
               <soap:body use="literal"/>
           </input>
           <output>
               <soap:body use="literal"/>
           </output>
        </operation>
    </binding>

    <service name="StockQuoteService">
        <documentation>My first service</documentation>
        <port name="StockQuotePort" binding="tns:StockQuoteBinding">
           <soap:address location="http://example.com/stockquote"/>
        </port>
    </service>

</definitions>


<?xml version="1.0"?>
<definitions name="StockQuote"

targetNamespace="http://example.com/stockquote.wsdl";
          xmlns:tns="http://example.com/stockquote.wsdl";
          xmlns:xsd1="http://example.com/stockquote.xsd";
          xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
          xmlns="http://schemas.xmlsoap.org/wsdl/";>

    <types>
       <schema targetNamespace="http://example.com/stockquote.xsd";
              xmlns="http://www.w3.org/2001/XMLSchema";>
           <element name="TradePriceRequest">
              <complexType>
                  <all>
                      <element name="tickerSymbol" type="string"/>
                  </all>
              </complexType>
           </element>
           <element name="TradePrice">
              <complexType>
                  <all>
                      <element name="price" type="float"/>
                  </all>
              </complexType>
           </element>
       </schema>
    </types>

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

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

    <portType name="StockQuotePortType">
        <operation name="GetLastTradePrice">
           <input message="tns:GetLastTradePriceInput"/>
           <output message="tns:GetLastTradePriceOutput"/>
        </operation>
    </portType>

    <binding name="StockQuoteBinding" type="tns:StockQuotePortType">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="GetLastTradePrice">
           <soap:operation soapAction="http://example.com/GetLastTradePrice"/>
           <input>
               <soap:body use="literal"/>
           </input>
           <output>
               <soap:body use="literal"/>
           </output>
        </operation>
    </binding>

    <service name="StockQuoteService">
        <documentation>My first service</documentation>
        <port name="StockQuotePort" binding="tns:StockQuoteBinding">
           <soap:address location="http://example.com/stockquote"/>
        </port>
    </service>

</definitions>


Reply via email to