Thread: xml post
Status: Alpha
Brought to you by:
coroberti
From: Matt L. <mat...@av...> - 2008-10-28 16:15:32
|
Hello, I am trying to do an xml post with curl-loader similar to the curl commad below: curl -F file=@/tmp/addexistingaccount.xml http://localhost/nomadesk/index.php?TaskNavigator::Task=ReceiveMessage How is a similar command created in curl-loader .conf file? I have tried setting the UPLOAD_FILE tag, to no avail. Best Regards, Matt Love |
From: Robert I. <cor...@gm...> - 2008-10-29 09:50:18
|
Hi Matt, On Tue, Oct 28, 2008 at 5:59 PM, Matt Love <mat...@av...> wrote: > I am trying to do an xml post with curl-loader similar to the curl commad > below: > > curl -F file=@/tmp/addexistingaccount.xml > http://localhost/nomadesk/index.php?TaskNavigator::Task=ReceiveMessage > > How is a similar command created in curl-loader .conf file? I have tried > setting the UPLOAD_FILE tag, to no avail. > I am trying to guess, what you are doing, since PRF was not provided, which is normally including your configuration, command-line, etc Could it be, that you missed that it should be POST or POST after GET? You may wish to run your curl command line, collect the capture by wireshark and attach it. There are several examples in curl-loader examples, like: curl-loader/conf-examples/post-form-tokens-fr-file.conf Still, without the PRF and the capture, it is just guessing. Sincerely, Robert Iakobashvili |
From: Matt L. <mat...@av...> - 2008-10-29 11:26:23
|
Below is a conf file I have tried to use (unsuccessfully) to post an xml file. ########### GENERAL SECTION ################################ BATCH_NAME= nomadeskpoll CLIENTS_NUM_MAX=1 # Same as CLIENTS_NUM INTERFACE=eth0 NETMASK=16 IP_ADDR_MIN= 192.168.2.71 IP_ADDR_MAX= 192.168.2.128 CYCLES_NUM=1 URLS_NUM= 1 ########### URL SECTION #################################### URL=http://192.168.2.56/nomadesk/index.phpTask?Navigator::Task=ReceiveMe ssage URL_SHORT_NAME="Poll" REQUEST_TYPE=POST UPLOAD_FILE=./conf-examples/poll2.xml TIMER_URL_COMPLETION = 5000 TIMER_AFTER_URL_SLEEP = 5000 The xml file looks like this: <?xml version="1.0" encoding="utf-8" standalone="yes"?><Poll><Accounts><Account><AccountName>nmua000014</Acco untName><Password>aventiv23</Password></Account></Accounts><LocationID>b f42425f-fcef-11a3-aaab-199121138cb3</LocationID><ClientVersion>2.6.0.13< /ClientVersion><CreationTstamp>10/28/2008 7:00:30 AM</CreationTstamp></Poll> And my command line: curl-loader -f ./conf-examples/nomadeskpoll.conf wireshark sees this: 761.972165 Vmware_d6:4b:dd -> Broadcast ARP Who has 192.168.2.56? Tell 192.168.2.71 761.972667 Vmware_b9:1e:c2 -> Vmware_d6:4b:dd ARP 192.168.2.56 is at 00:0c:29:b9:1e:c2 761.972672 192.168.2.71 -> 192.168.2.56 TCP 47403 > http [SYN] Seq=0 Win=5840 Len=0 MSS=1460 TSV=167834233 TSER=0 WS=7 761.972832 192.168.2.56 -> 192.168.2.71 TCP http > 47403 [SYN, ACK] Seq=0 Ack=1 Win=5792 Len=0 MSS=1460 TSV=167910328 TSER=167834233 WS=7 761.972854 192.168.2.71 -> 192.168.2.56 TCP 47403 > http [ACK] Seq=1 Ack=1 Win=5888 Len=0 TSV=167834235 TSER=167910328 761.973090 192.168.2.71 -> 192.168.2.56 TCP [TCP segment of a reassembled PDU] 761.973265 192.168.2.56 -> 192.168.2.71 TCP http > 47403 [ACK] Seq=1 Ack=212 Win=6912 Len=0 TSV=167910329 TSER=167834235 761.973660 192.168.2.56 -> 192.168.2.71 HTTP HTTP/1.1 100 Continue 761.973665 192.168.2.71 -> 192.168.2.56 TCP 47403 > http [ACK] Seq=212 Ack=26 Win=5888 Len=0 TSV=167834236 TSER=167910329 761.973907 192.168.2.71 -> 192.168.2.56 HTTP PUT /nomadesk/index.phpTask?Navigator::Task=ReceiveMessage HTTP/1.1 761.974298 192.168.2.56 -> 192.168.2.71 HTTP HTTP/1.1 405 Method Not Allowed (text/html) 761.974431 192.168.2.56 -> 192.168.2.71 TCP http > 47403 [FIN, ACK] Seq=570 Ack=595 Win=7936 Len=0 TSV=167910330 TSER=167834236 761.974435 192.168.2.71 -> 192.168.2.56 TCP 47403 > http [ACK] Seq=595 Ack=571 Win=7040 Len=0 TSV=167834237 TSER=167910330 761.974609 192.168.2.71 -> 192.168.2.56 TCP 47403 > http [FIN, ACK] Seq=595 Ack=571 Win=7040 Len=0 TSV=167834237 TSER=167910330 761.974734 192.168.2.56 -> 192.168.2.71 TCP http > 47403 [ACK] Seq=571 Ack=596 Win=7936 Len=0 TSV=167910330 TSER=167834237 In the sourceforge TODO doc for curl-loader I see that "transparent support for POST-ing some file, e.g. a SOAP file" is on the TODO list for the next beta. This seems to be exactly what I need. So would there be a non-transparent way (workaround) to achieve this same thing in the current release? Thank you, Matt Love From: Robert Iakobashvili [mailto:cor...@gm...] Sent: Wednesday, October 29, 2008 10:50 AM To: curl-loader-devel Subject: Re: xml post Hi Matt, On Tue, Oct 28, 2008 at 5:59 PM, Matt Love <mat...@av...> wrote: I am trying to do an xml post with curl-loader similar to the curl commad below: curl -F file=@/tmp/addexistingaccount.xml http://localhost/nomadesk/index.php?TaskNavigator::Task=ReceiveMessage How is a similar command created in curl-loader .conf file? I have tried setting the UPLOAD_FILE tag, to no avail. I am trying to guess, what you are doing, since PRF was not provided, which is normally including your configuration, command-line, etc Could it be, that you missed that it should be POST or POST after GET? You may wish to run your curl command line, collect the capture by wireshark and attach it. There are several examples in curl-loader examples, like: curl-loader/conf-examples/post-form-tokens-fr-file.conf Still, without the PRF and the capture, it is just guessing. Sincerely, Robert Iakobashvili |
From: Robert I. <cor...@gm...> - 2008-10-29 12:29:46
|
Hi Matt, On Wed, Oct 29, 2008 at 1:26 PM, Matt Love <mat...@av...> wrote: > REQUEST_TYPE=POST > > wireshark sees this: > > 761.972165 Vmware_d6:4b:dd -> Broadcast ARP Who has 192.168.2.56? Tell > 192.168.2.71 > > 761.972667 Vmware_b9:1e:c2 -> Vmware_d6:4b:dd ARP 192.168.2.56 is at > 00:0c:29:b9:1e:c2 > > 761.972672 192.168.2.71 -> 192.168.2.56 TCP 47403 > http [SYN] Seq=0 > Win=5840 Len=0 MSS=1460 TSV=167834233 TSER=0 WS=7 > > 761.972832 192.168.2.56 -> 192.168.2.71 TCP http > 47403 [SYN, ACK] Seq=0 > Ack=1 Win=5792 Len=0 MSS=1460 TSV=167910328 TSER=167834233 WS=7 > > 761.972854 192.168.2.71 -> 192.168.2.56 TCP 47403 > http [ACK] Seq=1 Ack=1 > Win=5888 Len=0 TSV=167834235 TSER=167910328 > > 761.973090 192.168.2.71 -> 192.168.2.56 TCP [TCP segment of a reassembled > PDU] > > 761.973265 192.168.2.56 -> 192.168.2.71 TCP http > 47403 [ACK] Seq=1 > Ack=212 Win=6912 Len=0 TSV=167910329 TSER=167834235 > > 761.973660 192.168.2.56 -> 192.168.2.71 HTTP HTTP/1.1 100 Continue > > 761.973665 192.168.2.71 -> 192.168.2.56 TCP 47403 > http [ACK] Seq=212 > Ack=26 Win=5888 Len=0 TSV=167834236 TSER=167910329 > > 761.973907 192.168.2.71 -> 192.168.2.56 HTTP PUT > /nomadesk/index.phpTask?Navigator::Task=ReceiveMessage HTTP/1.1 > > 761.974298 192.168.2.56 -> 192.168.2.71 HTTP HTTP/1.1 405 Method Not > Allowed (text/html) > > 761.974431 192.168.2.56 -> 192.168.2.71 TCP http > 47403 [FIN, ACK] > Seq=570 Ack=595 Win=7936 Len=0 TSV=167910330 TSER=167834236 > > 761.974435 192.168.2.71 -> 192.168.2.56 TCP 47403 > http [ACK] Seq=595 > Ack=571 Win=7040 Len=0 TSV=167834237 TSER=167910330 > > 761.974609 192.168.2.71 -> 192.168.2.56 TCP 47403 > http [FIN, ACK] > Seq=595 Ack=571 Win=7040 Len=0 TSV=167834237 TSER=167910330 > > 761.974734 192.168.2.56 -> 192.168.2.71 TCP http > 47403 [ACK] Seq=571 > Ack=596 Win=7936 Len=0 TSV=167910330 TSER=167834237 > > In the sourceforge TODO doc for curl-loader I see that "transparent support > for POST-ing some file, e.g. a SOAP file" is on the TODO list for the next > beta. This seems to be exactly what I need. So would there be a > non-transparent way (workaround) to achieve this same thing in the current > release? > > What we see from the wireshark trace is that the first HTTP is most probably POST or PUT (you may wish to use the "Decode AS" function of wireshark GUI or look at the capture text strings) with subsequent 100 Continue and further PUT HTTP request attempt, responded by 405 + more decoded Could you, please, either attach the capture or send the HTTP-decoded stream? Thanks. Robert |
From: Matt L. <mat...@av...> - 2008-10-30 14:29:15
|
The decoded response is: Server: Apache/2.2.8 (Fedora)^M Allow: GET,HEAD,POST,OPTIONS,TRACE^M Content-Length: 320^M Connection: close^M Content-Type: text/html; charset=iso-8859-1^M ^M <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>405 Method Not Allowed</title> </head><body> <h1>Method Not Allowed</h1> <p>The requested method PUT is not allowed for the URL /nomadesk/index.phpTask.</p> <hr> <address>Apache/2.2.8 (Fedora) Server at 192.168.2.56 Port 80</address> </body></html> Ãà IH<8d>^@^@B^@^@^@B^@^@^@^@^L)ÃKÃ^@^L)¹^^Ã^H^@E^@^@4<82>ü@^@@^F1øÃ¨^BBG^&Ã^A^W^CxÃà IL<8d>^@^@B^@^@^@B^@^@^@^@^L)¹^^Ã^@^L)ÃKÃ^H^@E^@^@4uë@^@@^F? è^BGè^&ÃÃà IÃ<8d>^@^@B^@^@^@B^@^@^@^@^L)¹^^Ã^@^L)ÃKÃ^H^@E^@^@4uì@^@@^F?^Hè ^Cy^Oà ^BGè^B8<&ÃÃà IH<8e>^@^@B^@^@^@B^@^@^@^@^L)ÃKÃ^@^L)¹^^Ã^H^@E^@^@4<82>ý@^@@^F1÷ ^Cy^Oà è&Ã^A^W^Cy^@P<8c>j_&¦b^D«xä<80>^P^@>Â¥Â^@^@^A^A^H ^Oà The server wants a POST, but is there a way for me to pass a file in the CONF file to use as the POST stream? This is really easy to do with curl with the command: "curl -F file=@post.xml http://urltopostto.php", I figured it would be just as easy in curl-loader but so far, no luck! Thanks again for any help. Regards, Matt Love From: Robert Iakobashvili [mailto:cor...@gm...] Sent: Wednesday, October 29, 2008 1:30 PM To: curl-loader-devel Subject: Re: xml post Hi Matt, On Wed, Oct 29, 2008 at 1:26 PM, Matt Love <mat...@av...> wrote: REQUEST_TYPE=POST wireshark sees this: 761.972165 Vmware_d6:4b:dd -> Broadcast ARP Who has 192.168.2.56 <http://192.168.2.56/> ? Tell 192.168.2.71 <http://192.168.2.71/> 761.972667 Vmware_b9:1e:c2 -> Vmware_d6:4b:dd ARP 192.168.2.56 <http://192.168.2.56/> is at 00:0c:29:b9:1e:c2 761.972672 192.168.2.71 <http://192.168.2.71/> -> 192.168.2.56 <http://192.168.2.56/> TCP 47403 > http [SYN] Seq=0 Win=5840 Len=0 MSS=1460 TSV=167834233 TSER=0 WS=7 761.972832 192.168.2.56 <http://192.168.2.56/> -> 192.168.2.71 <http://192.168.2.71/> TCP http > 47403 [SYN, ACK] Seq=0 Ack=1 Win=5792 Len=0 MSS=1460 TSV=167910328 TSER=167834233 WS=7 761.972854 192.168.2.71 <http://192.168.2.71/> -> 192.168.2.56 <http://192.168.2.56/> TCP 47403 > http [ACK] Seq=1 Ack=1 Win=5888 Len=0 TSV=167834235 TSER=167910328 761.973090 192.168.2.71 <http://192.168.2.71/> -> 192.168.2.56 <http://192.168.2.56/> TCP [TCP segment of a reassembled PDU] 761.973265 192.168.2.56 <http://192.168.2.56/> -> 192.168.2.71 <http://192.168.2.71/> TCP http > 47403 [ACK] Seq=1 Ack=212 Win=6912 Len=0 TSV=167910329 TSER=167834235 761.973660 192.168.2.56 <http://192.168.2.56/> -> 192.168.2.71 <http://192.168.2.71/> HTTP HTTP/1.1 100 Continue 761.973665 192.168.2.71 <http://192.168.2.71/> -> 192.168.2.56 <http://192.168.2.56/> TCP 47403 > http [ACK] Seq=212 Ack=26 Win=5888 Len=0 TSV=167834236 TSER=167910329 761.973907 192.168.2.71 <http://192.168.2.71/> -> 192.168.2.56 <http://192.168.2.56/> HTTP PUT /nomadesk/index.phpTask?Navigator::Task=ReceiveMessage HTTP/1.1 761.974298 192.168.2.56 <http://192.168.2.56/> -> 192.168.2.71 <http://192.168.2.71/> HTTP HTTP/1.1 405 Method Not Allowed (text/html) 761.974431 192.168.2.56 <http://192.168.2.56/> -> 192.168.2.71 <http://192.168.2.71/> TCP http > 47403 [FIN, ACK] Seq=570 Ack=595 Win=7936 Len=0 TSV=167910330 TSER=167834236 761.974435 192.168.2.71 <http://192.168.2.71/> -> 192.168.2.56 <http://192.168.2.56/> TCP 47403 > http [ACK] Seq=595 Ack=571 Win=7040 Len=0 TSV=167834237 TSER=167910330 761.974609 192.168.2.71 <http://192.168.2.71/> -> 192.168.2.56 <http://192.168.2.56/> TCP 47403 > http [FIN, ACK] Seq=595 Ack=571 Win=7040 Len=0 TSV=167834237 TSER=167910330 761.974734 192.168.2.56 <http://192.168.2.56/> -> 192.168.2.71 <http://192.168.2.71/> TCP http > 47403 [ACK] Seq=571 Ack=596 Win=7936 Len=0 TSV=167910330 TSER=167834237 In the sourceforge TODO doc for curl-loader I see that "transparent support for POST-ing some file, e.g. a SOAP file" is on the TODO list for the next beta. This seems to be exactly what I need. So would there be a non-transparent way (workaround) to achieve this same thing in the current release? What we see from the wireshark trace is that the first HTTP is most probably POST or PUT (you may wish to use the "Decode AS" function of wireshark GUI or look at the capture text strings) with subsequent 100 Continue and further PUT HTTP request attempt, responded by 405 + more decoded Could you, please, either attach the capture or send the HTTP-decoded stream? Thanks. Robert |
From: Robert I. <cor...@gm...> - 2008-10-30 14:52:27
|
Hi Matt, On Thu, Oct 30, 2008 at 4:28 PM, Matt Love <mat...@av...> wrote: > The decoded response is: > > > > The server wants a POST, but is there a way for me to pass a file in the > CONF file to use as the POST stream? This is really easy to do with curl > with the command: "curl –F file=@post.xml http://urltopostto.php", I > figured it would be just as easy in curl-loader but so far, no luck! > Please, send to me two wireshark packet captures: a. from curl –F file=@post.xml http://urltopostto.php b. from cul-loader. Thanks. -- Truly, Robert Iakobashvili, Ph.D. ...................................................................... Assistive technology that understands you ...................................................................... |
From: Matt L. <mat...@av...> - 2008-11-04 10:40:09
|
That works! Thank you for your help, I am now happily load testing. From: Robert Iakobashvili [mailto:cor...@gm...] Sent: Saturday, November 01, 2008 3:17 PM To: curl-loader-devel Subject: Re: xml post I got it. Let's use the workaround as recommended by Alex. Please, try the following: 1. Either checkout the latest version of curl-loader subversion or use the files attached; 2. Configuration: URL=http://192.168.2.56/nomadesk/index.phpTask?Navigator::Task=ReceiveMe ssage URL_SHORT_NAME="Poll" TIMER_URL_COMPLETION = 5000 TIMER_AFTER_URL_SLEEP = 5000 REQUEST_TYPE=POST FORM_USAGE_TYPE= AS_IS FORM_STRING=<Poll><Accounts><Account><AccountName>nmua000014</AccountNam e><Password>aventiv23</Password></Account></Accounts><LocationID>bf42425 f-fcef-4ea3-aaab-199120138cb3</LocationID><ClientVersion>2.6.0.13</Clien tVersion><CreationTstamp>10/28/2008 7:00:30 AM</CreationTstamp></Poll> FORM_STRING should be a single line, containing your XML file content without any newline symbols, because it is read as a single line by fgets. The length is limited at 8K, by you can increase it at parse_conf.c by increasing the buffer size here: char fgets_buff[1024*8]; Give it a try! Truly, Robert Iakobashvili, Ph.D. ...................................................................... www.ghotit.com Assistive technology that understands you ...................................................................... |
From: Robert I. <cor...@gm...> - 2008-11-04 11:29:07
|
Hi Matt, On Tue, Nov 4, 2008 at 12:39 PM, Matt Love <mat...@av...> wrote: > That works! > > Thank you for your help, I am now happily load testing. > Good news. Thanks! Thanks also to Alex for his workaround procedure. The final fix will be to resolve the issue in libcurl, when on configuring file uploading the library takes PUT instead of POST. When we'll have time... -- Truly, Robert Iakobashvili, Ph.D. ...................................................................... www.ghotit.com Assistive technology that understands you ...................................................................... |