axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Amila Suriarachchi" <amilasuriarach...@gmail.com>
Subject Re: Axis2 Java codegen tool fails to include message parts mapped to SOAP headers
Date Thu, 25 Dec 2008 06:02:56 GMT
On 12/25/08, Gilbert Pilz <gilbert.pilz@oracle.com> 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
>

Axis2 skelton does not contain soap header details. If you want to get
them at the skelton you need to access the soapEnvelope and get them.
Please see here[1]

thanks,
Amila.

[1] http://amilachinthaka.blogspot.com/2008/11/accessing-axis2-information-at-client.html


-- 
Amila Suriarachchi
WSO2 Inc.
blog: http://amilachinthaka.blogspot.com/

Mime
View raw message