ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Dynamic URL in HTTP Request Node

Post new topic  Reply to topic Goto page 1, 2  Next
 Dynamic URL in HTTP Request Node « View previous topic :: View next topic » 
Author Message
jfry
PostPosted: Mon Mar 31, 2008 11:43 am    Post subject: Dynamic URL in HTTP Request Node Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Mon Mar 31, 2008 11:48 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

The HTTPRequest node can invoke dynamic URLs using the LocalEnvironment.Destination tree.

http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r1m0/index.jsp?topic=/com.ibm.etools.mft.doc/ac04595_.htm
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
jfry
PostPosted: Mon Mar 31, 2008 12:58 pm    Post subject: Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Mon Mar 31, 2008 1:01 pm    Post subject: Reply with quote

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
View user's profile Send private message
mgk
PostPosted: Tue Apr 01, 2008 12:51 am    Post subject: Reply with quote

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
View user's profile Send private message
jfry
PostPosted: Tue Apr 01, 2008 3:58 am    Post subject: Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Tue Apr 01, 2008 4:13 am    Post subject: Reply with quote

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
View user's profile Send private message
jfry
PostPosted: Tue Apr 01, 2008 4:19 am    Post subject: Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Tue Apr 01, 2008 4:26 am    Post subject: Reply with quote

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
View user's profile Send private message
jfry
PostPosted: Tue Apr 01, 2008 5:01 am    Post subject: Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Tue Apr 01, 2008 5:17 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/index.jsp?topic=/com.ibm.etools.mft.doc/ac02170_.htm
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
JosephGramig
PostPosted: Tue Apr 01, 2008 5:24 am    Post subject: Reply with quote

Grand Master

Joined: 09 Feb 2006
Posts: 1244
Location: Gold Coast of Florida, USA

jfry wrote:
Is there a reference book that you could recommend that has step-by-step examples in it?


Yep, there is a link at the top of this page (almost in the center) that says 'Info Center'. That book describes everything about WMB.

Here is the 6.1 link (probably the same info) to what you are specifically asking about:
http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r1m0/topic/com.ibm.etools.mft.doc/ac02240_.htm
Back to top
View user's profile Send private message AIM Address
jfry
PostPosted: Tue Apr 01, 2008 7:14 am    Post subject: Reply with quote

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
View user's profile Send private message
jfry
PostPosted: Thu Apr 03, 2008 12:22 pm    Post subject: Reply with quote

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
View user's profile Send private message
marcin.kasinski
PostPosted: Thu Apr 03, 2008 12:30 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Dynamic URL in HTTP Request Node
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.