SOAP on Delphi XE

I am Starting a new project. Where I need to extract and display in vcl controls data from a website. I am not the web programmer. He is planing to use SOAP to publish this data. I am new to web service and need an example (SIMPLE) of how to handle a client.
Thanks in Advance
Donald S. Bossen
0
Donald
11/4/2011 4:33:13 PM
embarcadero.delphi.webservices 976 articles. 0 followers. Follow

3 Replies
670 Views

Similar Articles

[PageSpeed] 58

- First, you start a new project
- Go to Menu -> Component -> Import WSDL...
- in the wizard that appears, you must enter the http (or https) address of the SOAP server you want to use, then just press next...and keep all the default settings as they are. After the wizard is completed, you will be shown the imported code (in pascal)
- place a button on your form
- add the imported code unit to the uses part of your main form (so you can use the imported wsdl in your form)
- in the onClick Event of your button you must place the code that connects to the SOAP server

Now, you must analyse a bit the wsdl imported code. There are many ways the imported code can look like, for example the wsdl might use (or not) a
Look for the following sections:

somethingSoap = interface(IInvokable)
  ['{08C546A5-6C1C-A24F-4113-FEB7524A9E0F}']
    function  DoSomething(request):some_answer_type
....

You need this IInvokable interface for your first step in your code. So in your button event you will place a var like:
var
  P:somethingSoap;
  answ:some_answer_type;
....
begin
  P := somethingSoap(false, '', nil);
.... here you must do the assignments for your request variable then you must call the function declared in the wsdl... for example the doSomething(request)
 answ:=P.DoSomething(request);
.... then you must take the answer (answ) and extract information from it in order to show it in your form.

That is all.
Of course there are a few variations of the request-response stuff.
For example the request might be an xml or normal pascal variables (depends on the way the imported WSDL looks like)
So if in the wsdl imported code your function looks like this:
function  DoSomething(const Name: string; const Phone: string; const IsItMale: Boolean; const SocialSecurityNo: string): AnswResourceDetails; stdcall;

then in you main form code, the function call will be made like any other function in delphi... so something like:
answ:=P.DoSomething('Matt Simpson','0017677788',false,'3446364533435',);
and that is all

But your imported function might look like this:

CerereOfertaIn = class(TRemotable)
  private
    Fname: string;
    FPhone: string;
    FIsItMale: Boolean;
    FSocialSecurityNo: string;
  public
    destructor Destroy; override;
  published
    property Name:          string                       read FName write FName;
    property Phone:          string         read FPhone write FPhone;
    property IsItMale:  boolean read FIsItMale write FIsItMale;
    property SocialSecurityNo:         string                       read FSocialSecurityNo write FSocialSecurityNo;
  end;


somethingSoap = interface(IInvokable)
  ['{5BD795E6-EA32-DBD7-ADB7-F8020AB3758D}']

    function  doSomething(const request: CerereOfertaIn): CerereOfertaOut; stdcall;
(of course CerereOfertaOut will be found in the WSDL imported code just like the CerereOfertaIn )

In this case... you will need to use a var like:
var
req:CerereOfertaIn;
resp:CerereOfertaOut;
....
begin
  P := somethingSoap(false, '', nil);
  req:=CerereOfertaIn.Create;
  req.Name:='ssdfsds';
  req.Phone:='';
....
  resp:=P.doSomething(req);
.... then to show the response in your form
you can use the resp.responsepart1... depending on the structure of your response object.

That is it.
Of course there are many ways you might need to authenticate yourself to the SOAP server.
using username and password, using authentication headers and so on...
But that is may not be the case for you.
Hope this helped



> {quote:title=Donald Bossen wrote:}{quote}
> I am Starting a new project. Where I need to extract and display in vcl controls data from a website. I am not the web programmer. He is planing to use SOAP to publish this data. I am new to web service and need an example (SIMPLE) of how to handle a client.
> Thanks in Advance
> Donald S. Bossen
0
Softwarex
11/6/2011 10:50:54 AM
> {quote:title=Donald Bossen wrote:}{quote}
> I am Starting a new project. Where I need to extract and display in vcl controls data from a website. I am not the web programmer. He is planing to use SOAP to publish this data. I am new to web service and need an example (SIMPLE) of how to handle a client.
> Thanks in Advance
> Donald S. Bossen

Was I helpful?
0
Softwarex
11/8/2011 10:40:57 PM
Hello,

>I am Starting a new project. Where I need to extract and display in vcl 
>controls data from a website. I am not the web programmer. He is planing to 
>use SOAP to publish this data. I am new to web service and need an example 
>(SIMPLE) of how to handle a client.


You can also take a peek at these tutorials:

http://edn.embarcadero.com/article/40973
http://blogs.embarcadero.com/pawelglowacki/2008/12/18/38624 (you may skip 
the portion about building a service and go directly to the "Building Delphi 
2009 Web Service client application" section)

Bottom line is you'll need the WSDL of the WebService; then use the WSDL 
Importer to generate a Delphi/C++ unit that contains code to interact with 
the service.

Cheers,

Bruneau
0
Jean
11/10/2011 12:28:40 AM
Reply:

Similar Artilces:

Delphi 7 to Delphi XE
Have been using Delphi 7 for many moons ( have got later versions but never upgraded to ) My first problem is: Component Palette. in XE it is a small toolbar docked in top right in Delphi 7 it gives a large view of all the components. I am struggling to be able to cope/access my components.in Delphi XE. Can I make the component pallette tool bar the same size as Delphi 7, or is there a fast way to view/choose all available components in XE, that I have not spotted yet? Kind Regards, Robert. Hi, What I know is that in Delphi 2010 and XE you can choose between t...

Delphi XE / Delphi 2010
Hello! I noticed that Embarcadero® Delphi® 2010 Version is not on the list of products on Embarcadero page. Or is it still possible to buy it? Will RAD Studio XE compile programs written in Delphi 2010 without problems.? Thanks. Am 13.09.2010 09:04, schrieb Petra Nemec: > Will RAD Studio XE compile programs written in Delphi 2010 without problems.? As always you will probably have to recreate the projects as the import is still a bit -- special. Christian Hello! Does anybody know if it is still possible to get a Delphi2010 trial version (if yes where)? ...

Migrating to Delphi XE from Delphi 7.0
Below is my code in Delphi 7.0, this is how to call another units in webmodule... Hello All, I create a web application in Delphi 7.0, using the Web Server Application, CGI, IntraWeb 7.0.15. And I used TIWPageProducer to view like this url "http://localhost/mcr/mcr.exe/main". I built and run. I viewed in thru IIS and it is running... This is my code in Delphi 7.0 .... .... procedure TWebModule1.proMainGetForm(ASender: TIWPageProducer; AWebApplication: TIWApplication; var VForm: TIWPageForm); begin VForm := TfrmMain.Create(AWebApplication); end; procedure TWebModule1....

Migrating to Delphi XE from Delphi 7.0
Below is my code in Delphi 7.0, this is how to call another units in webmodule... Hello All, I create a web application in Delphi 7.0, using the Web Server Application, CGI, IntraWeb 7.0.15. And I used TIWPageProducer to view like this url "http://localhost/mcr/mcr.exe/main". I built and run. I viewed in thru IIS and it is running... This is my code in Delphi 7.0 .... .... procedure TWebModule1.proMainGetForm(ASender: TIWPageProducer; AWebApplication: TIWApplication; var VForm: TIWPageForm); begin VForm := TfrmMain.Create(AWebApplication); end;...

Migrate from Delphi 2007 for Win32 to Delphi XE
we use Delphi 2007 for Win32 to support legacy (32Bit) OWL-based pascal applications (yes i know it was a mistake not to switch to VCL 15 years ago). could our applications still be opened and compiled with Delphi XE? The existing projects are all plain Pascal-Code, coming back from the times of Turbo Pascal for Windows and later on Borland Pascal. Are there any improvements we could profit from (i.e IDE, Debugger)? Thanks Andrej > {quote:title=Andrej Dimic wrote:}{quote} > could our applications still be opened and compiled with Delphi XE? I'm not sure, but I guess ...

Error on Delphi 6 but not on Delphi Xe for Ftp
I am Experimenting with get a file from our webside server via Ftp. I have 2 Machines 1 a laptop runing XP Delphi 6 Indy 10.5.8.0 An a machine runing Window 7 Delphi XE2 with Indy 10.5.8.0. I am using the Same Code on Both. procedure TFrmMain.ProcessItemDalySpecial; var PathDest : String; FileName : String; begin with FrmTb2 do begin if ReadIniBoolean(IniCfg,'FTP','UseFtpDaly') then begin Ftp.Host := ReadIniStr(IniCfg,'FTP','HostDaly'); Ftp.Port := ReadIniInt(IniCfg,'FTP'...

Delphi and Delphi for .Net
It seems that Delphi for .Net is slower than Delphi Win32 native applicaiton. I would like to know is it true all .Net application is slower than Win32 native applicaiton or it is Delphi for .Net only. Your information is great appreciated, Inung On 2011-06-21 18:20:17 +0100, Inung Huang said: > It seems that Delphi for .Net is slower than Delphi Win32 native applicaiton. > I would like to know is it true all .Net application is slower than > Win32 native applicaiton or it is Delphi for .Net only. If you are only running the code in the application once then, yes, yo...

Migration from Delphi 2007 Rad to Delphi XE Where is Quickreports
Have installed and finally registered Delphi Xe, I am looking for Quickreports but am unable to find it anywhere, I asked the Distributer and was told its packaged in Delphi XE, Well I should have gone to specsavers......cos I cant see it any where ? > {quote:title=Colin Coleman wrote:}{quote} > Have installed and finally registered Delphi Xe, I am looking for Quickreports but am unable to find it anywhere, I asked the Distributer and was told its packaged in Delphi XE, Well I should have gone to specsavers......cos I cant see it any where ? Hello Colin, Delphi X...

Migrating from Delphi 6 to Delphi XE 3! [Edit]
All, I am a Delphi developer working in an windows form application developed using Delphi 6. Now, we are planning to upgrade the development tool. Can anyone provide me information related to major roadblocks that we can face while migrating from Delphi 6 to Delphi XE 3? Should we migrate to Delphi XE 3 or any other preferred version of Delphi based on the fact that our target users will be using Windows 7 or Windows 8? Do we have any tools or utilities to migrate the source code from Delphi 6 to higher version of Delphi? Also, any suggestions related to best practices are welcome....

Delphi 7.0 code convert to delphi XE ...
Hello All, I create an application using Web Server Application then CGI stand alone... In WebModule I add ModuleController component and IWPageProcedure... Below is my code in Delphi 7.0, this is how to call another units in webmodule... .... .... procedure TWebModule1.proMainGetForm(ASender: TIWPageProducer; AWebApplication: TIWApplication; var VForm: TIWPageForm); begin VForm := TfrmMain.Create(AWebApplication); end; procedure TWebModule1.proLogInGetForm(ASender: TIWPageProducer; AWebApplication: TIWApplication; var VForm: TIWPageForm); begin VForm := TfrmLogIn.Create(AWebA...

Delphi 5 (string[80]) vs Delphi XE
Hi guys i'm trying to convert a old application made with Delphi 5 to Delphi XE 5 The probleme i have right now is about String[80] and the Read / Write procedure i have a type like that Type TEnrMess = record Mess : String[80]; MessSuiv : Word; Hint : Word; end; And i read/write this type to a File of TEnrMess My probleme is that the string have changed from Delphi 5 to Delphi XE i join the link of a simple of the probleme that can be compiled on delphi 5 and any Delphi XE https://mega.co.nz/#!wV1VyZzY!1ha5oOxTg7L1WJAOXutUygkj...

Any difference between Delphi Prism 2011 and Delphi Prism XE?
Looking at the features in Delphi Prism XE, they look the same as the new items in the 2011 release back in may. I there anything new in the XE release? or did they simply change the product branding? Just wondering if I need to update it or now when i download the rest. Thanks, Hi Dan, > Looking at the features in Delphi Prism XE, they look the same as the new items in the 2011 release back in may. I there anything new in the XE release? or did they simply change the product branding? Just wondering if I need to update it or now when i download the rest. See http://w...

Delphi 7 to Delphi XE: TBlobField to XML [Edit]
Hi, I'm migrating a Delphi7 application to Delphi XE. I'm using a TClientDataSet to communicate, by using a XML frame, with my server. In this TClientDataSet I'm using a TBlobField which is an array of 384 byte. The blobField is allocate by a code like this : {code} myStream : TStream; myStream := aClientDataSet.CreateBlobStream(myBlobField, bmwrite); vResult := myStream.Write(ArrayOf384Byte[0], length(ArrayOf384Byte)); //vResult = 384 => GooD ! (...) {code} For communicate with the server, we have to decode the Blobfield in XML before to sending it. We have...

ShowMessage/MessagDlg wordwrap Delphi 2006
Hi, I have used Delphi 2006 up to now. ShowMessage allowed a long text without a word wrapping. Now with Delphi XE I notice that a migrated program shows smaller message window sizes and a previously carefully aligned message now appears wrapped and misaligned. How to get back to the previous behaviour? I'm not experienced to create my custom form, so a code snippet may help. Thanks, Uli Edited by: Ulrich Brueggemann on Sep 18, 2010 8:46 AM > I have used Delphi 2006 up to now. > ShowMessage allowed a long text without a word wrapping. > > Now with Delphi ...

Web resources about - SOAP on Delphi XE - embarcadero.delphi.webservices

Delphi - Wikipedia, the free encyclopedia
... an archaeological site and a modern town in Greece on the south-western spur of Mount Parnassus in the valley of Phocis . The site of Delphi ...

Delphi Automotive (@DelphiAuto) on Twitter
Log in Sign up You are on Twitter Mobile because you are using an old version of Internet Explorer. Learn more here Delphi Automotive @ DelphiAuto ...

Delphi Connect for Verizon on the App Store on iTunes
Get Delphi Connect for Verizon on the App Store. See screenshots and ratings, and read customer reviews.


Audi working with Delphi to develop autonomous car tech
Audi is developing an iPad-sized device that will pack all the necessary computing power for a self-driving car

Domestic firms eye Delphi
BizChina offers latest business and market information of China, online updates of 17 industries, investment guides, business events and industry ...

Verizon And Delphi Officially Launch Vehicle Diagnostics Service - $250 For The Module, $5 A Month On ...
If you're a car nut, a paranoid parent, or a small business owner looking to do a little, uh, company vehicle economy analysis, Verizon's teamed ...

Watch out Google: Delphi gives Ars a ride in its self-driving car
The automotive components maker gave Ars a preview ride around the neighborhood. MOUNTAIN VIEW, CA—On Thursday morning I met with Delphi at its ...

Official: Verizon's Vehicle Diagnostics by Delphi now on sale for $250
Filed under: Technology Partnering with Verizon Wireless, Delphi Automotive has released its Vehicle Diagnostics by Delphi product that allows ...

Delphi partners with WiTricity on automated wireless charging system
One could easily argue that parking between the white lines at any local hangout presents a challenge for some inexperienced drivers. So, why ...

Resources last updated: 2/8/2016 9:01:17 AM