1

JAXRSServiceEndpointserviceBeanまたはJAXWSServiceEndpointserviceBeanから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();
  ...
}
4

1 に答える 1

0

in the case of JAXWS the JAXWS MessageContext need to be found from WebServiceContext.getMessageContext().

you can then call context.get() on the MessageContext

于 2011-02-11T20:38:15.710 に答える