如何从JAXRS ServiceEndpoint serviceBean或JAXWS ServiceEndpoint serviceBean获取org.apache.cxf.continuations.Continuation。
我的春季配置看起来像那样。
<bean id="myServiceContainer" class="cxfutils.endpoint.soap.JAXWSServiceEndpoint">
<property name="serviceBean" ref="myReceiver" />
</bean>
对于jaxrs它就像你应该添加
import org.apache.cxf.continuations.ContinuationProvider;
import org.apache.cxf.jaxrs.ext.MessageContext;
import javax.annotation.Resource;
import org.apache.cxf.continuations.Continuation;
@Resource
private MessageContext context;
@GET
@Path("hello")
@Produces("text/plain")
public String hello(@Context final HttpServletRequest httpRequest){
ContinuationProvider provider = (ContinuationProvider)context.get(ContinuationProvider.class.getName());
Continuation conti = provider.getContinuation();
...
}
答案 0 :(得分:0)
对于JAXWS,需要从WebServiceContext.getMessageContext()中找到JAXWS MessageContext。
然后,您可以在MessageContext上调用context.get()