Announcement Announcement Module
Collapse
No announcement yet.
Config SI dynamically runtime by API Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Config SI dynamically runtime by API

    The following is the code from ws-outbound-gateway sample
    Code:
    <chain input-channel="fahrenheitChannel" output-channel="celsiusChannel">
    		<ws:header-enricher>
    			<ws:soap-action value="http://tempuri.org/CelsiusToFahrenheit" />
    		</ws:header-enricher>
    		<ws:outbound-gateway
    			uri="http://www.w3schools.com/webservices/tempconvert.asmx" />
    </chain>
    It's possible to change URI by MessageBuilder.header("ws-soap-action","http://tempuri.org/CelsiusToFahrenheit").withPayload(request).build() instead of

    Code:
                     <ws:header-enricher>
    			<ws:soap-action value="http://tempuri.org/CelsiusToFahrenheit" />
    		</ws:header-enricher>
    how to change the uri value uri="http://www.w3schools.com/webservices/tempconvert.asmx" by API?
    do SI has another API for dynamically runtime configuration changes ?
    Last edited by alex-il; Apr 26th, 2012, 06:58 AM.

  • #2
    You can use here SpEL:
    HTML Code:
    <ws:header-enricher>
    	<ws:soap-action expression="'http://' + payload"/>
    </ws:header-enricher>
    And use MessageBuilder is also OK, but it's not recomended. Aslo it should be something like this:
    Code:
    MessageBuilder.withPayload(request).setHeader(WebServiceHeaders.SOAP_ACTION, someActionValue).build()

    Comment


    • #3
      thank, this was not answer to my question.
      i clarify myself
      i should set/change the following line <ws:outbound-gateway uri="http://www.w3schools.com/webservices/tempconvert.asmx" /> by API on runtime

      Comment


      • #4
        A-ha!
        Try this one:
        HTML Code:
        <ws:outbound-gateway uri="{uri}">
        	<ws:uri-variable name="uri" expression="headers.wsUri"/>
        </ws:outbound-gateway>

        Comment


        • #5
          OK, please could you write sample code in java how to set {uri} and expression="headers.wsUri". Is this system properties? i'm not familiar with this syntax.

          Comment


          • #6
            Sorry...

            Can you explain why do you constantly say about Java code?
            If you don't familiar with SpEL, please, read this one: http://static.springsource.org/sprin...pressions.html
            than this: http://static.springsource.org/sprin...http-namespace
            the paragraph about Mapping URI variables

            Comment


            • #7
              i should create a generic ws framework that "call' to many WSs by the same way. in this case i'm going to set up WS parameters to java code on runtime. Could i write you in russian/ukrainian to your email?

              Comment


              • #9
                thanks,
                i've sent you the problem and my solution to it

                Comment

                Working...
                X