Announcement Announcement Module
No announcement yet.
Pass data from WebServiceTemplate to ClientInterceptor Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Pass data from WebServiceTemplate to ClientInterceptor

    Hi !

    I need to modify the header of the client request depending on some dynamic data, something like a SAML header.

    I can't find how to transmit these informations from my client to the ClientInterceptor.

    Do I need to use ThreadLocal ? Is there something cleaner ?

    Thank you

  • #2
    I think you need the client interceptor


    • #3
      I use the client interceptor. But it needs some data from the source code that calls the web service template.

      I need something like :

      Class MyService :
      WebServiceTemplate wsTpl;

      public void myFunction(String username, String password, ...) {
      [ ... ]
      wsTpl.marshalSendAndReceive(request, username, password);
      [ ... ]
      Class MyClientInterceptor :
      protected void secureMessage(final SoapMessage soapMessage, final MessageContext messageContext, String username, String password) throws WsSecuritySecurementException {

      * add header with custom security