3 Replies Latest reply on Apr 18, 2012 7:42 PM by ffang

    How to set custom soap header information in camel route?

    gruzdzp

      Hello  everyone,

       

      After few days of struggle a I decided to ask for clue/advice.. I have read a lot of messages but I still can?t find relevant answer.

       

      So here is the background:

       

      I have configured Camel Proxy/router service with spring xml file.

      cxfEndpoint -> hedader based routing -> body xslt transformation -> cxfEndpoint (backend service)

      This solution worked great until it turned out, that I have to set few custom attributes in custom namepace In SOAP header of message forwarded to backend service.

       

      And here comes my question:

       

      How to set custom soap header information in camel route (using spring configuration)? For example, I want to add such header forwarded to backend service by my camel route:

       

      ?

       

      Edited by: gruzdzp on Apr 18, 2012 5:45 AM

        • 1. Re: How to set custom soap header information in camel route?
          ffang

          Hi,

           

          Sounds like you just wanna manipulate xml fragment in camel router, it doesn't matter it's a soap or other xml format. If so, doesn't the camel-xslt or camel-xquery can help here?

           

          Freeman

          • 2. Re: How to set custom soap header information in camel route?
            gruzdzp

            Thanks for suggestion. Being able to manipulate whole soap envelope would suit my needs. How to enable that in camel route? (keeping in mind following conclusion)

             

            Unfortunately, I think that only thing I can transform with this configuration is soap body. And even if I put whole soap envelope with sopa header during xslt tranformation, it still gets into Body part of message.

             

            I have just tried to embed whole sample message in xslt and this is what soapui says:

            The PayLoad elements cannot fit with the message parts of the BindingOperation. Please check the BindingOperation and PayLoadMessage.

             

            This is part of log message.

            BodyType:org.apache.camel.component.cxf.CxfPayload, Body:

            ...

            • 3. Re: How to set custom soap header information in camel route?
              ffang

              Hi,

               

              I think you should use

               

              if you wanna have soap envelope.

               

              Freeman