Nov 20th, 2012, 10:16 AM
Can int-ws:outbound gateway auto-set soapAction header instead of enriching manually
Hi I am using int-ws as a ws client to connect a remote .NET WCF WS server module.
As the remote WS servers uses ws-addressing. I have to manually set the SoapAction header enrichment using the the config below before I pass the request message to the ws outbound gateway.
<ws:header-enricher input-channel="in" output-channel="out">
My questions is, Can this enrichment done automatically by Spring integration, as the WSDL has all the soap-action URI defined anyway, Is there a setting anyway I could use?
If above is not possible? Is there any simple way I could simplfy the maintenance of the list of soap-action URIs? as I do not really want to "hard code" them in my config files. I suppose I could parse through the WSDL file and get a list of SoapAction URI in a custom enricher class.
What's the aim of setting soap-action enrichment manually in spring config? Is it a because of spring integration could not auto handle ws-addressing? I really do not see the point of setting it manually for every web method?
Your thoughts are very welcome...
Nov 20th, 2012, 02:14 PM
There is an 'expresion' attribute on <ws:soap-action> element, So, in this case use can any SpEL to determine a value for youe request at runtime.
From other side: on the <ws:outbound-gateway> has a 'request-callback' attribute to referenc any implementation of WebServiceMessageCallback, one of which is appropriate for you - SoapActionCallback
Nov 20th, 2012, 04:07 PM
thanks. Option 1 above would work, but URI would still be "hardcoded" or "hardcode derived" in xml or java, Option 2 probably not suit my case, I am defining one ws:outbound-gateway for multiple web services methods in a single destination URI. thus soapAction will have to be dynamic.
Originally Posted by Cleric
One of the hack (option 3), I am thinking about is to write a WSDLSoapActionResolver. which parses the WSDL and return the SoapAction for a given method name, i.e. : "URI getSoapAction(String methodName)". I can use this Resolver either in my customEnricher. or directly in my service layer and set directly "ws_soapaction" Message header with the URI before I invoke the ws. I think I will give this a try..
Tags for this Thread