Question

I want to open http://www.google.com from IBM Message broker flow?Is it possible to do this?If so,please let me know how to do this?

Was it helpful?

Solution

Yes you can use the HTTPRequest node to make a request to google. If you want to actually perform a search you will need to construct the URI based on your search term. Some simple experimentation shows that the following works:

https://www.google.co.uk/?q=test#q=test

To override this on a per message basis you can override the HTTP destination in the LocalEnvironment (use a compute node to set LocalEnvironment.Destination.HTTP.RequestURL).

More details are available at: http://publib.boulder.ibm.com/infocenter/wmbhelp/v7r0m0/topic/com.ibm.etools.mft.doc/ac04595_.htm

If you want to do anything useful with the results you would of course have to parse the response document.

If you are planning to build a robust service that won't break when google alter their web page amrkup for example you may want to look into using one of the APIs instead, for example the XML based custom search API:

https://developers.google.com/custom-search/docs/xml_results

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top