๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.socket
Article #3606

Posting a XML file with HTTP

#3606
From: Jan
Date: Tue, 05 Jul 2005 10:44
111 lines
4383 bytes
Hello,

I try to post a XML file but get always the error:
Invalid argument to data encode.
What is wrong with the code ?

      TStringList *LIpost = new TStringList;

      HTTP->Response->ContentType = "text/xml";   
      HTTP->Connect(IdTimeoutDefault);
      if (HTTP->Connected())  {
        sSourceFile = "C:\\Temp\\test.xml";
        LIpost->Clear();
        LIpost->LoadFromFile(sSourceFile);
        try  {
          HTTP->Post(PathHttp, LIpost);
         } catch(const Exception &e) {
           ShowMessage("Error encountered during POST: " + e.Message);
         }
      }

And here the XML file:

<schemainstances><schemainstance id="2851" schemamnemonic="product">
  <createdts>05/07/2005 10:26:08 AM</createdts>
		<name>CAMBQQA7D0A</name>
		<locales>
			<locale name="common">
					<foto>
					 <value>Q3702A_190X170.JPG</value>
					</foto>
					<category>
							<value>BQ</value>
					</category>
					<frontpage>
							<value>True</value>
					</frontpage>
					<price>
							<value>0</value>
					</price>
					<priceexcltax>
							<value>0</value>
					</priceexcltax>
					<vatrate>
							<value>21</value>
					</vatrate>
					<group>
							<value>CAM</value>
					</group>
					<rating />
					<backorder>
							<value>False</value>
					</backorder>
			</locale>
			<locale name="nl-be">
					<title>
							<value>Camera BenQ DC E53 4.92M Silver Extra Large 2.5inch
LCD</value>
					</title>
					<shortdescription>
							<value></value>
					</shortdescription>
					<longdescription>
							<value><![CDATA[Digital Camera BenQ DC E53 Extra Large LCD
Total pixels: 5.20 megapixels
Effective Pixels: 4.92 megapixels effective CCD
Image Resolution: 2560 x 1920, 2048 x 1536, 1280 x 960, 640 x 480
Lens: Focus Length: F=5.4~16.2mm
Lens aperture: F2.8 / F4.8
Focusing Range: Macro: 6 cm / Normal: 50 cm to infinity
Digital Zoom: 3.6x
Optical Zoom: 3x
Shutter Speed: 1/2 ~ 1/1000 sec
Flash: Auto /Forced /Flash off /Red-eye reduction /Night Scene 0.5m ~
2.7m
White Balance: Auto / Daylight / Incandescent/Fluorescent 1/
Fluorescent 2 / Cloudy / Manual
Movie Mode: AVI 320x240 pixels, Continuous recording
Self-Timer: 10 seconds, 2 seconds, 10+2 sec
Storage: SD card compatible
File Format: Still image: JPEG (EXIF 2.2), DCF, DPOF
Connectivity: Digital out: USB 1.1 / Audio /Video output / AC Adapter
Power Source: Rechargeable Lithium-ion battery /AC adaptor
LCD: 2.5๏ฟฝ Color LTPS LCD
Weight: 130 g (without battery)
Dimensions (WxDxH): 88.5x24x54.5mm
Voice memo: WAV format, 20 seconds
Included accessories:
Lithium-ion battery x 1 / USB + Power + AV 3 in 1 cable / AC adaptor /
SD memory card (32MB) / Camera pouch / Wrist strap / User๏ฟฝs manual /
Software CD (AP and Driver included)
Limited warranty: 2 years carry-in exchange
Other features:
Superior Lithium-ion Battery: last for at least 370 photos taken
Support ISO up to 200 for good color saturation
Macro Mode: 6cm
32 MB SD card bundled
Built-in microphone and speaker
Distinct 2.5" color LTPS LCD
Despite a diminutive form roughly the height and width of a business
card, the BenQ DC E53 still manages to incorporate a spacious 2.5"
color screens. And compared to ordinary TFT LCDs, these camera's LTPS
LCD offers color that is more vibrant and with
superior saturation. And its lower power consumption gives you longer
battery life for taking and browsing your photographs. The very act of
taking a photograph.
]]></value>
					</longdescription>
			</locale>
	</locales>
</schemainstance></schemainstances>
Technical Details
Message-ID: <42ca6485@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news-out.nntp.be!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,23338d9238b4b121,start
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII
From: "Jan" <jan@jlcsoft.com>
Subject: Posting a XML file with HTTP
Newsgroups: borland.public.cppbuilder.internet.socket
User-Agent: XanaNews/1.17.5.7
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
NNTP-Posting-Host: 81.164.55.128
Message-ID: <42ca6485@newsgroups.borland.com>
Date: 5 Jul 2005 03:44:21 -0700
X-Trace: newsgroups.borland.com 1120560261 81.164.55.128 (5 Jul 2005 03:44:21 -0700)
Lines: 111
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news-out.nntp.be!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail