I've got a problem with exposing a DTO class through SOAP WebService.
My class looks like
TKontrahent = class
public
Imie : string;
Nazwisko : string;
Id : integer;
end;
Here's the Service's code:
TKontrahentService = class(TInvokableClass, 开发者_运维技巧IKontrahentService)
public
function Dodaj( kontrahnet : TKontrahent) : integer; stdcall;
function Aktualizuj ( kontrahent : TKontrahent) : integer; stdcall;
function Usun ( kontrahent : TKontrahent) : integer; stdcall;
function Nowy : TKontrahent; stdcall;
end;
And how the type is published in WSDL:
<types>
<xs:schema targetNamespace="urn:Kontrahent" xmlns="urn:Kontrahent">
<xs:complexType name="TKontrahent">
<xs:sequence/>
</xs:complexType>
</xs:schema>
</types>
I'd be thankful for any advices. I cannot find any sample with more complex types. Best regards, krlm
To expose and consume the class TKontrahent in a standard Delphi SOAP service, it must be a subclass of TRemotable and its properties must be published.
As a starting point (for example after the migration from Delphi 7 to 2009) I usually import an existing WSDL to create a SOAP client and study the generated source code for classes and properties.
精彩评论