Problème avec le WSDL généré par le serveur SOAP Delphi avec des balises XML en ARRAY OF
Bonjour
J'ai créé un serveur SOAP avec Delphi (10.3)
Mais quand je récupère avec SoapUI le WDSL généré par le serveur, j'ai un souci avec le tableau "Tableau_Coordonnee", qui contient des structures de type "Coordonnee"
le XML généré par Delphi est le suivant ;
Code:
1 2 3 4 5 6 7 8 9
| <Tableau_Coordonnee xsi:type="urn:TTableau_Coordonnee" soapenc:arrayType="urn:TCoordonnee[]"/>
<Coordonnee xsi:type="urn:TCoordonnee">
<type_coordonnee xsi:type="xsd:string">?</type_coordonnee>
<email xsi:type="xsd:string">?</email>
<tel_fixe xsi:type="xsd:string">?</tel_fixe>
<tel_portable xsi:type="xsd:string">?</tel_portable>
<tel_fax xsi:type="xsd:string">?</tel_fax>
<motif_non_mail xsi:type="xsd:string">?</motif_non_mail>
</Coordonnee> |
Alors qu'il me faudrait :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| <Tableau_Coordonnee>
<Coordonnee xsi:type="urn:TCoordonnee">
<type_coordonnee xsi:type="xsd:string">PRO</type_coordonnee>
<email xsi:type="xsd:string">essai@orange.fr</email>
<tel_fixe xsi:type="xsd:string">0200000000</tel_fixe>
<tel_portable xsi:type="xsd:string">0606060606</tel_portable>
<tel_fax xsi:type="xsd:string"></tel_fax>
<motif_non_mail xsi:type="xsd:string">?</motif_non_mail>
</Coordonnee>
<Coordonnee xsi:type="urn:TCoordonnee">
<type_coordonnee xsi:type="xsd:string">PERSO</type_coordonnee>
<email xsi:type="xsd:string">essai@free.fr</email>
<tel_fixe xsi:type="xsd:string">0200000000</tel_fixe>
<tel_portable xsi:type="xsd:string">0600000000</tel_portable>
<tel_fax xsi:type="xsd:string"></tel_fax>
<motif_non_mail xsi:type="xsd:string">?</motif_non_mail>
</Coordonnee>
</Tableau_Coordonnee> |
Voici le source de l'unité d’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 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138
| { Interface invocable Iinformix }
unit informixIntf;
interface
uses Soap.InvokeRegistry, System.Types, Soap.XSBuiltIns;
type
// description de personne physique
TPersonnePhysique = class(TRemotable)
private
Fid_informix : integer;
Fis_particulier : boolean;
Fnum_insee : UnicodeString;
Fcivilite : integer;
Fnom_naissance : UnicodeString;
Fprenoms : UnicodeString;
Fdate_naissance : TdateTime;
Fsituation_familiale : UnicodeString;
Fnom_marital : UnicodeString;
Flocalite_naiss : UnicodeString;
Fcode_dep_naiss : UnicodeString;
Fcode_pays_naiss : UnicodeString;
Fis_delegue_administrateur : Boolean;
published
property id_informix : integer read Fid_informix write Fid_informix;
property is_particulier : boolean read Fis_particulier write Fis_particulier;
property num_insee : UnicodeString read Fnum_insee write Fnum_insee;
property civilite : integer read Fcivilite write Fcivilite;
property nom_naissance : UnicodeString read Fnom_naissance write Fnom_naissance;
property prenoms : UnicodeString read Fprenoms write Fprenoms;
property date_naissance : TdateTime read Fdate_naissance write Fdate_naissance;
property situation_familiale : UnicodeString read Fsituation_familiale write Fsituation_familiale;
property nom_marital : UnicodeString read Fnom_marital write Fnom_marital;
property localite_naiss : UnicodeString read Flocalite_naiss write Flocalite_naiss;
property code_dep_naiss : UnicodeString read Fcode_dep_naiss write Fcode_dep_naiss;
property code_pays_naiss : UnicodeString read Fcode_pays_naiss write Fcode_pays_naiss;
property is_delegue_administrateur : Boolean read Fis_delegue_administrateur write Fis_delegue_administrateur;
end;
// description de la coordonnée
TCoordonnee = class(TRemotable)
private
Ftype_coordonnee : UnicodeString;
Femail : UnicodeString;
Ftel_fixe : UnicodeString;
Ftel_portable : UnicodeString;
Ftel_fax : UnicodeString;
Fmotif_non_mail : UnicodeString;
published
property type_coordonnee : UnicodeString read Ftype_coordonnee write Ftype_coordonnee;
property email : UnicodeString read Femail write Femail;
property tel_fixe : UnicodeString read Ftel_fixe write Ftel_fixe;
property tel_portable : UnicodeString read Ftel_portable write Ftel_portable;
property tel_fax : UnicodeString read Ftel_fax write Ftel_fax;
property motif_non_mail : UnicodeString read Fmotif_non_mail write Fmotif_non_mail;
end;
TTableau_Coordonnee = Array of TCoordonnee;
// description de l'adresse
TAdresse = class(TRemotable)
private
Ftype_adresse : UnicodeString;
Fnum_voie : UnicodeString;
Fbtq : UnicodeString;
Fnom_voie : UnicodeString;
Fcpl : UnicodeString;
Fcode_postal : UnicodeString;
Flocalite : UnicodeString;
Flocalite_cpl : UnicodeString;
Fcode_commune : UnicodeString;
Fcode_insee_commune : UnicodeString;
Fcode_pays : UnicodeString;
Fnpai : UnicodeString;
published
property type_adresse : UnicodeString read Ftype_adresse write Ftype_adresse;
property num_voie : UnicodeString read Fnum_voie write Fnum_voie;
property btq : UnicodeString read Fbtq write Fbtq;
property nom_voie : UnicodeString read Fnom_voie write Fnom_voie;
property cpl : UnicodeString read Fcpl write Fcpl;
property code_postal : UnicodeString read Fcode_postal write Fcode_postal;
property localite : UnicodeString read Flocalite write Flocalite;
property localite_cpl : UnicodeString read Flocalite_cpl write Flocalite_cpl;
property code_commune : UnicodeString read Fcode_commune write Fcode_commune;
property code_insee_commune : UnicodeString read Fcode_insee_commune write Fcode_insee_commune;
property code_pays : UnicodeString read Fcode_pays write Fcode_pays;
property npai : UnicodeString read Fnpai write Fnpai;
end;
TTableau_Adresse = array of TAdresse;
TAppel_Personne_Physique = class(TRemotable)
private
FT_Personne_Physique : TPersonnePhysique;
FT_Tableau_Coordonnee : TTableau_Coordonnee;
FT_Coordonnee : TCoordonnee;
FT_Tableau_Adresse : TTableau_Adresse;
FT_Adresse : TAdresse;
published
property Personne_Physique : TPersonnePhysique read FT_Personne_Physique write FT_Personne_Physique;
property Tableau_Coordonnee : TTableau_Coordonnee read FT_Tableau_Coordonnee write FT_Tableau_Coordonnee;
property Coordonnee : TCoordonnee read FT_Coordonnee write FT_Coordonnee;
property Tableau_Adresse : TTableau_Adresse read FT_Tableau_Adresse write FT_Tableau_Adresse;
property Adresse : TAdresse read FT_Adresse write FT_Adresse;
end;
// description de la réponse
TReponse = class(TRemotable)
private
FId_reponse: integer;
FCode_erreur: integer;
FLib_erreur: UnicodeString;
FLib_reponse: UnicodeString;
published
property Id_reponse: integer read FId_reponse write FId_reponse;
property Code_erreur: integer read FCode_erreur write FCode_erreur;
property Lib_erreur: UnicodeString read FLib_erreur write FLib_erreur;
property Lib_reponse : UnicodeString read FLib_reponse write FLib_reponse;
end;
{ Les interfaces invocables doivent dériver de IInvokable }
Iinformix = interface(IInvokable)
['{E2D5DB78-1DA1-43E3-A81E-634D06C4A392}']
{ Les méthodes de l'interface invocable ne doivent pas utiliser la valeur par défaut }
{ convention d'appel ; stdcall est recommandé }
function personnePhysique(const personne_physique : TAppel_Personne_Physique) : TReponse ; stdcall;
end;
implementation
initialization
{ Les interfaces invocables doivent être enregistrées }
InvRegistry.RegisterInterface(TypeInfo(Iinformix));
end. |
Je pense que ça doit venir de mon unité interface, mais je ne vois pas comment corriger.
Merci d'avance pour vos idées