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 Previous  1, 2
 Dynamic URL in HTTP Request Node « View previous topic :: View next topic » 
Author Message
jfry
PostPosted: Thu Apr 03, 2008 12:38 pm    Post subject: Reply with quote

Apprentice

Joined: 31 Mar 2008
Posts: 32

jfry wrote:
I 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;


I am trying to do the above but I want to pass "http://test.url.com" into the HTTP Input node and not have to hard code it in the ESQL.
Back to top
View user's profile Send private message
ImSoTired
PostPosted: Thu Apr 03, 2008 12:48 pm    Post subject: Reply with quote

Novice

Joined: 17 Apr 2007
Posts: 20
Location: Lima, Perú

Other way that you can try is that following:

SET OutputRoot.HTTPRequestHeader."X-Original-HTTP-URL" = 'http://pmdclbc01/WebServices/serviceCont.asmx';
Back to top
View user's profile Send private message
marcin.kasinski
PostPosted: Thu Apr 03, 2008 12:49 pm    Post subject: Reply with quote

Sentinel

Joined: 21 Dec 2004
Posts: 850
Location: Poland / Warsaw

jfry wrote:
jfry wrote:
I 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;


I am trying to do the above but I want to pass "http://test.url.com" into the HTTP Input node and not have to hard code it in the ESQL.



And what is a problem ?
Can you send any data to HTTP input ?
Can you add there this additional data.
What data is sent to HTTP input, SOAP request , standard HTTP GET or HTTP POST ?

Isn't it better to have URL in HTTP Request node based on business data from request rather than let client set this URL ?

I hope I understood you correctly...
_________________
Marcin
Back to top
View user's profile Send private message Visit poster's website
jfry
PostPosted: Thu Apr 03, 2008 1:00 pm    Post subject: Reply with quote

Apprentice

Joined: 31 Mar 2008
Posts: 32

I am calling the flow from a Java servlet that passes a SOAP request. The flow is being used as a pass thru for a call to a mainframe web service. I took the WSDL from the mainframe web service and generated a client for it in RAD which creates proxy classes, etc. This generated code somehow converts the object I am passing into a SOAP message and I cannot figure out how to add data to it. Even if I could add the URL to the SOAP message, I wouldn't know how to get at it from the flow.

The servlet calling the flow is determining the URL based upon the environment it is running in (i.e. Dev, Test, Model, etc.).
Back to top
View user's profile Send private message
marcin.kasinski
PostPosted: Thu Apr 03, 2008 1:14 pm    Post subject: Reply with quote

Sentinel

Joined: 21 Dec 2004
Posts: 850
Location: Poland / Warsaw

jfry wrote:
Even if I could add the URL to the SOAP message, I wouldn't know how to get at it from the flow.

.


Sorry for saying that but after reading this I think this problem is too complicated for you. No offence...

jfry wrote:
...
The servlet calling the flow is determining the URL based upon the environment it is running in (i.e. Dev, Test, Model, etc.).



You mean HTTP input URL or mainframe web service URL ?


General question is :

How do you know which mainframe web service URL you should use in your flow ?

If I understand you correctly you want to pass it from this servlet .

How this servlet could determine this mainframe web service URL ?
_________________
Marcin
Back to top
View user's profile Send private message Visit poster's website
jfry
PostPosted: Thu Apr 03, 2008 1:18 pm    Post subject: Reply with quote

Apprentice

Joined: 31 Mar 2008
Posts: 32

You are correct that I want to pass the URL of the mainframe web service from the servlet into the flow to be assigned to the RequestURL of the HTTPRequest node. The servlet is reading the URL from a database, which is different depending upon the environment.

Right now I have 5 copies of the same exact flows for Dev, Test, Model, Prod, and Hot fix. The ONLY difference in the flows is the URL for the HTTPRequest node.
Back to top
View user's profile Send private message
marcin.kasinski
PostPosted: Thu Apr 03, 2008 1:29 pm    Post subject: Reply with quote

Sentinel

Joined: 21 Dec 2004
Posts: 850
Location: Poland / Warsaw

Hm. It is little strange.

It means that from this servlet you have access to Dev, Test, Model, Prod, and Hot fix environment.

Isn't it better to separate environments ? I mean separate servlet, flow and mainframe WS
for Dev, Test, Model, Prod, and Hot fix environment ?

If you really have to add this URL I think the best way here is to add it as additional HTTP header in request from servlet to broker flow and then read it in flow.
_________________
Marcin
Back to top
View user's profile Send private message Visit poster's website
jfry
PostPosted: Fri Apr 04, 2008 5:01 am    Post subject: Reply with quote

Apprentice

Joined: 31 Mar 2008
Posts: 32

The servlet does NOT have access to Dev, Test, etc. environments. When the servlet is run in Dev, it knows that it is in Dev and can then tell the flow the Dev endpoint for the mainframe service. Same goes for Test, Model, etc. It's not important as to how the servlet knows what environment it is being run in, just that it does know.

Assuming I can figure out how to add an addition HTTP header in the request from the servlet, how would I read it in the flow? Any samples?

Thanks.
Back to top
View user's profile Send private message
marcin.kasinski
PostPosted: Fri Apr 04, 2008 9:18 am    Post subject: Reply with quote

Sentinel

Joined: 21 Dec 2004
Posts: 850
Location: Poland / Warsaw

jfry wrote:
how to add an addition HTTP header in the request from the servlet



It depends on WebService API which you use to send SOAP request.
Sometimes you can do it , sometimes not.

jfry wrote:
how to add an addition HTTP header in the request from the servlet, how would I read it in the flow? Any samples?


The best way is to send HTTP request in flow to trace node and see message tree. In this tree you will see this header. Then reading it is not very complicated.
_________________
Marcin
Back to top
View user's profile Send private message Visit poster's website
jefflowrey
PostPosted: Fri Apr 04, 2008 11:20 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You might also want to consider a UserDefinedProperty - if the request URL is static between messages, but not static between deploys.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
jfry
PostPosted: Fri Apr 04, 2008 1:14 pm    Post subject: Reply with quote

Apprentice

Joined: 31 Mar 2008
Posts: 32

jefflowrey wrote:
You might also want to consider a UserDefinedProperty - if the request URL is static between messages, but not static between deploys.


After researching UserDefinedProperty, it looks like you are suggesting using a JavaCompute node to look up the endpoint from the WebSphere Service Registry and Repository. Is that correct? If so, we are not using such a repository. If that is not correct, could you point me in the right direction of documentation on what you are referring to?
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Fri Apr 04, 2008 7:34 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

No.

I'm talking about a UDP, which is set on the Bar file, and can be accessed from ESQL or Java.

http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r1m0/index.jsp?topic=/com.ibm.etools.mft.doc/ac06007_.htm
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page Previous  1, 2 Page 2 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.