Author |
Message
|
tosaurav |
Posted: Wed Jun 20, 2007 11:00 am Post subject: HttpRequest from broker |
|
|
Acolyte
Joined: 16 Jan 2007 Posts: 62
|
Can I invoke servlet from message flow using any node? Instead of Webservice I have servlet as interface to interact.Would like to call servlket from MessageFlow.
Also what is the best option for logging n tracing in MessageFlow.Like using log4j one can introduce custom string on each step.Is there any similar mechnanism? |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Jun 20, 2007 11:52 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
The HTTPRequest node will talk to anything that listens on the HTTP Protocol.
There isn't a similar step to Log4J. You can use Log4J inside your Java code. You can use the ESQL LOG statement in your ESQL code - or the equivalent MbService methods inside your Java code.
You can use Broker tracing if you need to get statement level debug information - but this has a performance impact.
I believe that there's a DeveloperWorks article or two on error handling in Message Broker. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
tosaurav |
Posted: Wed Jun 20, 2007 12:25 pm Post subject: |
|
|
Acolyte
Joined: 16 Jan 2007 Posts: 62
|
I have multipart data to pass on to servlet.The flow having httpInput with Message domain as MIME.This node connect with HTTPRequest where url would be servlet pointers. This flow is not working resulting in broker timeout error as fault string. May be its wrong, can you suggest something?
Also what is needed to collect response, do i need to put httpreply node? |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Jun 20, 2007 12:30 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
No, the HTTPReply node is for *sending* an HTTP Reply to an HTTPInput node request.
If the HTTPRequest node is timing out, then the servlet is not liking what you are sending or otherwise failing to send an HTTP Reply inside the timeout period you configured on the HTTPRequest node.
You can use the TCP/IP monitor in the Toolkit to see what your flow sends out and what it receives over HTTP. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
marcin.kasinski |
Posted: Wed Jun 20, 2007 12:47 pm Post subject: |
|
|
Sentinel
Joined: 21 Dec 2004 Posts: 850 Location: Poland / Warsaw
|
jefflowrey wrote: |
You can use the TCP/IP monitor in the Toolkit to see what your flow sends out and what it receives over HTTP. |
TCP/IP monitor is very useful tool.
If you have servlet I assume you have little client which test your servlet.
Use TCP/IP monitor to capture client request and servlet response.
Then you can configure HTTPRequest node to collect the same data and compare it with working client if your flow is not working. _________________ Marcin |
|
Back to top |
|
 |
tosaurav |
Posted: Thu Jun 21, 2007 6:10 am Post subject: |
|
|
Acolyte
Joined: 16 Jan 2007 Posts: 62
|
Thanks for this info. How this TCP/IP tool work in this scenrio : I have HTML page to submit request.It sends the data to httpInput node(http://localhost:7080/TestClient),this node connected with httpRequest having url pointed to some other location.
As per the setting for TCP/IP i configured local port = some dummy unused,hostname = localhost,port = 7080,type = http.When I tried to submit request Monitor is nowhere though i checked the box when there is any activites.
Thanx |
|
Back to top |
|
 |
marcin.kasinski |
Posted: Thu Jun 21, 2007 6:34 am Post subject: |
|
|
Sentinel
Joined: 21 Dec 2004 Posts: 850 Location: Poland / Warsaw
|
TCP/IP tool you place between client and server.
Your TCP/IP tool should be configured to listen on some port and send requests to different port and/or port (server and port of your service).
Then you configure your client to send request not directly to servis but where TCP/IP tool is placed.
On TCP/IP tool you will see entire request from client and response from service. _________________ Marcin |
|
Back to top |
|
 |
tosaurav |
Posted: Thu Jun 21, 2007 6:48 am Post subject: |
|
|
Acolyte
Joined: 16 Jan 2007 Posts: 62
|
my understanding wrt current scenrio goes like this
TCP/IP monitor configuration : local monitoring port : 9465,hostname : localhost, port : 7080, type : http.
Above 7080 port is what i configure in httpinput node. so html page will have action :http://localhost:9465 instead of http://localhost:7080/TestClient(httpinput node uri).
Please correct me. |
|
Back to top |
|
 |
tosaurav |
Posted: Thu Jun 21, 2007 6:52 am Post subject: |
|
|
Acolyte
Joined: 16 Jan 2007 Posts: 62
|
|
Back to top |
|
 |
|