[DUG] SOAP Question (lets see who the soap guru's are :P)
Jason Saggers
jasons at esp.co.nz
Fri Apr 27 15:50:52 NZST 2007
>From the example you have posted the Request being past into the
DoBeforeExecute isn't a var so cant be changed by the Procedure.
You can use the contents of the Request to do something, but you cant
alter it.
-----Original Message-----
From: delphi-bounces at delphi.org.nz [mailto:delphi-bounces at delphi.org.nz]
On Behalf Of Nick
Sent: Friday, 27 April 2007 3:09 p.m.
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] SOAP Question (lets see who the soap guru's are :P)
Ah im still not having any luck.
This is what I did
type
TCHTTPRIO = class(THTTPRIO)
procedure DoBeforeExecute(const MethodName: string; Request:
TStream); override;
end;
procedure TCHTTPRIO.DoBeforeExecute(const MethodName: string; Request:
TStream);
var
StrStrm: TStringStream;
ReqW: WideString;
Req:string;
begin
inherited;
Req := ReqW;
StrStrm := TStringStream.Create(Req);
try
StrStrm.Position := 0;
Request.CopyFrom( StrStrm, 0 );
finally
StrStrm.Free;
end;
end;
However, it still doesn't overwrite the request stream.
I might be missing something obvious, but I can't see it....
I put a showmessage('hi'); in my new TCHTTPRIO.DoBeforeExecute and it
shows...
Edward Koryagin wrote:
> Sorry I don't remember all details...
> I inherited from THTTPRIO and did changes to tags to
> build correct request to SOAP server.
>
> --- Nick <nick at salehoo.com> wrote:
>
>
>> This page does - my mistake
>> http://qc.borland.com/wc/qcmain.aspx?d=14046
>>
>> Nick wrote:
>>
>>> Correct, and I see the soap request when I look at
>>>
>> the DoBeforeExexute
>>
>>> I can't modify the var given however this page
>>>
>> shows how you can
>>
>>> modify the thttprio
>>>
>>>
> http://www.google.com/apis/adwords/developer/adwords_api_classref.html
>
>>> but havn't done that yet (will have to re-compile
>>>
>> that component?)
>>
>>>
>>> Edward Koryagin wrote:
>>>
>>>> Are you working with THTTPRIO?
>>>>
>>>> --- Nick <nick at salehoo.com> wrote:
>>>>
>>>>
>>>>
>>>>> How do you mean? Changed it to/for what for
>>>>>
>> what?
>>
>>>>> : - )
>>>>>
>>>>> Edward Koryagin wrote:
>>>>>
>>>>>
>>>>>> for THTTPRIO
>>>>>> on DoBeforeExecute
>>>>>> I changed Request manually
>>>>>>
>>>>>> --- Nick <nick at salehoo.com> wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>> Hey there,
>>>>>>>
>>>>>>> Thanks for that! :-)
>>>>>>> I compared the different between the D2007 and
>>>>>>>
>>>>>>>
>>>>> D2006
>>>>>
>>>>>
>>>>>>> and I can see the D2007 is better, some calls
>>>>>>>
>> much simpler. ie
>>
>>>>>>> D2007 -> function getUsageQuotaThisMonth:
>>>>>>> Int64; stdcall;
>>>>>>> D2006 -> function
>>>>>>>
>>>>> getUsageQuotaThisMonth(const
>>>>>
>>>>>
>>>>>>> parameters: getUsageQuotaThisMonth):
>>>>>>> getUsageQuotaThisMonthResponse; stdcall;
>>>>>>> I got the D2006 one working, but would of been
>>>>>>> simplir if I had 2007 lol.
>>>>>>>
>>>>>>> I got my other pas files working except when
>>>>>>>
>> the
>>
>>>>>>> parameter is an array, I also just tried with
>>>>>>>
>> the D2007 and also
>>
>>>>>>> get an
>>>>>>> error when the parameter is an array.
>>>>>>> Here is an example.
>>>>>>>
>>>>>>> var
>>>>>>> param : Array_Of_KeywordRequest; { decleared
>>>>>>>
>> as
>>
>>>>>>> Array_Of_KeywordRequest = array of
>>>>>>>
>>>>>>>
>>>>> KeywordRequest; }
>>>>>
>>>>>
>>>>>>> begin
>>>>>>> Setlength(param, 1);
>>>>>>> param[0] := KeywordRequest.Create;
>>>>>>> param[0].id := 0;
>>>>>>> param[0].maxCpc := 5;
>>>>>>> param[0].negative := false;
>>>>>>> param[0].text := 'ipod';
>>>>>>> param[0].type_ := Broad;
>>>>>>> res := ( Intf as TrafficEstimatorInterface
>>>>>>> ).estimateKeywordList(param);
>>>>>>>
>>>>>>> it complies fine but when it runs it gets a
>>>>>>>
>> soap
>>
>>>>>>> error. Any call that doesn't use an array as a
>>>>>>>
>> param runs fine.
>>
>>>>>>> O.o
>>>>>>>
>>>>>>> Jeremy North wrote:
>>>>>>>
>>>>>>>
>>>>>>>> Hi Nick,
>>>>>>>>
>>>>>>>> Here are two from D2007. Don't know if they
>>>>>>>>
>> are
>>
>>>>>>>>
>>>>>>>>
>>>>>>> correct.
>>>>>>>
>>>>>>>
>>>>>>>> Let me know if they are still wrong and I'll
>>>>>>>>
>> bug
>>
>>>>>>>>
>>>>>>>>
>>>>>>> the right guy at
>>>>>>>
>>>>>>>
>>>>>>>> CodeGear about this.
>>>>>>>>
>>>>>>>> cheers,
>>>>>>>> Jeremy
>>>>>>>>
>>>>>>>> On 4/26/07, Nick <nick at salehoo.com> wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>>> Right, I am trying to get an app written
>>>>>>>>>
>> which
>>
>>>>>>>>>
>>>>>>>>>
>>>>> in
>>>>>
>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>> Delphi 2006 to do
>>>>>>>
>>>>>>>>> with the
>>>>>>>>> Google Adwords API.
>>>>>>>>> The old method I did was
>>>>>>>>> Program sends data to my web server --> Web
>>>>>>>>>
>>>>>>>>>
>>>>>>> server handles all the
>>>>>>>
>>>>>>>>> soap to
>>>>>>>>> Google --> Info is sent back to my program
>>>>>>>>> All done with indy.
>>>>>>>>>
>>>>>>>>> However I want to get away from that method
>>>>>>>>>
>> and
>>
>>>>>>>>>
>>>>>>>>>
>>>>>>> talk soap right to
>>>>>>>
>>>>>>>>> Google.
>>>>>>>>> So, I fired up Delphi, created a new
>>>>>>>>>
>>>>>>>>>
>>>>> application.
>>>>>
>>>>>
>>>>>>>>> Then Imported one of the WSDL's from Google
>>>>>>>>> ( With project open (must be open), File,
>>>>>>>>>
>> New,
>>
>>>>>>>>>
>>>>>>>>>
>>>>>>> Other, Webservices, WSDL
>>>>>>>
>>>>>>>
>>>>>>>>> importer)
>>>>>>>>> And now I have my pas file.
>>>>>>>>> I put that in the uses section of my first
>>>>>>>>>
>> form
>>
>>>>>>>>>
>>>>>>>>>
>>>>>>> (at the top before the
>>>>>>>
>>>>>>>
>>>>>>>>> types)
>>>>>>>>>
>>>>>>>>> Now... what the heck do I do with it. I have
>>>>>>>>>
>>>>>>>>>
>>>>>>> spent the best part of 4
>>>>>>>
>>>>>>>>> hours
>>>>>>>>> trying to figure this out and im getting
>>>>>>>>>
>>>>>>>>>
>>>>>>> no-where.
>>>>>>>
>>>>>>>
>>>>>>>>> Here is the WSDL location (of one of them)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>
https://adwords.google.com/api/adwords/v10/TrafficEstimatorService?wsdl
>
>>>>
>>>>
>>>>>>
>>>>>>
>>>>>>>>> I have also attached the generated pas file.
>>>>>>>>> O.o
>>>>>>>>>
>>>>>>>>> My brain hurts, and all I have got is With
>>>>>>>>> GetInfoInterface(true,'',HTTPRIO1) do
>>>>>>>>> lol
>>>>>>>>>
>>>>>>>>> Cheers
>>>>>>>>>
>>>>>>>>> //
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>
************************************************************************
>
>>>>
>>>>
>>>>>>
>>>>>>
>>>>>>>>> //
>>>>>>>>> // The types declared in this file were
>>>>>>>>>
>>>>>>>>>
>>>>> generated
>>>>>
>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>> from data read from
>>>>>>>
>>>>>>>>> the
>>>>>>>>> // WSDL File described below:
>>>>>>>>> // WSDL :
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
> https://adwords.google.com/api/adwords/v10/InfoService?wsdl
>
>>>>
>>>>
>>>>>>
>>>>>>
>>>>>>>>> // Encoding : UTF-8
>>>>>>>>> // Version : 1.0
>>>>>>>>> // (24/04/2007 11:04:16 a.m. - 16.03.2006)
>>>>>>>>> //
>>>>>>>>>
> === message truncated ===
>
>
> Edward Koryagin
>
> Send instant messages to your online friends
http://au.messenger.yahoo.com
> _______________________________________________
> NZ Borland Developers Group - Delphi mailing list
> Post: delphi at delphi.org.nz
> Admin: http://delphi.org.nz/mailman/listinfo/delphi
> Unsubscribe: send an email to delphi-request at delphi.org.nz with
Subject: unsubscribe
>
>
_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: delphi at delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-request at delphi.org.nz with Subject:
unsubscribe
More information about the Delphi
mailing list