Author |
Message
|
jfry |
Posted: Mon Mar 31, 2008 11:43 am Post subject: Dynamic URL in HTTP Request Node |
|
|
Apprentice
Joined: 31 Mar 2008 Posts: 32
|
I am VERY new to WMB and am in need of some assistance. I have a message flow with the following:
HTTP Input --> HTTP Request Node --> HTTP Reply
In the HTTP Request Node Properties, I am specifying the Web service URL to call. I would like to set this value dynamically rather than hard code it. The reason is this same flow is used in our Dev, Test, Model, etc. environments and the only difference in the message flow is the URL. I am storing these URL's in a database (Oracle) and reading them in a Java singleton class (for use in a servlet). Is there a way I can use the same singleton and/or database records inside of the message flow?
Thanks in advance. |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Mar 31, 2008 11:48 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
|
Back to top |
|
 |
jfry |
Posted: Mon Mar 31, 2008 12:58 pm Post subject: |
|
|
Apprentice
Joined: 31 Mar 2008 Posts: 32
|
First, thank you for such a quick response. I looked into your suggestion and now have the following:
HTTP Input --> Compute Node --> HTTP Request Node --> HTTP Reply
In the Compute Node I have the following:
CREATE COMPUTE MODULE TestBuildURL
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
SET OutputRoot = InputRoot;
SET Environment.Destination.HTTP.RequestURL = "http://test.url.com";
RETURN TRUE;
END;
END MODULE;
When I try to deploy the BAR file, I get this error:
BIP2432E: (.TestBuildURL.Main, 4.60) : The correlation name "http://test.url.com" is not valid.
Does my code look okay and what does this "correlation name" error mean?
Thank you again for your assistance. |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Mar 31, 2008 1:01 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
That means you're using double-quotes for an ESQL literal value, when you need to use single-quotes.
 _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
mgk |
Posted: Tue Apr 01, 2008 12:51 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
And you need to use LocalEnvrionment not Environment (and set the compute mode on the compute node to include LocalEnvironment) _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
jfry |
Posted: Tue Apr 01, 2008 3:58 am Post subject: |
|
|
Apprentice
Joined: 31 Mar 2008 Posts: 32
|
Would someone be willing to post the ESQL for what I am trying to do? This is my first message flow I have ever done and I learn much easier from an example.
I am also wanting to pass the URL (that I want to assign to the request URL) in as a parameter to the HTTP Input node if possible. Any suggestions or examples on how to do that would be appreciated as well.
BTW. I am glad I found this site. You all are very helpful.  |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Apr 01, 2008 4:13 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Your code is fine except for the two problems mentioned - using double-quotes and setting the Environment instead of the LocalEnvironment. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
jfry |
Posted: Tue Apr 01, 2008 4:19 am Post subject: |
|
|
Apprentice
Joined: 31 Mar 2008 Posts: 32
|
I have changed the double-quotes to single-quotes. When I change Environment to LocalEnvironment as follows:
SET LocalEnvironment.Destination.HTTP.RequestURL = 'http://test.url.com';
I get a warning saying Identifier "LocalEnvironment" cannot be resolved. Do I just ignore this warning??
Also, what does mgk mean by "(and set the compute mode on the compute node to include LocalEnvironment)"? |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Apr 01, 2008 4:26 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Right, in a Compute node it needs to be InputLocalEnvironment or OutputLocalEnvironment.
The other comment is "look at the properties of the compute node". _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
jfry |
Posted: Tue Apr 01, 2008 5:01 am Post subject: |
|
|
Apprentice
Joined: 31 Mar 2008 Posts: 32
|
I found where to change the Compute Mode to include LocalEnvironment but there are a handful of options. Is there a reference book that you could recommend that has step-by-step examples in it? I feel as though I am doing this in pieces and am not really understanding what is going on.
Thank You.
BTW....I am using WebSphere Message Brokers Toolkit 6.0.2. |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Apr 01, 2008 5:17 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
|
Back to top |
|
 |
JosephGramig |
Posted: Tue Apr 01, 2008 5:24 am Post subject: |
|
|
 Grand Master
Joined: 09 Feb 2006 Posts: 1244 Location: Gold Coast of Florida, USA
|
|
Back to top |
|
 |
jfry |
Posted: Tue Apr 01, 2008 7:14 am Post subject: |
|
|
Apprentice
Joined: 31 Mar 2008 Posts: 32
|
I have the ESQL code working now thanks to all of you. I still have the RequestURL hard coded and need to figure out how to pass that into the HTTPInput node when calling the flow.
Thanks again for all of your help. I'm sure I will be posting more questions in the very near future. |
|
Back to top |
|
 |
jfry |
Posted: Thu Apr 03, 2008 12:22 pm Post subject: |
|
|
Apprentice
Joined: 31 Mar 2008 Posts: 32
|
I still have the RequestURL hard coded in the ESQL. I have been fighting with this for hours and am not able to figure out how to pass the value to use for RequestURL into the HTTPInput node of the flow. Does anyone have suggestions?
Thank You. |
|
Back to top |
|
 |
marcin.kasinski |
Posted: Thu Apr 03, 2008 12:30 pm Post subject: |
|
|
Sentinel
Joined: 21 Dec 2004 Posts: 850 Location: Poland / Warsaw
|
jfry wrote: |
... how to pass the value to use for RequestURL into the HTTPInput node of the flow... |
Can you elaborate it ?
What are you going to do ? _________________ Marcin |
|
Back to top |
|
 |
|