Article View: borland.public.cppbuilder.internet.socket
Article #3608Re: Posting a XML file with HTTP
From: Jan
Date: Tue, 05 Jul 2005 11:57
Date: Tue, 05 Jul 2005 11:57
63 lines
2600 bytes
2600 bytes
Hans Galema wrote:
> What component are you using ?
> On which statement do you get the error ?
I use Indy version 9.00.10 and BCB 5
> Do you get the error in the catch block ?
No, on the Post method
>
> > TStringList *LIpost = new TStringList;
>
> > HTTP->Post(PathHttp, LIpost);
>
> Well you are trying to post -the contents of- a TStringList.
>
>
> Please first try to post a file or TStringList that only has a line
> of five and does not contain CDATA. Is that possible ? Is it
> only whith this specific file ?
>
I have try with a small XML file without CDATA and get thesame error.
I don't think I need to pass a parameter list to the HTTP.
The URL is quite normal:
http://192.168.2.191/synchronize/schemainstance_import.aspx and runs
now on a locat test webserver with the latest .Net framework.
I have also try with a Stream, but no difference.
String PathHttp =
"http://192.168.2.191/synchronize/schemainstance_import.aspx";
TMemoryStream *Astream = new TMemoryStream();
Astream->Clear();
Astream->LoadFromFile("C:\\Temp\\Test.xml");
HTTP->Post(PathHttp, Astream);
And the Test.Xml :
<schemainstances><schemainstance id="2851" schemamnemonic="product">
<createdts>05/07/2005 01:46:04 PM</createdts>
<name>CAMBQQA6D1A</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>
</locale>
<locale name="nl-be">
<title>
<value>Camera BenQ DC E40 4.0M GOLD</value>
</title>
</locale>
</locales>
</schemainstance></schemainstances>
Technical Details
Message-ID:
<42ca75b0@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!news-out.nntp.be!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<42ca6485@newsgroups.borland.com> <42ca6ce0$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,23338d9238b4b121 X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Jan" <jan@jlcsoft.com> Subject: Re: Posting a XML file with HTTP Newsgroups: borland.public.cppbuilder.internet.socket References: <42ca6485@newsgroups.borland.com> <42ca6ce0$1@newsgroups.borland.com> User-Agent: XanaNews/1.17.5.7 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 NNTP-Posting-Host: 81.164.55.128 Message-ID: <42ca75b0@newsgroups.borland.com> Date: 5 Jul 2005 04:57:36 -0700 X-Trace: newsgroups.borland.com 1120564656 81.164.55.128 (5 Jul 2005 04:57:36 -0700) Lines: 63 Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.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