Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. public class BasicAuthentBindingServerSoapHandler implements SOAPHandler<SOAPMessageContext> {
  2.  
  3. public static final String LOGIN = "login";
  4. public static final String PASSWORD = "password";
  5.  
  6. @Resource
  7. WebServiceContext wsctx;
  8.  
  9. @Resource
  10. TransactionSynchronizationRegistry tsr;
  11.  
  12. @Override
  13. public boolean handleMessage(SOAPMessageContext soapMessageContext) {
  14. boolean isBoundRequest = !(Boolean) soapMessageContext.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
  15. if (isBoundRequest) {
  16. // Http Headers can be get from WebServiceContext, available in SoapService:
  17. if (SoapWebServiceContextUtilities.authorizationApplied(wsctx)) {
  18. tsr.putResource(LOGIN, SoapWebServiceContextUtilities.getLogin(wsctx));
  19. tsr.putResource(PASSWORD, SoapWebServiceContextUtilities.getPassword(wsctx));
  20. }
  21. }
  22. return true;
  23. }
  24.  
  25. 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
  26. at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionSynchronizationRegistryImple.getTransactionImple(TransactionSynchronizationRegistryImple.java:228)
  27. at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionSynchronizationRegistryImple.putResource(TransactionSynchronizationRegistryImple.java:109)
  28. at qqq.CookiesBindingServerSoapHandler.handleMessage(CookiesBindingServerSoapHandler.java:29) [soapAuthentication-1.0-SNAPSHOT.jar:]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement