Delphi 2005 and WSDL

Hi there,
I am looking for a sample code in Delphi 2005 which will use the following wsdl
http://gw1.aql.com/soap/sendservice.php?WSDL 

thanks
Bill
bilgehanyildirimAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

JaccoCommented:
Hi there,

I created a WinForms .NET application. On the form I added a button and two TextBox components.

The following code calls the webservice:

procedure TWinForm.Button1_Click(sender: System.Object; e: System.EventArgs);
var
  Sms: com.aql.gw1.sendservice.SendSmsService;
  dest: array of string;
  cb: callbackelement;
  credit, desc: string;
begin
  Sms := com.aql.gw1.sendservice.SendSmsService.Create;
  Sms.authValue := auth.Create;
  Sms.authValue.username := 'Jacco';
  Sms.authValue.password := 'test';
  SetLength(dest, 1);
  dest[0] := '+yourphone';
  cb := callbackelement.Create;
  cb.callbackurl := 'www.google.nl';
  cb.callbacktype := com.aql.gw1.sendservice.callbacktypeoptions.NONE;
  Sms.SoapSendSms(dest, '+yourotherphone', 'Message from Delphi 2005!', com.aql.gw1.sendservice.text, '', System.DateTime.Now, True, cb, credit, desc);
  TextBox1.Text := desc;
  TextBox2.Text := credit;
  Sms.Free;
end;

Replace +yourphone and +yourotherphone by valid phonenumbers
Replace the username and password with the ones you received aql.com

And it should work.

I got an error saying that my username and password were wrong.

Regards Jacco
0
JaccoCommented:
Oh yeah, after creating the .NET WinForms application I right clicked the project, did add web reference, save the project an entered the WDSL address so the correct web service files are created.

Regards Jacco
0
bilgehanyildirimAuthor Commented:
I tried that but whenever I tried to run it opened the
C:\Documents and Settings\Bill\My Documents\Borland Studio Projects\SMS\Web References\com.aql.gw1\com.aql.gw1.sendservice.pas
and went to line 40
[System.Xml.Serialization.XmlEnumAttribute('7')]
and said
"E2029 Identifier Expected  but '[' found"

Did it give the same error on your project?
0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

bilgehanyildirimAuthor Commented:
and did you put
uses com.aql.gw1.sendservice;
after
implementation taq

?
0
JaccoCommented:
I commented them out. Probabbly not a good idea. Sorry, I forgot to mention that. It might not work then. Let me know because I think I know a way around that. Delphi doesn't seem to know about these attributes.

Regards Jacco
0
bilgehanyildirimAuthor Commented:
which part did you comment out?
0
JaccoCommented:
All the lines with attribute definitions like this one:

//    [System.Xml.Serialization.XmlEnumAttribute('7')]

in com.aql.gw1.sendservice.pas

There were about six of them.

Regards Jacco

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
bilgehanyildirimAuthor Commented:
I changed the code a litte bit
procedure TWinForm.Button1_Click(sender: System.Object; e: System.EventArgs);
var
  Sms: gw11.sendservice.SendSmsService;
  dest: array of string;
  cb: callbackelement;
  credit, desc: string;
begin
  Sms := gw11.sendservice.SendSmsService.Create;
  Sms.authValue := auth.Create;
  Sms.authValue.username := 'xxx';
  Sms.authValue.password := 'xxx';
  SetLength(dest, 1);
  dest[0] := '+xxxxx;
  cb := callbackelement.Create;
  cb.callbackurl := 'www.google.nl';
  cb.callbacktype := callbacktypeoptions(none);
  Sms.SoapSendSms(dest, '+xxxxx, 'Message from Delphi 2005!', gw11.sendservice.text, '1', System.DateTime.Now, True, cb, credit, desc);
  TextBox1.Text := desc;
  TextBox2.Text := credit;
  Sms.Free;
end;

and it worked perfect!!!!

All points are yours.
thanks a lot!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.