This looks like part of an XSD instead of a <generated>wsdl
You need any/all predefined simple or complexTypes e.g.

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://example";
    xmlns:apachesoap="http://xml.apache.org/xml-soap"; xmlns:tns="http://example";
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
    xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/";
    xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
    <wsdl:types>
        <schema elementFormDefault="qualified" targetNamespace="http://example";
            xmlns="http://www.w3.org/2001/XMLSchema";
            xmlns:apachesoap="http://xml.apache.org/xml-soap";
            xmlns:tns="http://example"; xmlns:intf="http://example";
            xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";>

    <wsdl:types>
        <schema elementFormDefault="qualified" targetNamespace="http://example";
            xmlns="http://www.w3.org/2001/XMLSchema";
            xmlns:apachesoap="http://xml.apache.org/xml-soap";
            xmlns:tns="http://example"; xmlns:intf="http://example";
            xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";>
            
            <element name="withdraw">
                <complexType>
                    <sequence>
                        <element name="account" type="xsd:string"/>
                        <element name="amount" type="xsd:int"/>
                    </sequence>
                </complexType>
            </element>

<!-- Service.. -->
    <wsdl:service name="BankService">
        <wsdl:port binding="tns:BankSoapBinding" name="Bank">
            <wsdlsoap:address 
location="http://localhost:8080/bank/services/Bank"/>
        </wsdl:port>
    </wsdl:service>

<!-- Bindings... -->

    <wsdl:binding name="BankSoapBinding" type="tns:Bank">

        <wsdlsoap:binding style="document" 
transport="http://schemas.xmlsoap.org/soap/http"/>

        <wsdl:operation name="withdraw">

            <wsdlsoap:operation soapAction=""/>

            <wsdl:input name="withdrawRequest">

                <wsdlsoap:body use="literal"/>

            </wsdl:input>

            <wsdl:output name="withdrawResponse">

                <wsdlsoap:body use="literal"/>

            </wsdl:output>

            <wsdl:fault name="InsufficientFundException">

                <wsdlsoap:fault name="InsufficientFundException" use="literal"/>

            </wsdl:fault>

            <wsdl:fault name="AccountNotExistException">

                <wsdlsoap:fault name="AccountNotExistException" use="literal"/>

            </wsdl:fault>

        </wsdl:operation>

    </wsdl:binding>


<!-- Message Types -->
    <wsdl:message name="withdrawRequest">
        <wsdl:part element="tns:withdraw" name="parameters"/>
    </wsdl:message>
    
    <wsdl:message name="withdrawResponse">
        <wsdl:part element="tns:withdrawResponse" name="return"/>
    </wsdl:message>

<!-- PortType e.g. -->
    <wsdl:portType name="Bank">
        <wsdl:operation name="withdraw">
            <wsdl:input message="tns:withdrawRequest" name="withdrawRequest"/>
            <wsdl:output message="tns:withdrawResponse" 
name="withdrawResponse"/>
            <wsdl:fault message="tns:AccountNotExistFaultMessage" 
name="AccountNotExistException"/>
            <wsdl:fault message="tns:InsufficientFundFaultMessage" 
name="InsufficientFundException"/>
        </wsdl:operation>        
    </wsdl:portType>

Martin 
______________________________________________ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business 
of Sender. This transmission is of a confidential nature and Sender does not 
endorse distribution to any party other than intended recipient. Sender does 
not necessarily endorse content contained within this transmission. 




> Date: Sat, 27 Dec 2008 11:59:58 +0000
> From: [email protected]
> To: [email protected]
> Subject: Re: Axis2 Java codegen tool fails to include message parts mapped to 
> SOAP headers
> 
> I agree that the tool not at least spitting out a warning is probably
> a bug. Please open a JIRA [1] to get that added.
> David
> 
> [1] https://issues.apache.org/jira/browse/AXIS2
> 
> On Wed, Dec 24, 2008 at 7:12 PM, Gilbert Pilz <[email protected]> wrote:
> > Hi,
> >
> > I'm new to Axis2 but I sort of know my way around SOAP etc. I'm trying to
> > build an Axis2 implementation of the Web Services Test Forum (WSTF)
> > Notify-Echo scenario. The WSDL for this scenario is a little tricky. The
> > Notify and Echo messages contain two parts, the actual data to be sent and a
> > "SessionData" element that provides an app-level session ID. The service is
> > supposed to concatenate all the notify and echo data from a given session
> > and return it on the Echo operation. For example:
> >
> > Notify("foo", "session1")
> >
> > Notify("blub", "session2")
> >
> > Echo("baz", "session1") --> returns "foobaz"
> >
> > So far, pretty simple. The tricky part is in the SOAP bindings where the
> > SessionData part is mapped to a SOAP header like so:
> >
> > <wsdl:operation name="Notify">
> >   <soap12:operation/>
> >   <wsdl:input>
> >     <soap12:header use="literal" part="SessionData" message="tns:Notify"/>
> >     <soap12:body use="literal" parts="Notify"/>
> >   </wsdl:input>
> > </wsdl:operation>
> >
> > When I process this WSDL using the Axis2 codegen task it seems to work fine;
> > there are no warnings etc. However, the generated Java code doesn't reflect
> > the presence of SessionData element. Here's the server skeleton for the
> > Notify method:
> >
> > /**
> >   * Auto generated method signature
> >   *
> >   * @param notify14
> >   */
> > public void Notify(org.wstf.www.docs.scenarios.sc002.Notify notify14)
> > {
> >     //TODO : fill this with the necessary business logic
> > }
> >
> > This just seems wrong to me. I think the tool should either generate code
> > the accurately reflects the portType (i.e. including all the parts of all
> > the input and output messages) or it should warn you that it is leaving
> > something out.
> >
> > I'm using version 1.4.1 of Axis2. I'm invoking the codegen tool via ant like
> > so:
> >
> > <taskdef name="codegen"
> >          classname="org.apache.axis2.tool.ant.AntCodegenTask"
> >          classpathref="axis.classpath"/>
> >
> > <target name="compile.wsdl"
> >         unless="wsdl.compiled"
> >         depends="init">
> >   <codegen wsdlfilename="src/sc003.wsdl"
> >            output="generated"
> >            serverside="true"
> >            generateservicexml="true"
> >            portName="soap12port"
> >            serverSideInterface="true"/>
> > </target>
> >
> > Gilbert Pilz | SOA/WS Technologist | Oracle Corporation
> >

_________________________________________________________________
Send e-mail anywhere. No map, no compass.
http://windowslive.com/oneline/hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_anywhere_122008

Reply via email to