camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: Setting SOAP Headers using spring-ws
Date Mon, 24 Oct 2011 12:02:37 GMT
On Mon, Oct 24, 2011 at 5:18 AM, Damian Harvey <> wrote:
> Hi all,
> I've another SOAP spring-ws question for you.
> Currently I can't see a way to dynamically set SOAP headers using spring-ws. I can set
static headers by creating a MessageFactory but I see no way to pass values into it. Is this
currently possible?
> It looks like the recommended approach for spring-ws is to override the doWithMessage()
method of the WebServiceMessageCallback (
The Camel SpringWebserviceProducer already does this and I can't see an obvious way to override
it. I see two options:
> 1. Allow for the WebServiceMessageCallback to be overridden so that the developer can
provide his own doWithMessage() method.
> 2. Have a Camel header for SPRING_WS_SOAP_HEADER that expects a value of type javax.xml.transform.Source
and is added to the SOAP Header in the doWithMessage() method of the DefaultWebserviceMessageCallback.
> Which approach is better?

Would there be needs to set 2+ soap headers? Or should only 1
And must the type be a Source? You can use the Camel type converter
system, and convert the value to a source. Then people can set a plain
String as value.

> Happy to create a JIRA and I've already written a patch following approach #2.

Great we love contributions

> Thanks,
> Damian.
> ________________________________
> This communication (and any attachments) is directed in confidence to the addressee(s)
listed above, and may not otherwise be distributed, copied or used. The contents of this communication
may also be subject to privilege, and all rights to that privilege are expressly claimed and
not waived. If you have received this communication in error, please notify us by reply e-mail
or by telephone and delete this communication (and any attachments) without making a copy.
> Before opening or using attachments, you should check them for viruses and defects. We
do not accept liability in connection with computer virus, data corruption, delay, interruption,
unauthorised access or unauthorised amendment.

Claus Ibsen
Twitter: davsclaus, fusenews
Author of Camel in Action:

View raw message