Thanks Dan. But this check is for client side. To avoid introducing new dependency, how about we just get obj interface name and compare it with string "javax.xml.ws.AsyncHandler"?
Freeman ------------- 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: http://weibo.com/u/1473905042 On 2012-11-13, at 下午8:12, Daniel Kulp wrote: > > Umm… this puts a dependency on the jaxws API from the soap binding which > would be a new dep. That's "OK" for trunk since the JAX-WS API's are built > in the JDK, but that wouldn't be ok to be merged back. > > Ideally, this should be done somehow in the JAXWS layer. Most likely, after > the invoke completes, the JAXWS invoker should remove the callback off of the > param list. > > Dan > > > On Nov 13, 2012, at 2:50 AM, [email protected] wrote: > >> Author: ffang >> Date: Tue Nov 13 07:50:14 2012 >> New Revision: 1408627 >> >> URL: http://svn.apache.org/viewvc?rev=1408627&view=rev >> Log: >> [CXF-4623]Marshalling Error during asynchronous service invocation when >> adding a soap header using a SOAPHandler >> >> Modified: >> >> cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java >> >> Modified: >> cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java >> URL: >> http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java?rev=1408627&r1=1408626&r2=1408627&view=diff >> ============================================================================== >> --- >> cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java >> (original) >> +++ >> cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java >> Tue Nov 13 07:50:14 2012 >> @@ -27,6 +27,7 @@ import java.util.ResourceBundle; >> >> import javax.xml.stream.XMLStreamException; >> import javax.xml.stream.XMLStreamWriter; >> +import javax.xml.ws.AsyncHandler; >> >> import org.w3c.dom.Element; >> >> @@ -212,13 +213,20 @@ public class SoapOutInterceptor extends >> if (headers == null) { >> return endedHeader; >> } >> + >> >> for (SoapHeaderInfo header : headers) { >> MessagePartInfo part = header.getPart(); >> if (wrappedBmi != bmi) { >> part = >> wrappedBmi.getMessageInfo().addMessagePart(part.getName()); >> } >> - if (part.getIndex() >= objs.size()) { >> + int paraLength = objs.size(); >> + if (objs.get(paraLength - 1) instanceof AsyncHandler) { >> + //when use asyn handler in bare mode the last parameter >> is AsyncHandler >> + //which shouldn't count in as parameter length >> + paraLength = paraLength - 1; >> + } >> + if (part.getIndex() >= paraLength) { >> // The optional out of band header is not a part of >> parameters of the method >> continue; >> } >> >> > > -- > Daniel Kulp > [email protected] - http://dankulp.com/blog > Talend Community Coder - http://coders.talend.com >
