Author |
Message
|
Raj kumar |
Posted: Thu Jan 08, 2009 9:31 am Post subject: How to send message in Http GET method |
|
|
 Novice
Joined: 27 Jun 2008 Posts: 14 Location: India
|
Hi friends,
I have a message flow setup in 6.0 WMB, where the HTTP client and HTTP Server are 2 message flows.
The client flow is as below
MQInput->Compute->HTTP Request->MQOutput
The server flow is as below
HTTPInput ->Compute->HTTP Reply
In the client compute node, I have set the LocalEnvironment override for HTTP GET and construct the request message and assigned to an element in a XML.
In HTTP Request node, I point to this element as the request message.
When I tried running this flow, the control has reached the HTTP Input nod e in server flow with a the HTTP header content length as same as the input request message length. However, I was not able to see the request message after HTTP Inputnode.
Any clues on this? Since I am not sure whether this is the rite way to send a HTTP get.
I noticed this behavior by inserting a Trace node in between the HTTP Input node and Compute node.
Could any please let me know what is wrong in this approach?
Thanks!
Raj. |
|
Back to top |
|
 |
marcin.kasinski |
Posted: Thu Jan 08, 2009 9:49 am Post subject: Re: How to send message in Http GET method |
|
|
Sentinel
Joined: 21 Dec 2004 Posts: 850 Location: Poland / Warsaw
|
1. Try use TCPMonitor to see request message
2. Isn't it problem with parsing input HTTP message ? _________________ Marcin |
|
Back to top |
|
 |
Raj kumar |
Posted: Thu Jan 08, 2009 10:00 am Post subject: |
|
|
 Novice
Joined: 27 Jun 2008 Posts: 14 Location: India
|
No, it's not throwing any errors. If it a problem, then it should not pass the HTTP Input node rite? |
|
Back to top |
|
 |
marcin.kasinski |
Posted: Thu Jan 08, 2009 10:03 am Post subject: |
|
|
Sentinel
Joined: 21 Dec 2004 Posts: 850 Location: Poland / Warsaw
|
Raj kumar wrote: |
No, it's not throwing any errors. If it a problem, then it should not pass the HTTP Input node rite? |
Can you place here content of trace and sending request ? _________________ Marcin |
|
Back to top |
|
 |
marcin.kasinski |
Posted: Thu Jan 08, 2009 10:29 am Post subject: |
|
|
Sentinel
Joined: 21 Dec 2004 Posts: 850 Location: Poland / Warsaw
|
Another question:
Did you set validation on HTTPInput node ?
HTTPInput node is throwing errors when validation is set.
If not set you have empty body. _________________ Marcin |
|
Back to top |
|
 |
Raj kumar |
Posted: Sat Jan 10, 2009 3:10 am Post subject: |
|
|
 Novice
Joined: 27 Jun 2008 Posts: 14 Location: India
|
Yes, I have set all the validations. |
|
Back to top |
|
 |
Raj kumar |
Posted: Mon Jan 12, 2009 1:35 am Post subject: |
|
|
 Novice
Joined: 27 Jun 2008 Posts: 14 Location: India
|
( ['WSRoot' : 0x82911f0]
(0x01000000:Name):Properties = ( ['WSPROPERTYPARSER' : 0x16c29f8]
(0x03000000:NameValue):MessageSet = '' (CHARACTER)
(0x03000000:NameValue):MessageType = '' (CHARACTER)
(0x03000000:NameValue):MessageFormat = '' (CHARACTER)
(0x03000000:NameValue):Encoding = 546 (INTEGER)
(0x03000000:NameValue):CodedCharSetId = 1208 (INTEGER)
(0x03000000:NameValue):Transactional = FALSE (BOOLEAN)
(0x03000000:NameValue):Persistence = FALSE (BOOLEAN)
(0x03000000:NameValue):CreationTime = GMTTIMESTAMP '2009-01-12 08:45:35.674' (GMTTIMESTAMP)
(0x03000000:NameValue):ExpirationTime = -1 (INTEGER)
(0x03000000:NameValue):Priority = 0 (INTEGER)
(0x03000000:NameValue):ReplyIdentifier = X'000000000000000000000000000000000000000000000000' (BLOB)
(0x03000000:NameValue):ReplyProtocol = 'SOAP-HTTP' (CHARACTER)
(0x03000000:NameValue):Topic = NULL
(0x03000000:NameValue):ContentType = 'text; charset=utf-8' (CHARACTER)
(0x03000000:NameValue):IdentitySourceType = '' (CHARACTER)
(0x03000000:NameValue):IdentitySourceToken = '' (CHARACTER)
(0x03000000:NameValue):IdentitySourcePassword = '' (CHARACTER)
(0x03000000:NameValue):IdentitySourceIssuedBy = '' (CHARACTER)
(0x03000000:NameValue):IdentityMappedType = '' (CHARACTER)
(0x03000000:NameValue):IdentityMappedToken = '' (CHARACTER)
(0x03000000:NameValue):IdentityMappedPassword = '' (CHARACTER)
(0x03000000:NameValue):IdentityMappedIssuedBy = '' (CHARACTER)
)
(0x01000000:Name):HTTPInputHeader = ( ['WSINPHDR' : 0xb10f70]
(0x03000000:NameValue):X-Original-HTTP-Command = 'GET http://localhost:7080/contact admin/StorePlugin/Dispatcher HTTP/1.0' (CHARACTER)
(0x03000000:NameValue):Content-Length = '37' (CHARACTER)
(0x03000000:NameValue):Content-Type = 'text; charset=utf-8' (CHARACTER)
(0x03000000:NameValue):Host = 'localhost:7080' (CHARACTER)
(0x03000000:NameValue):SOAPAction = '""' (CHARACTER)
(0x03000000:NameValue):X-Remote-Addr = '127.0.0.1' (CHARACTER)
(0x03000000:NameValue):X-Remote-Host = '127.0.0.1' (CHARACTER)
(0x03000000:NameValue):X-Server-Name = 'localhost' (CHARACTER)
(0x03000000:NameValue):X-Server-Port = '7080' (CHARACTER)
(0x03000000:NameValue):X-Scheme = 'http' (CHARACTER)
)
)
( ['WSINPHDR' : 0xb10f70]
(0x03000000:NameValue):X-Original-HTTP-Command = 'GET http://localhost:7080/contact admin/StorePlugin/Dispatcher HTTP/1.0' (CHARACTER)
(0x03000000:NameValue):Content-Length = '37' (CHARACTER)
(0x03000000:NameValue):Content-Type = 'text; charset=utf-8' (CHARACTER)
(0x03000000:NameValue):Host = 'localhost:7080' (CHARACTER)
(0x03000000:NameValue):SOAPAction = '""' (CHARACTER)
(0x03000000:NameValue):X-Remote-Addr = '127.0.0.1' (CHARACTER)
(0x03000000:NameValue):X-Remote-Host = '127.0.0.1' (CHARACTER)
(0x03000000:NameValue):X-Server-Name = 'localhost' (CHARACTER)
(0x03000000:NameValue):X-Server-Port = '7080' (CHARACTER)
(0x03000000:NameValue):X-Scheme = 'http' (CHARACTER)
)
( ['MQROOT' : 0x8290fc8]
(0x01000000:Name):Destination = (
(0x01000000:Name):HTTP = (
(0x03000000:NameValue):RequestIdentifier = X'414d51205742524b36315f4445464155fa1c64492005ba02' (BLOB)
)
)
)
( ['MQROOT' : 0x8290fc8]
(0x01000000:Name):Destination = (
(0x01000000:Name):HTTP = (
(0x03000000:NameValue):RequestIdentifier = X'414d51205742524b36315f4445464155fa1c64492005ba02' (BLOB)
)
)
)
This is the trace which I get in HTTP Input nodes output terminal. Any clues where did the input message go? |
|
Back to top |
|
 |
mgk |
Posted: Mon Jan 12, 2009 5:01 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Hello.
Err, HTTP GET requests are not expected to have a body. Why are you sending one as this breaks the HTTP spec?
Regards, _________________ 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 |
|
 |
marcin.kasinski |
Posted: Mon Jan 12, 2009 5:49 am Post subject: |
|
|
Sentinel
Joined: 21 Dec 2004 Posts: 850 Location: Poland / Warsaw
|
I haven’t noticed it’s GET.
WebServices use POST to send data.
In your example you are using GET.
Using GET you can send data but not so big and formatted as WS request.
This data is added to url.
In your trace I can see that you are not sending any data with GET method.
I wonder haw you have generated this WS request .
First thin use POST method. _________________ Marcin |
|
Back to top |
|
 |
Raj kumar |
Posted: Mon Jan 12, 2009 10:04 am Post subject: |
|
|
 Novice
Joined: 27 Jun 2008 Posts: 14 Location: India
|
In trace even i am not able to see the data, However in the HTTP Request node, I point to the constructed query string in the Advanced properties->Input Request Message Location.
I construct the query string and have that in an element in XML and point to that location in the advanced tab.
Can you tell me Is this the way to send HTTP GET request? Since I am new to this HTTP nodes. |
|
Back to top |
|
 |
marcin.kasinski |
Posted: Mon Jan 12, 2009 10:32 am Post subject: |
|
|
Sentinel
Joined: 21 Dec 2004 Posts: 850 Location: Poland / Warsaw
|
If you want to send GET request (not WS but simple HTTP GET request) you have to add your data at the end of requested URL:
Example:
http://host.com?data1=123&data2=234
... and use TCP Monitor to see data entire data you are sending.
HTTP GET is not good way to send XML!!!!!! Use HTTP POST method _________________ Marcin |
|
Back to top |
|
 |
Raj kumar |
Posted: Mon Jan 12, 2009 10:39 am Post subject: |
|
|
 Novice
Joined: 27 Jun 2008 Posts: 14 Location: India
|
Yes, I understand... however, I give the url in the HTTP Request node url property i.e. http://host.com. and in the compute node before this I am creating a request message from the input i.e. ?data1=123&data2=234
How do you I combine these two when requesting the HTTP server?
Is there is a way to do this? Is so please help.
I am posting this since I am not sure of what are the possibilities in GET |
|
Back to top |
|
 |
marcin.kasinski |
Posted: Mon Jan 12, 2009 10:55 am Post subject: |
|
|
Sentinel
Joined: 21 Dec 2004 Posts: 850 Location: Poland / Warsaw
|
No, no , no
I gave you example in last post .
In the Urp property in HTTP Request node you have to set entire url with data or create this url in compute node( http://host.com?data1=123&data2=234)
Try this.
... and again use TCPMonitor to see sending data. _________________ Marcin |
|
Back to top |
|
 |
mgk |
Posted: Mon Jan 12, 2009 11:18 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Hello
If you look up the HTTPRequest Node in the infocenter it will tell you what field to set in the LocalEnvrionment to override the default WebService URL on the node itself. It in this location in the LE that you need to set to be a full url of the form shown above with th query string.
Regards, _________________ 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 |
|
 |
Raj kumar |
Posted: Tue Jan 13, 2009 1:46 am Post subject: |
|
|
 Novice
Joined: 27 Jun 2008 Posts: 14 Location: India
|
Thanks guys for all your intrest in assisting me.
Finally, I was able to see the data sent as part of url in query String field in HTTP headers in HTTP Input node.
Now I have a question,
Is that concatination the created query string in compute node+ the URL from the HTTP RequestNode is not possible?
Is this the only way available to do GET method using HTTP nodes?
Since, we I tried setting the concatination in the compute node in LocalEnvironment, it seems to work. I just wanted to make my understanding clear. Please do clear my understanding. |
|
Back to top |
|
 |
|