Results 1 to 3 of 3

Thread: Can int-ws:outbound gateway auto-set soapAction header instead of enriching manually

Hybrid View

  1. #1
    Join Date
    Nov 2012
    Posts
    2

    Default 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">
    <ws:soap-action value="http://someURI"/>
    </ws:header-enricher>

    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...

    Jack

  2. #2
    Join Date
    Jan 2009
    Location
    Ukraine, Kharkov
    Posts
    646

    Default

    Hi!

    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

    Cheers,
    Artem

  3. #3
    Join Date
    Nov 2012
    Posts
    2

    Default

    Quote Originally Posted by Cleric View Post
    Hi!

    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

    Cheers,
    Artem
    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.

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •