Classe non publiée dans un WebService
Bonjour
Je suis en train d'écrire un WebService (côté serveur) .
La compilation est OK mais le WSDL généré ne contient pas une classe (PLAN_ANALYTIQUE) que j'ai pourtant publiée.
Qu'est qui ne va pas ?
Merci d'avance pour vos réponses
l'interface :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| { Interface invocable IGescom }
unit GescomIntf;
interface
uses InvokeRegistry, Types, XSBuiltIns, Gescom, Service_Gescom;
Type
{ Les interfaces invocables doivent dériver de IInvokable }
IGescom = interface(IInvokable)
['{28E05B14-C9A0-4FD6-8E59-4BC0E31D766C}']
Function Rechercher_Plan_Analytique(aCode_Analytique:String):Gescom.PLAN_ANALYTIQUE; stdcall;
{ Les méthodes de l'interface invocable ne doivent pas utiliser la convention }
{ d'appel par défaut ; stdcall est conseillée }
End;
implementation
initialization
{ Les interfaces invocables doivent être recensées }
InvRegistry.RegisterInterface(TypeInfo(IGescom));
end. |
l'implémentation :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
| { Fichier d'implémentation invocable pour TGescom qui implémente IGescom }
unit GescomImpl;
interface
uses InvokeRegistry, Types, XSBuiltIns, GescomIntf, Gescom, Service_Gescom, CER_Fichiers;
type
TGescom = class(TInvokableClass, IGescom)
public
Function Rechercher_Plan_Analytique(aCode_Analytique:String):Gescom.PLAN_ANALYTIQUE; stdcall;
end;
implementation
Function TGescom.Rechercher_Plan_Analytique(aCode_Analytique:String):Gescom.PLAN_ANALYTIQUE; stdcall;
var Mon_Plan_Analytique : PLAN_ANALYTIQUE;
S : string;
begin
Mon_Plan_analytique := PLAN_ANALYTIQUE.Create;
S := 'Code';
Mon_Plan_Analytique.setCode_analytique(s);
Mon_Plan_Analytique.code='+Mon_Plan_Analytique.getCode_analytique);
S := 'Libellé';
Mon_Plan_Analytique.setLibelle(s);
Mon_Plan_Analytique.libelle='+Mon_Plan_Analytique.getLibelle);
S := 'Libellé court';
Mon_Plan_Analytique.setLibelle_Court(s);
Mon_Plan_Analytique.libelle_court='+Mon_Plan_Analytique.getLibelle_court);
result := Mon_Plan_Analytique;
end;
initialization
{ Les classes invocables doivent être recensées }
InvRegistry.RegisterInvokableClass(TGescom);
end. |
gescom.pas :
Citation:
Unit Gescom;
Interface
Uses
SysUtils, InvokeRegistry;
Type
PLAN_ANALYTIQUE = Class;
PLAN_ANALYTIQUE = Class(TRemotable)
Private _code_analytique:String;
Private _libelle:String;
Private _libelle_court:String;
Published Function getCode_analytique():String;
Published Function getLibelle():String;
Published Function getLibelle_court():String;
Published Procedure setCode_analytique(var aCode_analytique:String);
Published Procedure setLibelle(var aLibelle:String);
Published Procedure setLibelle_court(var aLibelle_court:String);
End;
Implementation
Function PLAN_ANALYTIQUE.getCode_analytique():string;
Begin
Result := Self._code_analytique;
End;
Function PLAN_ANALYTIQUE.getLibelle():String;
Begin
Result := Self._libelle;
End;
Function PLAN_ANALYTIQUE.getLibelle_court():String;
Begin
Result := Self._libelle_court;
End;
Procedure PLAN_ANALYTIQUE.setCode_analytique(var aCode_analytique:String);
Begin
Self._code_analytique := aCode_analytique;
End;
Procedure PLAN_ANALYTIQUE.setLibelle(var aLibelle:String);
Begin
Self._libelle := aLibelle;
End;
Procedure PLAN_ANALYTIQUE.setLibelle_court(var aLibelle_court:String);
Begin
Self._libelle_court := aLibelle_court;
End;
End.
service_gescom.pas :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| Unit Service_Gescom;
Interface
Uses
Gescom,
SysUtils;
Type
SERVICE_PLAN_ANALYTIQUE = Interface;
SERVICE_PLAN_ANALYTIQUE = Interface
Function Rechercher_Plan_Analytique(aCode_Analytique:String):Gescom.PLAN_ANALYTIQUE;
Function Creer_Plan_Analytique(var aPlan_Analytique:Gescom.PLAN_ANALYTIQUE):Integer;
Function Modifier_Plan_Analytique(var aPlan_Analytique:Gescom.PLAN_ANALYTIQUE):Integer;
End;
Implementation
End. |