Author |
Message
|
goldym |
Posted: Thu Feb 22, 2007 6:41 am Post subject: HTTPInput Question |
|
|
Centurion
Joined: 24 Jun 2005 Posts: 116
|
Can the HTTPInput node be configured to receive a GET instead of a post from a remote web server. In the help I see that the HTTPRequest can be changed to do use the GET method.
But can a remote web server pass parameters in the URL to the HTTPInput Node?
name1=value1&name2=value2? |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Feb 22, 2007 6:44 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I'm pretty sure v6 supports GET.
Create a simple test flow, with an HTTPInput connected to a Trace node. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
goldym |
Posted: Thu Feb 22, 2007 6:47 am Post subject: |
|
|
Centurion
Joined: 24 Jun 2005 Posts: 116
|
[quote="jefflowrey"]I'm pretty sure v6 supports GET.
Create a simple test flow, with an HTTPInput connected to a Trace node.[/quote]
I know that it supports GET b/c if you try and hit the url selector from a web browser I've seen the GET in the trace file. However the parameters they are trying to pass in the URL would have to stay the same? They could pass different parameters to the same HTTPInput node correct? |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Feb 22, 2007 6:48 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Those should show up somewhere in the HTTPInputHeader.
They shouldn't be parsed as part of the URL. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
mgk |
Posted: Thu Feb 22, 2007 6:51 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Hi,
Yes the V6 HTTPInput node supports HTTP GET and POST. And I think the latest fixpac for V6 also supports query string parameters (?a=b&b=c etc)for a POST request (as well as for GET)
Regards,
MGK _________________ 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 |
|
 |
jefflowrey |
Posted: Thu Feb 22, 2007 6:55 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I guess in some quick tests of my own, query string is passed in the message body.
But these are extremely rudimentary tests. YMMV. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
goldym |
Posted: Thu Feb 22, 2007 6:56 am Post subject: |
|
|
Centurion
Joined: 24 Jun 2005 Posts: 116
|
[quote="jefflowrey"]Those should show up somewhere in the HTTPInputHeader.
They shouldn't be parsed as part of the URL.[/quote]
Ok almost getting it?
So if I have my url selector set to /getData the remote web server will send to http://test.server.com:7080/getData?a=b&b=c and the parameters will be passed into the body of the HTTPInputHeader?
I tried this and it did not work, does anyone have a valid example. I keep getting the requested URL could not be retrieved is there something else I need set in the HTTPInput node? |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Feb 22, 2007 7:03 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I ran a quick test against a flow with an HTTPInput node hooked to a Trace node.
The query string was passed in InputRoot.BLOB.BLOB. If I had set the Message Domain to MIME, something else may have happened.
Needless to say, the HTTP Get timed out, as I didn't include an HTTPReply node...  _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
goldym |
Posted: Thu Feb 22, 2007 7:04 am Post subject: |
|
|
Centurion
Joined: 24 Jun 2005 Posts: 116
|
[quote="jefflowrey"]I ran a quick test against a flow with an HTTPInput node hooked to a Trace node.
The query string was passed in InputRoot.BLOB.BLOB. If I had set the Message Domain to MIME, something else may have happened.
Needless to say, the HTTP Get timed out, as I didn't include an HTTPReply node... [/quote]
Oh maybe b/c I have my HTTPInput Node set to XML? Can you paste your query string just to make sure I am doing it correctly? Thanks so much |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Feb 22, 2007 7:15 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Yeah, if you're specifying XML, that might not work... BLOB or MIME are your best bets for dealing with HTTP requests that might have mixed data.
I just did http://localhost:7070/TraceFlowURL?abc123
And got
***************
(0x01000000):HTTPInputHeader = (
(0x03000000):X-Original-HTTP-Command = 'GET http://localhost:7070/TraceFlowURL HTTP/1.1'
(0x03000000):Host = 'localhost:7070'
(0x03000000):User-Agent = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.9) Gecko/20061206 (CK-IBM) Firefox/1.5.0.9'
(0x03000000):Accept = 'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5'
(0x03000000):Accept-Language = 'en-us,en;q=0.5'
(0x03000000):Accept-Encoding = 'gzip,deflate'
(0x03000000):Accept-Charset = 'ISO-8859-1,utf-8;q=0.7,*;q=0.7'
(0x03000000):Keep-Alive = '300'
(0x03000000):Connection = 'keep-alive'
)
(0x01000000):BLOB = (
(0x03000000):UnknownParserName = ''
(0x03000000):BLOB = X'6162633132330d0a'
)
)
*************** _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
goldym |
Posted: Thu Feb 22, 2007 7:21 am Post subject: |
|
|
Centurion
Joined: 24 Jun 2005 Posts: 116
|
I just tested with BLOB and it I see the message in the debugger.
Do you know if there is anyway to retrieve the parameters passed in the URL I dont see them anywhere? |
|
Back to top |
|
 |
mgk |
Posted: Thu Feb 22, 2007 10:10 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Yes, this is as expected.
If you perform a GET with a query_string, the query string data is placed into the message body. From here you can use BLOB or create an MRM message set to parse it.
If you perform a POST with a query_string then (assuming you have a recent fix-pac) the query string is placed into an X- HTTP input header (I forget the exact name but it is something like X-Query-String). This is because, with a GET there is no body by definition, so the body can be the query string. With POST there will usually be a body as well as the 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 |
|
 |
goldym |
Posted: Thu Feb 22, 2007 10:12 am Post subject: |
|
|
Centurion
Joined: 24 Jun 2005 Posts: 116
|
Thanks I tested this with a HTTPInput Node and HTTPReply node used nettool to do the GET and the parameters were returned to the nettool.
thanks
[quote="mgk"]Yes, this is as expected.
If you perform a GET with a query_string, the query string data is placed into the message body. From here you can use BLOB or create an MRM message set to parse it.
If you perform a POST with a query_string then (assuming you have a recent fix-pac) the query string is placed into an X- HTTP input header (I forget the exact name but it is something like X-Query-String). This is because, with a GET there is no body by definition, so the body can be the query string. With POST there will usually be a body as well as the query string.
Regards,[/quote] |
|
Back to top |
|
 |
bocaflyboy |
Posted: Thu Feb 22, 2007 10:45 am Post subject: |
|
|
Newbie
Joined: 22 Feb 2007 Posts: 3
|
mgk wrote: |
Yes, this is as expected.
If you perform a GET with a query_string, the query string data is placed into the message body. From here you can use BLOB or create an MRM message set to parse it.
.... |
I tried to create a message set to parse it... used TDS1 with a ton of combinations of using the & as the group delimeter and = as the delimeter... Can you provide some guidance on the MRM Msg set creation?
Thx much! |
|
Back to top |
|
 |
goldym |
Posted: Thu Feb 22, 2007 11:12 am Post subject: |
|
|
Centurion
Joined: 24 Jun 2005 Posts: 116
|
I tried to use one of my existing messages sets from the samples gallery that included a message with one field.
Tried to add that to url query string and it keeps failing trying to parse.
I tried
http://localhost:7080/getTest?messagetype=INVREQ
and I keep getting the following errors
<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Server</faultcode>
<faultstring>BIP3113E: Exception detected in message flow HTTP Input (broker WBRK6_DEFAULT_BROKER) </faultstring>
<faultactor>HTTP:/getTest</faultactor>
<detail><text>Exception. BIP2230E: Error detected whilst processing a message in node 'Person.ResetContentDescriptor'. : F:\build\S600_P\src\DataFlowEngine\BasicNodes\ImbResetContentDescNode.cpp: 557: ImbResetContentDescNode::evaluate: ComIbmResetContentDescriptorNode: Person#FCMComposite_1_3
BIP5285E: Message Translation Interface Parsing Errors have occurred: : F:\build\S600_P\src\MTI\MTIforBroker\MtiImbParser2\MtiImbParser.cpp: 445: MtiImbParser::parseFirstChild: ComIbmResetContentDescriptorNode: Person#FCMComposite_1_3
BIP5171E: Custom Wire Format parsing error : F:\build\S600_P\src\cpi\pwf\cwf\cwfworker.cpp: 300: CWFWorker::parseNext: :
BIP5288E: MRM parsing error. Message bit stream larger than expected. : F:\build\S600_P\src\MTI\MTIforBroker\MtiImbParser2\MtiImbFIHandler.cpp: 998: MtiImbFIHandler::endMessageContent: : </text></detail>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Not sure how to create the message set can anyone provide any insight? |
|
Back to top |
|
 |
|