java - Enable transactions in SOAPHandler, is it possible? -
i want extract headers , cookies http request , put transactionsynchronizationregistry. doing via soaphandler in aop way, , want reuse data in business logic.
here code:
public class basicauthentbindingserversoaphandler implements soaphandler<soapmessagecontext> { public static final string login = "login"; public static final string password = "password"; @resource webservicecontext wsctx; @resource transactionsynchronizationregistry tsr; @override public boolean handlemessage(soapmessagecontext soapmessagecontext) { boolean isboundrequest = !(boolean) soapmessagecontext.get(messagecontext.message_outbound_property); if (isboundrequest) { // http headers can webservicecontext, available in soapservice: if (soapwebservicecontextutilities.authorizationapplied(wsctx)) { tsr.putresource(login, soapwebservicecontextutilities.getlogin(wsctx)); tsr.putresource(password, soapwebservicecontextutilities.getpassword(wsctx)); } } return true; } and here error:
18:40:28,533 warning [org.apache.cxf.phase.phaseinterceptorchain] (default task-62) interceptor {http://qq.com/}soapserviceimplservice#{http://qqq.com/}getname has thrown exception, unwinding now: java.lang.illegalstateexception: no transaction running @ com.arjuna.ats.internal.jta.transaction.arjunacore.transactionsynchronizationregistryimple.gettransactionimple(transactionsynchronizationregistryimple.java:228) @ com.arjuna.ats.internal.jta.transaction.arjunacore.transactionsynchronizationregistryimple.putresource(transactionsynchronizationregistryimple.java:109) @ qqq.basicauthentbindingserversoaphandler.handlemessage(cookiesbindingserversoaphandler.java:29) [soapauthentication-1.0-snapshot.jar:] the question is, there way start transaction in soaphandler. cannot find in specification.
Comments
Post a Comment