You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by knightg <jg...@ufis-online.com> on 2011/07/18 06:09:51 UTC

wsdl:output's message have two parts cause to generate wrong parameter and return type method.

I use cxf wsdl2java to generate client code.but the method GetPaxListByFlight
which generate to be void.the output thing became into the method
parameters.
below is the part of the wsdl and the source code generated.Pls help
me.Thank you.

WSDL:
<wsdl:message name="GetPaxListByFlightRes">
        <wsdl:part element="ns0:GetPaxListByFlightRes" name="part2"/>
		<wsdl:part element="header:ResHeader" name="header2"/>
</wsdl:message>

<wsdl:portType name="iCMListingPax">
        <wsdl:operation name="GetPaxListByFlight">
            <wsdl:input message="tns:GetPaxListByFlightReq"/>
            <wsdl:output message="tns:GetPaxListByFlightRes"/>
            <wsdl:fault message="tns:Fault" name="fault1"/>
        </wsdl:operation>
</wsdl:portType>
Java Client:
public void getPaxListByFlight(
        @WebParam(partName = "part1", name = "GetPaxListByFlightReq",
targetNamespace = "http://xml.sq.com.sg/cm/listing/pax/getpaxlistbyflight")
       
sg.com.sq.xml.cm.listing.pax.getpaxlistbyflight.v1_0.GetPaxListByFlightReq
part1,
        @WebParam(partName = "header1", name = "ReqHeader", targetNamespace
= "http://xml.sq.com.sg/common/header")
        sg.com.sq.xml.common.header.ReqHeader header1,
        @WebParam(partName = "part2", mode = WebParam.Mode.OUT, name =
"GetPaxListByFlightRes", targetNamespace =
"http://xml.sq.com.sg/cm/listing/pax/getpaxlistbyflight")
       
javax.xml.ws.Holder<sg.com.sq.xml.cm.listing.pax.getpaxlistbyflight.v1_0.GetPaxListByFlightRes>
part2,
        @WebParam(partName = "header2", mode = WebParam.Mode.OUT, name =
"ResHeader", targetNamespace = "http://xml.sq.com.sg/common/header")
        javax.xml.ws.Holder<sg.com.sq.xml.common.header.ResHeader> header2
    ) throws Fault;

--
View this message in context: http://cxf.547215.n5.nabble.com/wsdl-output-s-message-have-two-parts-cause-to-generate-wrong-parameter-and-return-type-method-tp4598102p4598102.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: wsdl:output's message have two parts cause to generate wrong parameter and return type method.

Posted by knightg <jg...@ufis-online.com>.
i have a friend told me.Don't need to do this.The cxf generate method can be
used. the return value will be put into the Holder variable.The wsdl server
is not published, So i can't test, and i'm a fresh man to webservice,so i'm
confused before.When i can test it, i'll put result in here.
If someone has anyother opinion,please leave the message and we can discuss
it.
Thanks.

--
View this message in context: http://cxf.547215.n5.nabble.com/wsdl-output-s-message-have-two-parts-cause-to-generate-wrong-parameter-and-return-type-method-tp4598102p4598166.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: wsdl:output's message have two parts cause to generate wrong parameter and return type method.

Posted by knightg <jg...@ufis-online.com>.
I find out if i annotate the header part of wsdl:message.All the problem has
been fixed.
But the wsdl is published by other people, which means that everytime i
should check their wsdl file and make the change, then generate my code.In
doNet the wsdl can be used directly and auto-generate what i wanted.Is there
any method which don't need to modify the wsdl?

original wsdl:
<wsdl:message name="GetPaxListByFlightRes">
        <wsdl:part element="ns0:GetPaxListByFlightRes" name="part2"/>
        <wsdl:part element="header:ResHeader" name="header2"/>
</wsdl:message>
if i change to this below it will worked:
<wsdl:message name="GetPaxListByFlightRes">
        <wsdl:part element="ns0:GetPaxListByFlightRes" name="part2"/>
</wsdl:message>

--
View this message in context: http://cxf.547215.n5.nabble.com/wsdl-output-s-message-have-two-parts-cause-to-generate-wrong-parameter-and-return-type-method-tp4598102p4598140.html
Sent from the cxf-user mailing list archive at Nabble.com.