Follow-up, I figured this out. I need to specify the -W option since I
was using doc/literal and not wrapped. Works fine now.

markg

-----Original Message-----
From: Griffin, Mark 
Sent: Friday, November 18, 2005 1:30 PM
To: 'axis-user@ws.apache.org'
Subject: WSDL2Java with DocumentLiteral Issue


I working on some compatibility testing with Axis 1.3. I'm having some
difficultly getting the WSDL2Java to generate the java classes based on
the defined types in the WSDL.  I would expect a couple of bean classes
to be generated based upon the WSDL I'm using.  This would be consistent
with the other tools I've run this WSDL through.  With Axis I'm just
getting the interface, stub classes and nothing else.  I can invoke the
service that way but it requires me to pass the parameters as individual
elements instead of an object.  Which gets pretty clunky for large
documents.

Based upon the WSDL attached below, I would expect a RequestService bean
and a Response bean.  Here is the command line I'm using to generate the
classes: java -classpath
./;./wsdl4j-1.5.1.jar;./axis.jar;./commons-logging-1.0.4.jar;./commons-d
iscovery-0.2.jar;./jaxrpc;./saaj.jar;./j2ee.jar
org.apache.axis.wsdl.WSDL2Java -D -o ./source requestservice.wsdl

One note, if I remove the type definitions from the WSDL it will
generate a class.  But then it generates all the elements as plain
objects instead of the correct types.  Something I'm missing on the
command line?

Thanks, sorry for the large xml post.

Markg



<?xml version="1.0" encoding="UTF-8"?>
        <wsdl:definitions name="PgnRequestService"
targetNamespace="http://www.meg.com/";
                :wsdns1="http://www.meg.com";
                :wsdl="http://schemas.xmlsoap.org/wsdl/";
                :xsd="http://www.w3.org/2001/XMLSchema";
                :http="http://schemas.xmlsoap.org/wsdl/http/";
                :tns="http://www.meg.com/";
                :mime="http://schemas.xmlsoap.org/wsdl/mime/";
                :soap="http://schemas.xmlsoap.org/wsdl/soap/";>
        <wsdl:types>
       <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema";
targetNamespace="http://www.meg.com"; xmlns:ti="http://www.meg.com";>
         <xsd:element name="firstname" type="xsd:string"/>
         <xsd:element name="city" type="xsd:string"/>
         <xsd:element name="zip" type="xsd:string"/>
         <xsd:element name="requestservice">
           <xsd:complexType>
             <xsd:sequence>
               <xsd:element ref="ti:firstname" minOccurs="0"/>
               <xsd:element ref="ti:city" minOccurs="0"/>
               <xsd:element ref="ti:zip" minOccurs="0"/>
             </xsd:sequence>
           </xsd:complexType>
         </xsd:element>
         <xsd:element name="success" type="xsd:string"/>
         <xsd:element name="response">
           <xsd:complexType>
             <xsd:sequence>
               <xsd:element ref="ti:success"/>
             </xsd:sequence>
           </xsd:complexType>
         </xsd:element>
       </xsd:schema>

       <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema";
targetNamespace="http://localhost/PgnRequestService/requestservice";
xmlns:tns="http://localhost/PgnRequestService/requestservice";
xmlns:ti="http://www.meg.com";>
         <xsd:import namespace="http://www.meg.com"/>
         <xsd:complexType name="in">
           <xsd:sequence>
             <xsd:element ref="ti:requestservice"/>
             <xsd:any processContents="lax"/>
           </xsd:sequence>
           <xsd:anyAttribute processContents="lax"/>
         </xsd:complexType>
         <xsd:complexType name="out">
           <xsd:sequence>
             <xsd:element ref="ti:response"/>
             <xsd:any processContents="lax"/>
           </xsd:sequence>
           <xsd:anyAttribute processContents="lax"/>
         </xsd:complexType>
       </xsd:schema>

        </wsdl:types>
        
        <wsdl:message name="requestservice">
                <wsdl:part name="requestservice"
element="wsdns1:requestservice"/>
        </wsdl:message>
        
        <wsdl:message name="requestserviceOutput">
                <wsdl:part name="response" element="wsdns1:response"/>
        </wsdl:message>
        <wsdl:portType name="PgnRequestServicePortType">
                <wsdl:operation name="requestservice">
                        <wsdl:input message="tns:requestservice"/>
                        <wsdl:output
message="tns:requestserviceOutput"/>
                </wsdl:operation>
        </wsdl:portType>
        <wsdl:binding name="PgnRequestServiceBinding"
type="tns:PgnRequestServicePortType">
                <soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
                <wsdl:operation name="requestservice">
                        <soap:operation soapAction=""/>
                        <wsdl:input>
                                <soap:body use="literal"/>
                        </wsdl:input>
                        <wsdl:output>
                                <soap:body use="literal"/>
                        </wsdl:output>
                </wsdl:operation>
        </wsdl:binding>
        <wsdl:service name="PgnRequestServiceService">
                <wsdl:port name="PgnRequestServicePort0"
binding="tns:PgnRequestServiceBinding">
                        <soap:address
location="http://sn000046:5555/soap/default"/>
                </wsdl:port>
        </wsdl:service>
        </wsdl:definitions>


Reply via email to