Board index » delphi » Using ROPE in Delphi

Using ROPE in Delphi

Hi has anyone used ROPE in Delphi for calling WebServices, all examples that
I see are in VB.

Thanks Ross Pellegrino.

 

Re:Using ROPE in Delphi


I did at the time it was first released and I wal planning to reuse it these
days.

Re:Using ROPE in Delphi


Hi Alessandro,

I figured it out by using Variant type which is similar to VB in some ways.

procedure TForm1.Button1Click(Sender: TObject);
var
  v : Variant;
begin
  v := CreateOleObject('ROPE.Proxy');
  v.LoadServicesDescription( icURI, 'http://localhost/test1/codesite.xml');
  v.SendMsg('Hello');
end;

Quote
"Alessandro Federici" <a...@bigfoot.com> wrote in message

news:9424h2$fgf12@bornews.inprise.com...
Quote
> I did at the time it was first released and I wal planning to reuse it
these
> days.

Re:Using ROPE in Delphi


Hi Ross,

I notice that Code Central (a Borland Community resource) has a soap 'n rope
example by Berlin Lai that might prove to be of some use to you. Look in the
Delphi Source Code section for item # 15411.

Errol

Quote
Ross Pellegrino wrote:
> Hi has anyone used ROPE in Delphi for calling WebServices, all examples that
> I see are in VB.

> Thanks Ross Pellegrino.

Re:Using ROPE in Delphi


Hi Thanks Errol,

Where is this Source Code, I'm kind of confused as to the location.  I'm
interested though, it might help me in C++ code that I'm using.  Thanks!!!

Ross

"Errol H. Croy" <Err...@pacbell.net> wrote in message
news:3A64A0D8.76DC0BAE@pacbell.net...

Quote
> Hi Ross,

> I notice that Code Central (a Borland Community resource) has a soap 'n
rope
> example by Berlin Lai that might prove to be of some use to you. Look in
the
> Delphi Source Code section for item # 15411.

> Errol

> Ross Pellegrino wrote:

> > Hi has anyone used ROPE in Delphi for calling WebServices, all examples
that
> > I see are in VB.

> > Thanks Ross Pellegrino.

Re:Using ROPE in Delphi


Hi Ross,

I'll try to talk you down.....

Go to www.borland.com then go to the Community section. Once you are at the
Community main page, you will see on the left-hand menu an option to go to Code
Central (You may need to "join" or "register" or something like that....I don't
know for sure because I did this a long time ago and the Community section
reads a cookie and says hi to me each time and I'm allowed to navigate to all
sections without any further interaction with the authorization stuff).

The goodies that you want are in Code Central. The first screen at Code Central
has a table that displays all of the various categories of offerings, etc.
There is a Source Code row in the table and there are about 700 offerings in
the Delphi source code column. That is where you can find that item that I
mentioned last time.

Clear as mud, I'm sure! :-) Here is a direct link that you can try.
http://codecentral.borland.com/codecentral/ccweb.exe/home

Regards,
Errol

Quote
Ross Pellegrino wrote:
> Hi Thanks Errol,

> Where is this Source Code, I'm kind of confused as to the location.  I'm
> interested though, it might help me in C++ code that I'm using.  Thanks!!!

> Ross

> "Errol H. Croy" <Err...@pacbell.net> wrote in message
> news:3A64A0D8.76DC0BAE@pacbell.net...
> > Hi Ross,

> > I notice that Code Central (a Borland Community resource) has a soap 'n
> rope
> > example by Berlin Lai that might prove to be of some use to you. Look in
> the
> > Delphi Source Code section for item # 15411.

> > Errol

> > Ross Pellegrino wrote:

> > > Hi has anyone used ROPE in Delphi for calling WebServices, all examples
> that
> > > I see are in VB.

> > > Thanks Ross Pellegrino.

Re:Using ROPE in Delphi


Hi Errol, thanks, this is a very cool link.

I've downloaded the files and ran them, even his executable, but it errors
when I try to call the GetStockQuote function.  I'm going to try my Variant
version and see if that works.  I like what he's doing but it seems more
complicated than it needs to be.

Ross.

"Errol H. Croy" <Err...@pacbell.net> wrote in message
news:3A65D6DE.F5214C6@pacbell.net...

Quote
> Hi Ross,

> I'll try to talk you down.....

> Go to www.borland.com then go to the Community section. Once you are at
the
> Community main page, you will see on the left-hand menu an option to go to
Code
> Central (You may need to "join" or "register" or something like that....I
don't
> know for sure because I did this a long time ago and the Community section
> reads a cookie and says hi to me each time and I'm allowed to navigate to
all
> sections without any further interaction with the authorization stuff).

> The goodies that you want are in Code Central. The first screen at Code
Central
> has a table that displays all of the various categories of offerings, etc.
> There is a Source Code row in the table and there are about 700 offerings
in
> the Delphi source code column. That is where you can find that item that I
> mentioned last time.

> Clear as mud, I'm sure! :-) Here is a direct link that you can try.
> http://codecentral.borland.com/codecentral/ccweb.exe/home

> Regards,
> Errol

> Ross Pellegrino wrote:

> > Hi Thanks Errol,

> > Where is this Source Code, I'm kind of confused as to the location.  I'm
> > interested though, it might help me in C++ code that I'm using.
Thanks!!!

> > Ross

> > "Errol H. Croy" <Err...@pacbell.net> wrote in message
> > news:3A64A0D8.76DC0BAE@pacbell.net...
> > > Hi Ross,

> > > I notice that Code Central (a Borland Community resource) has a soap
'n
> > rope
> > > example by Berlin Lai that might prove to be of some use to you. Look
in
> > the
> > > Delphi Source Code section for item # 15411.

> > > Errol

> > > Ross Pellegrino wrote:

> > > > Hi has anyone used ROPE in Delphi for calling WebServices, all
examples
> > that
> > > > I see are in VB.

> > > > Thanks Ross Pellegrino.

Re:Using ROPE in Delphi


Ok Errol,  here's my solution vs Liu's solution:

My solution:
procedure TForm1.Button2Click(Sender: TObject);
var
  v : Variant;
  s : WideString;
begin
  v := CreateOleObject('ROPE.Proxy');
  v.LoadServicesDescription( icURI,
'http://www.soaptoolkit.com/SOAPDemo/services.xml');
  s := v.GetStockQuote('MSFT', 'any company');

  ShowMessage( s );
end;

//***************
His solution:
procedure TForm1.btnGetStockQuote_SWClick(Sender: TObject);
var  sRequestStruct, sRequestPayload,
     sResponsePayload, sTemp: String;
begin
  try
    SOAPPackager:= TSOAPPackager.Create(self);
    SOAPPackager.LoadServicesDescription(icSTRING, ServicesDescription);
    sRequestStruct:= SOAPPackager.GetMethodStruct('GetStockQuote', icINPUT);
    SOAPPackager.SetPayloadData(icREQUEST, '', 'GetStockQuote',
sRequestStruct);
    SOAPPackager.SetParameter(icREQUEST, 'symbol', txtSymbol.Text);
    SOAPPackager.SetParameter(icREQUEST, 'description', 'any company');
    sRequestPayload:= SOAPPackager.GetPayload(icREQUEST);
    WireTransfer:= TWireTransfer.Create(self);
    WireTransfer.AddStdSOAPHeaders(URI_LISTENER, 'GetStockQuote',
Length(sRequestPayload));
    sResponsePayload:= WireTransfer.PostDataToURI(URI_LISTENER,
sRequestPayload);
    SOAPPackager.SetPayload(icRESPONSE, sResponsePayload);
    sTemp:= SOAPPackager.GetParameter(icRESPONSE, 'price');

    If chkShowPackets.Checked Then
        Messagebox(handle, PChar(sRequestPayload), Pchar('SOAP XML Payload -
Client to Server'), MB_OK);
    If chkShowPackets.Checked Then
        Messagebox(handle, PChar(sResponsePayload), Pchar('SOAP XML
Payload -  Server To Client'), MB_OK);
    Messagebox(handle,Pchar('Share price = '+ sTemp),
Pchar(txtSymbol.Text),MB_OK);;
  finally
    FreeAndNil(SOAPPackager);
    FreeAndNil(WireTransfer);
  end;
end;

I would prefere the simpler version, however, I like to still study his
version on a lower technical level.  Tell me what you think.

Ross.

Quote
"Ross Pellegrino" <ross.pellegr...@visualinsights.com> wrote in message

news:3a65ef0f_1@dnews...
Quote
> Hi Errol, thanks, this is a very cool link.

> I've downloaded the files and ran them, even his executable, but it errors
> when I try to call the GetStockQuote function.  I'm going to try my
Variant
> version and see if that works.  I like what he's doing but it seems more
> complicated than it needs to be.

> Ross.

> "Errol H. Croy" <Err...@pacbell.net> wrote in message
> news:3A65D6DE.F5214C6@pacbell.net...
> > Hi Ross,

> > I'll try to talk you down.....

> > Go to www.borland.com then go to the Community section. Once you are at
> the
> > Community main page, you will see on the left-hand menu an option to go
to
> Code
> > Central (You may need to "join" or "register" or something like
that....I
> don't
> > know for sure because I did this a long time ago and the Community
section
> > reads a cookie and says hi to me each time and I'm allowed to navigate
to
> all
> > sections without any further interaction with the authorization stuff).

> > The goodies that you want are in Code Central. The first screen at Code
> Central
> > has a table that displays all of the various categories of offerings,
etc.
> > There is a Source Code row in the table and there are about 700
offerings
> in
> > the Delphi source code column. That is where you can find that item that
I
> > mentioned last time.

> > Clear as mud, I'm sure! :-) Here is a direct link that you can try.
> > http://codecentral.borland.com/codecentral/ccweb.exe/home

> > Regards,
> > Errol

> > Ross Pellegrino wrote:

> > > Hi Thanks Errol,

> > > Where is this Source Code, I'm kind of confused as to the location.
I'm
> > > interested though, it might help me in C++ code that I'm using.
> Thanks!!!

> > > Ross

> > > "Errol H. Croy" <Err...@pacbell.net> wrote in message
> > > news:3A64A0D8.76DC0BAE@pacbell.net...
> > > > Hi Ross,

> > > > I notice that Code Central (a Borland Community resource) has a soap
> 'n
> > > rope
> > > > example by Berlin Lai that might prove to be of some use to you.
Look
> in
> > > the
> > > > Delphi Source Code section for item # 15411.

> > > > Errol

> > > > Ross Pellegrino wrote:

> > > > > Hi has anyone used ROPE in Delphi for calling WebServices, all
> examples
> > > that
> > > > > I see are in VB.

> > > > > Thanks Ross Pellegrino.

Re:Using ROPE in Delphi


These are the 2 ways to use the ROPE engine for SOAP communications. Your
way is simpler and more high-level. His method is a bit more complex and
illustrates exactly how the SOAP request message is built before it is sent.
But in the end, both methods do the same exact thing.

have fun
--
Binh Ly
http://www.techvanguards.com

Quote
"Ross Pellegrino" <ross.pellegr...@visualinsights.com> wrote in message

news:3a65f47d$1_1@dnews...
Quote
> Ok Errol,  here's my solution vs Liu's solution:

> My solution:
> procedure TForm1.Button2Click(Sender: TObject);
> var
>   v : Variant;
>   s : WideString;
> begin
>   v := CreateOleObject('ROPE.Proxy');
>   v.LoadServicesDescription( icURI,
> 'http://www.soaptoolkit.com/SOAPDemo/services.xml');
>   s := v.GetStockQuote('MSFT', 'any company');

>   ShowMessage( s );
> end;

> //***************
> His solution:
> procedure TForm1.btnGetStockQuote_SWClick(Sender: TObject);
> var  sRequestStruct, sRequestPayload,
>      sResponsePayload, sTemp: String;
> begin
>   try
>     SOAPPackager:= TSOAPPackager.Create(self);
>     SOAPPackager.LoadServicesDescription(icSTRING, ServicesDescription);
>     sRequestStruct:= SOAPPackager.GetMethodStruct('GetStockQuote',
icINPUT);
>     SOAPPackager.SetPayloadData(icREQUEST, '', 'GetStockQuote',
> sRequestStruct);
>     SOAPPackager.SetParameter(icREQUEST, 'symbol', txtSymbol.Text);
>     SOAPPackager.SetParameter(icREQUEST, 'description', 'any company');
>     sRequestPayload:= SOAPPackager.GetPayload(icREQUEST);
>     WireTransfer:= TWireTransfer.Create(self);
>     WireTransfer.AddStdSOAPHeaders(URI_LISTENER, 'GetStockQuote',
> Length(sRequestPayload));
>     sResponsePayload:= WireTransfer.PostDataToURI(URI_LISTENER,
> sRequestPayload);
>     SOAPPackager.SetPayload(icRESPONSE, sResponsePayload);
>     sTemp:= SOAPPackager.GetParameter(icRESPONSE, 'price');

>     If chkShowPackets.Checked Then
>         Messagebox(handle, PChar(sRequestPayload), Pchar('SOAP XML
Payload -
> Client to Server'), MB_OK);
>     If chkShowPackets.Checked Then
>         Messagebox(handle, PChar(sResponsePayload), Pchar('SOAP XML
> Payload -  Server To Client'), MB_OK);
>     Messagebox(handle,Pchar('Share price = '+ sTemp),
> Pchar(txtSymbol.Text),MB_OK);;
>   finally
>     FreeAndNil(SOAPPackager);
>     FreeAndNil(WireTransfer);
>   end;
> end;

> I would prefere the simpler version, however, I like to still study his
> version on a lower technical level.  Tell me what you think.

> Ross.

Re:Using ROPE in Delphi


I totally agree.  I like to understand more of the low level. However, in
the long run, for 80%-90% of the time, the high level will do fine for most
people.

Actually, you showed me how to use Variant about a year ago, just to let you
know.

Thanks
Ross Pellegrino

Quote
"Binh Ly" <b...@techvanguards.com> wrote in message

news:3a66fc28$1_2@dnews...
Quote
> These are the 2 ways to use the ROPE engine for SOAP communications. Your
> way is simpler and more high-level. His method is a bit more complex and
> illustrates exactly how the SOAP request message is built before it is
sent.
> But in the end, both methods do the same exact thing.

> have fun
> --
> Binh Ly
> http://www.techvanguards.com

> "Ross Pellegrino" <ross.pellegr...@visualinsights.com> wrote in message
> news:3a65f47d$1_1@dnews...
> > Ok Errol,  here's my solution vs Liu's solution:

> > My solution:
> > procedure TForm1.Button2Click(Sender: TObject);
> > var
> >   v : Variant;
> >   s : WideString;
> > begin
> >   v := CreateOleObject('ROPE.Proxy');
> >   v.LoadServicesDescription( icURI,
> > 'http://www.soaptoolkit.com/SOAPDemo/services.xml');
> >   s := v.GetStockQuote('MSFT', 'any company');

> >   ShowMessage( s );
> > end;

> > //***************
> > His solution:
> > procedure TForm1.btnGetStockQuote_SWClick(Sender: TObject);
> > var  sRequestStruct, sRequestPayload,
> >      sResponsePayload, sTemp: String;
> > begin
> >   try
> >     SOAPPackager:= TSOAPPackager.Create(self);
> >     SOAPPackager.LoadServicesDescription(icSTRING, ServicesDescription);
> >     sRequestStruct:= SOAPPackager.GetMethodStruct('GetStockQuote',
> icINPUT);
> >     SOAPPackager.SetPayloadData(icREQUEST, '', 'GetStockQuote',
> > sRequestStruct);
> >     SOAPPackager.SetParameter(icREQUEST, 'symbol', txtSymbol.Text);
> >     SOAPPackager.SetParameter(icREQUEST, 'description', 'any company');
> >     sRequestPayload:= SOAPPackager.GetPayload(icREQUEST);
> >     WireTransfer:= TWireTransfer.Create(self);
> >     WireTransfer.AddStdSOAPHeaders(URI_LISTENER, 'GetStockQuote',
> > Length(sRequestPayload));
> >     sResponsePayload:= WireTransfer.PostDataToURI(URI_LISTENER,
> > sRequestPayload);
> >     SOAPPackager.SetPayload(icRESPONSE, sResponsePayload);
> >     sTemp:= SOAPPackager.GetParameter(icRESPONSE, 'price');

> >     If chkShowPackets.Checked Then
> >         Messagebox(handle, PChar(sRequestPayload), Pchar('SOAP XML
> Payload -
> > Client to Server'), MB_OK);
> >     If chkShowPackets.Checked Then
> >         Messagebox(handle, PChar(sResponsePayload), Pchar('SOAP XML
> > Payload -  Server To Client'), MB_OK);
> >     Messagebox(handle,Pchar('Share price = '+ sTemp),
> > Pchar(txtSymbol.Text),MB_OK);;
> >   finally
> >     FreeAndNil(SOAPPackager);
> >     FreeAndNil(WireTransfer);
> >   end;
> > end;

> > I would prefere the simpler version, however, I like to still study his
> > version on a lower technical level.  Tell me what you think.

> > Ross.

Other Threads