<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Great suggestion Edward.&nbsp; I already have this event in my inherited
class (I used it for testing and compression in some other projects).&nbsp;
This might be the easiest way to do it.<br>
<br>
Thanks<br>
Rob<br>
<div class="moz-signature">
<div class="Section1"><br>
<p class="MsoNormal"><span style="color: rgb(255, 153, 0);" lang="EN-NZ"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="" lang="EN-NZ"><o:p>&nbsp;</o:p></span></p>
</div>
</div>
<br>
On 26/02/2010 12:03 p.m., Edward Koryagin wrote:
<blockquote cite="mid:224615.97876.qm@web65615.mail.ac4.yahoo.com"
 type="cite">
  <pre wrap="">You still can use SOAP here...

There is OnBeforeExecute event for THTTPRIO... ;)
Actually you have to inherit from THTTPRIO to change XML in this event.

Edward Koryagin


--- On Fri, 26/2/10, Robert martin <a class="moz-txt-link-rfc2396E" href="mailto:rob@chreos.co.nz">&lt;rob@chreos.co.nz&gt;</a> wrote:

  </pre>
  <blockquote type="cite">
    <pre wrap="">From: Robert martin <a class="moz-txt-link-rfc2396E" href="mailto:rob@chreos.co.nz">&lt;rob@chreos.co.nz&gt;</a>
Subject: [DUG] Http help
To: "NZ Borland Developers Group - Delphi List" <a class="moz-txt-link-rfc2396E" href="mailto:delphi@delphi.org.nz">&lt;delphi@delphi.org.nz&gt;</a>
Received: Friday, 26 February, 2010, 11:13 AM




 

 
Hi Guys



I had imported a WSDL file and built a soap service to send
data to a
web service.&nbsp; Unfortunately there is a bug in the WSDL
that impacts
delphi but seems to be ignored in Microsoft tools (it
really is a
problem with the wsdl file).&nbsp; Anyway since it is a
simple job I thought
it might be quicker to fix by just removing the soap and
building the
XML manually and posting it with idHttp.&nbsp; 



However I cant get it to work !&nbsp; When I try and post
my test xml to the
web serivce I get an 'Invalid IOHandler' message in
the app.&nbsp; I have no
ioHandler defined but that works fine in my other apps
where I post to
php based web services.&nbsp; I am sure it is just some
weird indy bug but I
am under a huge deadline and need to sort this.&nbsp; Any
help would be
greatly appreciated.



code follows (this is quick and dirty proof of concept
code)



var

&nbsp;&nbsp;&nbsp;
sl&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
: TStringList;

&nbsp;&nbsp;&nbsp;
PostDataStream&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :
TStringStream;

&nbsp;&nbsp;&nbsp; SendStream&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
: TStringStream;

begin

&nbsp;&nbsp;&nbsp; PostDataStream&nbsp; :=
TStringStream.Create('');

&nbsp;&nbsp;&nbsp; sl := TStringList.Create;

&nbsp;&nbsp;&nbsp; try

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
IdHTTP.Request.Username := '9313527067946306';

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
IdHTTP.Request.Password := 'passdfsw9634306';

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
IdHTTP.ReadTimeout := 5000;



&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
sl.LoadFromFile('E:\Work\Test
post\TestRequest.XML');

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
SendStream&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :=
TStringStream.Create(sl.text);





&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
IdHTTP.Post('<a class="moz-txt-link-freetext" href="https://uateclonline.nzpost.co.nz/eclonlinewebnowse/Services.asmx">https://uateclonline.nzpost.co.nz/eclonlinewebnowse/Services.asmx</a>',
SendStream, PostDataStream);&nbsp; //Error here 



&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
ShowMessage(PostDataStream.DataString);

&nbsp;&nbsp;&nbsp; finally

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sl.Free;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
PostDataStream.Free;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
SendStream.Free;

&nbsp;&nbsp;&nbsp; end;















-- 

 
 
 
 
 
Robert Martin





Robert Martin 
Software
development
manager 
 &nbsp; 
Chreos 
<a class="moz-txt-link-abbreviated" href="http://www.chreos.co.nz">www.chreos.co.nz</a>

Ph +64 03 377-0495 

&nbsp; 
 &nbsp; 

&nbsp; 


 


-----Inline Attachment Follows-----

_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: <a class="moz-txt-link-abbreviated" href="mailto:delphi@delphi.org.nz">delphi@delphi.org.nz</a>
Admin: <a class="moz-txt-link-freetext" href="http://delphi.org.nz/mailman/listinfo/delphi">http://delphi.org.nz/mailman/listinfo/delphi</a>
Unsubscribe: send an email to <a class="moz-txt-link-abbreviated" href="mailto:delphi-request@delphi.org.nz">delphi-request@delphi.org.nz</a>
with Subject: unsubscribe
    </pre>
  </blockquote>
  <pre wrap="">

      


_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: <a class="moz-txt-link-abbreviated" href="mailto:delphi@delphi.org.nz">delphi@delphi.org.nz</a>
Admin: <a class="moz-txt-link-freetext" href="http://delphi.org.nz/mailman/listinfo/delphi">http://delphi.org.nz/mailman/listinfo/delphi</a>
Unsubscribe: send an email to <a class="moz-txt-link-abbreviated" href="mailto:delphi-request@delphi.org.nz">delphi-request@delphi.org.nz</a> with Subject: unsubscribe

  </pre>
</blockquote>
</body>
</html>