webmasterplc
25-06-2013, 00:53:36
buenas estoy tratando de crear un Webservice en delphi 7 en la cual tengo una funcion pero me da este error:
[Error] wsKSMSImpl.pas(15): Unsatisfied forward or external declaration: 'TwsKSMS.enviarSMS'
mi codigo es este.
{ Invokable implementation File for TwsKSMS which implements IwsKSMS }
unit wsKSMSImpl;
interface
uses SysUtils, Classes, IdHTTP,InvokeRegistry, Types, XSBuiltIns, wsKSMSIntf;
type
{ TwsKSMS }
TwsKSMS = class(TInvokableClass, IwsKSMS)
public
function enviarSMS (url,usuario,clave,phone,mensaje : string) :string;stdcall;
end;
implementation
function enviarSMS (url,usuario,clave,phone,mensaje : string) :string;stdcall;
var
http: TIdHttp;
params: TStrings;
respuesta: string;
begin
http := TIdHTTP.Create(nil);
params := TStringList.Create;
begin
params.Add('usuario='+usuario);
params.Add('clave='+clave);
params.Add('telefonos='+phone);
params.Add('texto='+mensaje);
respuesta := http.Post(url, params);
end;
params.Free;
http.Free;
end;
exports
enviarSMS;
initialization
{ Invokable classes must be registered }
InvRegistry.RegisterInvokableClass(TwsKSMS);
end.
[Error] wsKSMSImpl.pas(15): Unsatisfied forward or external declaration: 'TwsKSMS.enviarSMS'
mi codigo es este.
{ Invokable implementation File for TwsKSMS which implements IwsKSMS }
unit wsKSMSImpl;
interface
uses SysUtils, Classes, IdHTTP,InvokeRegistry, Types, XSBuiltIns, wsKSMSIntf;
type
{ TwsKSMS }
TwsKSMS = class(TInvokableClass, IwsKSMS)
public
function enviarSMS (url,usuario,clave,phone,mensaje : string) :string;stdcall;
end;
implementation
function enviarSMS (url,usuario,clave,phone,mensaje : string) :string;stdcall;
var
http: TIdHttp;
params: TStrings;
respuesta: string;
begin
http := TIdHTTP.Create(nil);
params := TStringList.Create;
begin
params.Add('usuario='+usuario);
params.Add('clave='+clave);
params.Add('telefonos='+phone);
params.Add('texto='+mensaje);
respuesta := http.Post(url, params);
end;
params.Free;
http.Free;
end;
exports
enviarSMS;
initialization
{ Invokable classes must be registered }
InvRegistry.RegisterInvokableClass(TwsKSMS);
end.