cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: Error sending/receiving XML via curl

From: felix <felix_at_rabinovich.org>
Date: Thu, 25 Sep 2003 20:25:51 -0700

if you are trying to send XML from command line the simpleset is to put XML into the file, and use the following command:

curl -d @filename.xml http://example.com/servlet/XMLProcessingServlet

that works for me. If you need to send it from the web page - the first test that I had was to hardcode the xml text (from your test file) into a string and then post the string. Then you build the string dynamically (I assume that's what you want to do).

I went through this exercise (see http://www.rabinovich.org/phpbin/index.php for example), and the servlet code was not available to me - so let me know if you have any questions

Cheers,
Felix

----- Original Message -----
From: Bennett
To: curl-and-php_at_lists.sourceforge.net
Sent: Wednesday, September 24, 2003 1:13 PM
Subject: Error sending/receiving XML via curl

Hi,

I'm trying to use curl/php to post to a servlet that receives and returns xml.

Here's the command line I'm trying:

/usr/bin/curl -m 30 --data-binary $data_to_send http://$host:$port$path -L

where $data_to_send is a urlencoded xml stream.

and the error I'm receiving is:

Content is not allowed in prolog.

I've ensured that there's absolutely nothing before the "<?xml version..."
in $data_to_send (hidden or otherwise)

Does anyone have any ideas?

Please help,

TIA

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2003-09-26