1. Create a component which inherits from TransformComponentSupport
2. implement transform method. Example below.
3. wrap sending service in EIP component (I used static-routing-slip). EIP
component first calls component which add the header then it calls http
provider
4. now in the flow instead of calling directly http provider, call EIP
component
good luck
protected boolean transform(MessageExchange _exchange, NormalizedMessage
_in, NormalizedMessage _out)
throws Exception
{
// fetch soap headers
Map<QName, DocumentFragment> props = (Map<QName, DocumentFragment>)
_out.getProperty(JbiConstants.SOAP_HEADERS);
if (props == null)
{
// if not exists then create them
props = new HashMap<QName, DocumentFragment> ();
}
// put Security headers
props.put(new QName("Security", "UsernameToken"), createDocument());
// put headers to OUT message - since this will be sent to the client
_out.setProperty(JbiConstants.SOAP_HEADERS, props);
// use IN message in OUT message
_out.setContent(_in.getContent());
return true;
}
--
View this message in context:
http://www.nabble.com/How-can-I-develop-a-HTTP-provider-endpoint-invoking-web-services-that-use-WS-UsernameToken--tf4212467s12049.html#a12017073
Sent from the ServiceMix - User mailing list archive at Nabble.com.