First off, upgrade to a newer version of CXF. 2.4.x is no longer supported.
Second, if there is output information for the method, in wrapped mode like that, there should be "Holder<String>" params to the method generated that would hold the output information. Alternatively, if using a newer version of CXF, you can pass -bareMethods flag to wsdl2java to have it generate the methods in "BARE" mode which would change how that information is passed. Dan On Jun 26, 2013, at 9:37 AM, Bindu <[email protected]> wrote: > > > Freeman Fang <freeman.fang@...> writes: > >> >> Hi, >> >> If you wanna response have a string, the simplest way is change your wsdl, > as the wsdl is the file to describe >> the interface(input parameter, return value, etc) >> ------------- >> Freeman(Yue) Fang >> >> Red Hat, Inc. >> FuseSource is now part of Red Hat >> Web: http://fusesource.com | http://www.redhat.com/ >> Twitter: freemanfang >> Blog: http://freemanfang.blogspot.com >> http://blog.sina.com.cn/u/1473905042 >> weibo: <at> Freeman小屋 >> >> On 2013-6-26, at 上午7:27, Bindu wrote: >> >>> I have an issue with cxf/spring client SOAP wsdl- webservice. >>> I invoke a jaxws - client request to the wsdl operation that returns >>> void(like insert operation).The soap xml request - response returns ok > with >>> 200 and isee in the cxf logs the whole soap envelope with the return > values >>> , with out any issue. >>> I am not sure how to get the response which returns complextype - >>> insertResponse operation , where i need to get a string value. >>> >>> I could get a response from the wsdl operations that directly return the >>> string value and are not void defined in the service endpoint > interface(SEI) >>> >>> few details of the code i tried:- >>> service.insert(..parameters); >>> InsertResponse response=? >>> String number = response.getNumber(); >>> >>> I tried using cxf interceptors but not sure of the right way. >>> >>> Any direction will be helpful to proceed further as i am stuck here. >>> >>> Thanks >>> Bindu >>> >> >> > I do not have much flexbility in changing the wsdl as it's consumed from > external vendor. > But if the wsdl is providing both the operations in the interface then > there should be a way using jaxws- cxf client not to get the response form > void method after invoking the insert operation call? > > I see the xml request and response in the cxf logs with all the values > returened from "insertResponse" > > Here's the pieces of interface generated by Apache CXF 2.4.1(using cxf/maven > plugin) code:- > @RequestWrapper(localName = "insert", targetNamespace = "http://bbbbb...", > className = "gen.Insert") > @WebMethod(action = "http://bbbbb....") > @ResponseWrapper(localName = "insertResponse", targetNamespace = > "http://bbbb...", className = "gen.InsertResponse") > public void insert( > @WebParam(name = "active", targetNamespace = "") > ....) > > Here's the InsertResponse class and i am trying to get the string number. > > @XmlRootElement(name = "insertResponse") > public class InsertResponse { > > @XmlElement(name = "sys_id") > protected String sysId; > protected String number; > > > Thanks > Bindu > -- Daniel Kulp [email protected] - http://dankulp.com/blog Talend Community Coder - http://coders.talend.com
