Results 1 to 9 of 9

Thread: Config SI dynamically runtime by API

  1. #1
    Join Date
    Apr 2012
    Posts
    14

    Default 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 at 05:58 AM.

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

    Default

    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()

  3. #3
    Join Date
    Apr 2012
    Posts
    14

    Default

    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

  4. #4
    Join Date
    Jan 2009
    Location
    Ukraine, Kharkov
    Posts
    740

    Default

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

  5. #5
    Join Date
    Apr 2012
    Posts
    14

    Default

    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.

  6. #6
    Join Date
    Jan 2009
    Location
    Ukraine, Kharkov
    Posts
    740

    Default

    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

  7. #7
    Join Date
    Apr 2012
    Posts
    14

    Default

    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?

  8. #8
    Join Date
    Jan 2009
    Location
    Ukraine, Kharkov
    Posts
    740

    Default

    Could i write you in russian/ukrainian to your email?
    Yes, you can: clericsmail@gmail.com

  9. #9
    Join Date
    Apr 2012
    Posts
    14

    Default

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

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
  •