unit WSSettingIntf;
interface
uses Soap.InvokeRegistry, System.Types, Soap.XSBuiltIns;
type
TAuthHeader = class(TSOAPHeader)
private
FUsername: String;
FPassword: String;
published
property Username: String read FUserName write FUsername;
property Password: String read FPassword write FPassword;
end;
UserService = interface(IInvokable)
['{DB8988C0-FCE8-43AA-9267-403E02C94464}']
function topla(a,b:Double):Double; stdcall;
end;
implementation
initialization
InvRegistry.RegisterInterface(TypeInfo(UserService));
InvRegistry.RegisterHeaderClass(TypeInfo(UserService), TAuthHeader);
RemClassRegistry.RegisterXSClass(TAuthHeader);
end.
Arkadaşlar yukardaki gibi Header imı oluşturuyorum ancak heder bilgilerini alamıyorum yardımlarnızı bekliyorum .
aşağıdaki kodta interface not supported hatası alıyorum.Girilen Heder bilgilerini almak için nasıl bir yol izlemeli
unit WSSettingImpl;
interface
uses Soap.InvokeRegistry, System.Types, Soap.XSBuiltIns, WSSettingIntf;
type
{ TWSSetting }
TWSSetting = class(TInvokableClass, UserService)
public
function topla(a,b:Double):Double; stdcall;
end;
implementation
{ TWSSetting }
function TWSSetting.topla(a, b: Double): Double;
var
Headers: ISOAPHeaders;
H: TAuthHeader;
begin
//H := tauthHeader.Create;
Headers := Self as ISOAPHeaders; //burda interface not supported hatası alıyorum
Headers.Get(TAuthHeader, TSoapHeader(H));
if (H.Username='erhan') and (H.Password='1') then
begin
Result:=1;
end
else
Result:=0;
end;
initialization
{ Invokable classes must be registered }
InvRegistry.RegisterInvokableClass(TWSSetting);
InvRegistry.RegisterHeaderClass(TypeInfo(UserService), TAuthHeader);
end.
Web service soapheader "interface not supported hatası"
Forum kuralları
Forum kurallarını okuyup, uyunuz!
Forum kurallarını okuyup, uyunuz!