Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 be get from WebServiceContext, available in SoapService:
- if (SoapWebServiceContextUtilities.authorizationApplied(wsctx)) {
- tsr.putResource(LOGIN, SoapWebServiceContextUtilities.getLogin(wsctx));
- tsr.putResource(PASSWORD, SoapWebServiceContextUtilities.getPassword(wsctx));
- }
- }
- return true;
- }
- 18:40:28,533 WARNING [org.apache.cxf.phase.PhaseInterceptorChain] (default task-62) Interceptor for {http://qq.com/}SoapServiceImplService#{http://qqq.com/}getName has thrown exception, unwinding now: java.lang.IllegalStateException: No transaction is running
- at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionSynchronizationRegistryImple.getTransactionImple(TransactionSynchronizationRegistryImple.java:228)
- at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionSynchronizationRegistryImple.putResource(TransactionSynchronizationRegistryImple.java:109)
- at qqq.CookiesBindingServerSoapHandler.handleMessage(CookiesBindingServerSoapHandler.java:29) [soapAuthentication-1.0-SNAPSHOT.jar:]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement