Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1062051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T18:33:55+00:00 2026-05-16T18:33:55+00:00

unit Unit2; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls,

  • 0
unit Unit2;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient,
  IdHTTP, IdIOHandler, IdIOHandlerSocket, IdIOHandlerStack,
  IdIntercept, IdCookieManager, IdZLibCompressorBase, IdCompressorZLib, IdSSL,
  IdSSLOpenSSL;

type
  TForm2 = class(TForm)
    IdHTTP1: TIdHTTP;
    Button1: TButton;
    Memo1: TMemo; 
    IdCompressorZLib1: TIdCompressorZLib;
    IdCookieManager1: TIdCookieManager;
    IdConnectionIntercept1: TIdConnectionIntercept;
    IdIOHandlerStack1: TIdIOHandlerStack;
    IdSSLIOHandlerSocketOpenSSL1: TIdSSLIOHandlerSocketOpenSSL;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    procedure StringToStream(const Text: string; Stream: TStream);
  end;

var
  Form2: TForm2;

implementation

{$R *.dfm}

procedure TForm2.StringToStream(const Text: string; Stream: TStream);
begin
  Stream.Write(Text[1], Length(Text));
end;

procedure TForm2.Button1Click(Sender: TObject);
var
  temp:string;
  SendStream: TStream;
  ResponseStream: TStream;
begin
    SendStream := TMemoryStream.Create;
    ResponseStream := TMemoryStream.Create;


    temp:=  '<?xml version="1.0"?>
<methodCall>
   <methodName>weblogUpdates.ping</methodName>
   <params>
      <param>
         <value>%WEBNAME%</value>
         </param>
      <param>
        <value>%WEBADDREESS%</value>
      </param>
      </params>
   </methodCall>'; // copied from text file where I was loading this

    temp:= StringReplace(temp, '%WEBNAME%', 'Generic Website Title',[rfReplaceAll, rfIgnoreCase]);
    temp:= StringReplace(temp, '%WEBADDREESS%', 'http://www.testingwebsite.com',[rfReplaceAll, rfIgnoreCase]);

    memo1.Lines.Add(temp);
    StringToStream(temp, SendStream); // convert to a stream
    SendStream.Position := 0;

    idhttp1.Request.Accept := '*/*';
    idhttp1.Request.ContentType := 'text/xml';
    idhttp1.Request.Connection := 'Keep-Alive';
    idhttp1.Request.ContentLength := Length(temp);
    memo1.lines.Add(idhttp1.Post('http://ping.feedburner.com', SendStream));
{
if FHostPort = 80 then
          Session.Post('http://' + FHostName + FEndPoint, SendStream,
            ResponseStream)
        else
          Session.Post('http://' + FHostName + ':' + IntToStr(FHostPort) +
            FEndPoint, SendStream, ResponseStream);

      if FSSLEnable then
        Session.Post('https://' + FHostName + ':' + IntToStr(FHostPort) +
          FEndPoint, SendStream, ResponseStream);

}
end;

end.

on the DFM, I set under idHTTP1 the compressor, CookieManager, Intercept, and IOHandler.
I copies the required OpenSSL dll files to the project folder

Keep getting the error:
Failed to parse XML-RPC request: XML document structures must start and end within the same entity

Any ideas on how to fix this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T18:33:56+00:00Added an answer on May 16, 2026 at 6:33 pm

    that’s an xml parser exception, probably thrown server-side.

    as the xml you’re sending is valid (however you really should be using an xml library to build it!), the error most likely means that the stream the server is receiving is being truncated… in other words the content-length header is less than the bytes sent.

    my guess is as you’re using a unicode enabled version of delphi, your content-length will be set to half of the actual bytes sent; change the datatype of Text in StringToStream to AnsiString.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, IdTCPClient;
This is my code: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics,
This is my whole code: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes,
I'm using Delphi 2006 and psvActiveScript . Example: unit Unit1; interface uses Windows, Messages,
Hi I have a problem with this code: unit Unit1; interface uses Windows, Messages,
Why will this not compile in Delphi 2009? unit VistaFolders; interface uses Windows, ShellAPI,
unit Unit7; interface uses Classes; type TListener = class(TThread) procedure Execute; override; end; TMyClass
I have a unit called RCLowPass which uses Unit2. It uses the object TForm2.
I want to unit test a RESTful interface written with Apache CXF. I use
What is the difference between: type IFooable = interface IDisposable abstract Foo : (unit

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.