Forumda aramalar yaptım ama SOAP ile ilgili Array Sınıf adı işleminin kullanımı hakkında bilgi bulamadım.
Bu konu ile ilgisi olan arkadaşlardan bana fikir olarak yardımcı olmalarını rica ediyorum.
Çalıştığım Web Servis C# ile yazılmış ve bir çok Modul olarak ayrı ayrı kullanılıyor.
Servisi kullanmak için ilk olarak Login olup Session almak lazım. Login olma ve bilgi okuma kısımlarını hall etdim.
İşlemler Get ve POST olarak ayrılmakta. Getle olan tüm işlemleri yapıyorum ancak POST işlemini anlamını kavrayamadığım için malesef ilerleyemiyorum. Söz konusu aşağda İnport edilmiş GLModuleService.Pas dosyamda sözü geçen Class türünde bir Array oluşturulmuş.
Array bir property olarakta atanmış (property PostData: ArrayOfErp_GLAccount), değerlerini array şeklinde almakta. Bir diğeri Erp_GLAccount olan bir class ise, içindeki parametre ve propertiler bulunmakta.Erp_GLAccount tablo adı şeklinde, içindeki property-ler sutun bilgilerini almakta.
Kod: Tümünü seç
unit GLModuleService;
interface
uses Soap.InvokeRegistry, Soap.SOAPHTTPClient, System.Types, Soap.XSBuiltIns;
const
IS_OPTN = $0001;
IS_UNBD = $0002;
IS_NLBL = $0004;
IS_REF = $0080;
type
BaseClass2 = class;
BaseClass = class;
Erp_GLAccount2 = class;
Erp_GLAccount = class;
ReturnGLAccountBO2 = class;
ReturnGLAccountBO = class;
PostGLAccountBO2 = class;
PostGLAccountBO = class;
BaseClass2 = class(TRemotable)
private
FSetDelete: Boolean;
FSetDelete_Specified: boolean;
procedure SetSetDelete(Index: Integer; const ABoolean: Boolean);
function SetDelete_Specified(Index: Integer): boolean;
published
property SetDelete: Boolean Index (IS_OPTN or IS_NLBL) read FSetDelete write SetSetDelete stored SetDelete_Specified;
end;
BaseClass = class(BaseClass2)
private
published
end;
guid = type string; { "http://schemas.microsoft.com/2003/10/Serialization/"[GblSmpl] }
ArrayOfanyType = array of Variant; { "http://schemas.microsoft.com/2003/10/Serialization/Arrays"[GblCplx] }
Erp_GLAccount2 = class(BaseClass2)
private
FAccessCode: string;
FAccessCode_Specified: boolean;
FAccountCode: string;
FAccountCode_Specified: boolean;
FAccountName: string;
FAccountName_Specified: boolean;
FAccountType: SmallInt;
FAccountType_Specified: boolean;
FCDType: SmallInt;
FCDType_Specified: boolean;
FCompanyId: Integer;
FCompanyId_Specified: boolean;
FExplanation: string;
FExplanation_Specified: boolean;
FForexCode: string;
FForexCode_Specified: boolean;
FForexId: Integer;
FForexId_Specified: boolean;
FForexName: string;
FForexName_Specified: boolean;
FInUse: Boolean;
FInUse_Specified: boolean;
FIsDeleted: Boolean;
FIsDeleted_Specified: boolean;
FRecId: Integer;
FRecId_Specified: boolean;
FSpecialCode: string;
FSpecialCode_Specified: boolean;
procedure SetAccessCode(Index: Integer; const Astring: string);
function AccessCode_Specified(Index: Integer): boolean;
procedure SetAccountCode(Index: Integer; const Astring: string);
function AccountCode_Specified(Index: Integer): boolean;
procedure SetAccountName(Index: Integer; const Astring: string);
function AccountName_Specified(Index: Integer): boolean;
procedure SetAccountType(Index: Integer; const ASmallInt: SmallInt);
function AccountType_Specified(Index: Integer): boolean;
procedure SetCDType(Index: Integer; const ASmallInt: SmallInt);
function CDType_Specified(Index: Integer): boolean;
procedure SetCompanyId(Index: Integer; const AInteger: Integer);
function CompanyId_Specified(Index: Integer): boolean;
procedure SetExplanation(Index: Integer; const Astring: string);
function Explanation_Specified(Index: Integer): boolean;
procedure SetForexCode(Index: Integer; const Astring: string);
function ForexCode_Specified(Index: Integer): boolean;
procedure SetForexId(Index: Integer; const AInteger: Integer);
function ForexId_Specified(Index: Integer): boolean;
procedure SetForexName(Index: Integer; const Astring: string);
function ForexName_Specified(Index: Integer): boolean;
procedure SetInUse(Index: Integer; const ABoolean: Boolean);
function InUse_Specified(Index: Integer): boolean;
procedure SetIsDeleted(Index: Integer; const ABoolean: Boolean);
function IsDeleted_Specified(Index: Integer): boolean;
procedure SetRecId(Index: Integer; const AInteger: Integer);
function RecId_Specified(Index: Integer): boolean;
procedure SetSpecialCode(Index: Integer; const Astring: string);
function SpecialCode_Specified(Index: Integer): boolean;
published
property AccessCode: string Index (IS_OPTN or IS_NLBL) read FAccessCode write SetAccessCode stored AccessCode_Specified;
property AccountCode: string Index (IS_OPTN or IS_NLBL) read FAccountCode write SetAccountCode stored AccountCode_Specified;
property AccountName: string Index (IS_OPTN or IS_NLBL) read FAccountName write SetAccountName stored AccountName_Specified;
property AccountType: SmallInt Index (IS_OPTN or IS_NLBL) read FAccountType write SetAccountType stored AccountType_Specified;
property CDType: SmallInt Index (IS_OPTN or IS_NLBL) read FCDType write SetCDType stored CDType_Specified;
property CompanyId: Integer Index (IS_OPTN or IS_NLBL) read FCompanyId write SetCompanyId stored CompanyId_Specified;
property Explanation: string Index (IS_OPTN or IS_NLBL) read FExplanation write SetExplanation stored Explanation_Specified;
property ForexCode: string Index (IS_OPTN or IS_NLBL) read FForexCode write SetForexCode stored ForexCode_Specified;
property ForexId: Integer Index (IS_OPTN or IS_NLBL) read FForexId write SetForexId stored ForexId_Specified;
property ForexName: string Index (IS_OPTN or IS_NLBL) read FForexName write SetForexName stored ForexName_Specified;
property InUse: Boolean Index (IS_OPTN or IS_NLBL) read FInUse write SetInUse stored InUse_Specified;
property IsDeleted: Boolean Index (IS_OPTN or IS_NLBL) read FIsDeleted write SetIsDeleted stored IsDeleted_Specified;
property RecId: Integer Index (IS_OPTN) read FRecId write SetRecId stored RecId_Specified;
property SpecialCode: string Index (IS_OPTN or IS_NLBL) read FSpecialCode write SetSpecialCode stored SpecialCode_Specified;
end;
// ************************************************************************ //
// XML : Erp_GLAccount, global, <element>
// Namespace : http://schemas.datacontract.org/2004/07/SentezServisCore.Models
// ************************************************************************ //
Erp_GLAccount = class(Erp_GLAccount2)
private
published
end;
ArrayOfstring = array of string;
ArrayOfErp_GLAccount = array of Erp_GLAccount2;
// ************************************************************************ //
// XML : ReturnGLAccountBO, global, <complexType>
// Namespace : http://schemas.datacontract.org/2004/07/SentezWDSLWcfService.GLModule
// ************************************************************************ //
ReturnGLAccountBO2 = class(TRemotable)
private
FErrorMessages: ArrayOfstring;
FErrorMessages_Specified: boolean;
FReturn: ArrayOfErp_GLAccount;
FReturn_Specified: boolean;
FReturnCode: Integer;
FReturnCode_Specified: boolean;
FReturnDate: TXSDateTime;
FReturnDate_Specified: boolean;
FReturnMessage: string;
FReturnMessage_Specified: boolean;
FSession: guid;
FSession_Specified: boolean;
FSucceedMessages: ArrayOfstring;
FSucceedMessages_Specified: boolean;
procedure SetErrorMessages(Index: Integer; const AArrayOfstring: ArrayOfstring);
function ErrorMessages_Specified(Index: Integer): boolean;
procedure SetReturn(Index: Integer; const AArrayOfErp_GLAccount: ArrayOfErp_GLAccount);
function Return_Specified(Index: Integer): boolean;
procedure SetReturnCode(Index: Integer; const AInteger: Integer);
function ReturnCode_Specified(Index: Integer): boolean;
procedure SetReturnDate(Index: Integer; const ATXSDateTime: TXSDateTime);
function ReturnDate_Specified(Index: Integer): boolean;
procedure SetReturnMessage(Index: Integer; const Astring: string);
function ReturnMessage_Specified(Index: Integer): boolean;
procedure SetSession(Index: Integer; const Aguid: guid);
function Session_Specified(Index: Integer): boolean;
procedure SetSucceedMessages(Index: Integer; const AArrayOfstring: ArrayOfstring);
function SucceedMessages_Specified(Index: Integer): boolean;
public
destructor Destroy; override;
published
property ErrorMessages: ArrayOfstring Index (IS_OPTN or IS_NLBL) read FErrorMessages write SetErrorMessages stored ErrorMessages_Specified;
property Return: ArrayOfErp_GLAccount Index (IS_OPTN or IS_NLBL) read FReturn write SetReturn stored Return_Specified;
property ReturnCode: Integer Index (IS_OPTN) read FReturnCode write SetReturnCode stored ReturnCode_Specified;
property ReturnDate: TXSDateTime Index (IS_OPTN) read FReturnDate write SetReturnDate stored ReturnDate_Specified;
property ReturnMessage: string Index (IS_OPTN or IS_NLBL) read FReturnMessage write SetReturnMessage stored ReturnMessage_Specified;
property Session: guid Index (IS_OPTN) read FSession write SetSession stored Session_Specified;
property SucceedMessages: ArrayOfstring Index (IS_OPTN or IS_NLBL) read FSucceedMessages write SetSucceedMessages stored SucceedMessages_Specified;
end;
// ************************************************************************ //
// XML : ReturnGLAccountBO, global, <element>
// Namespace : http://schemas.datacontract.org/2004/07/SentezWDSLWcfService.GLModule
// ************************************************************************ //
ReturnGLAccountBO = class(ReturnGLAccountBO2)
private
published
end;
// ************************************************************************ //
// XML : PostGLAccountBO, global, <complexType>
// Namespace : http://schemas.datacontract.org/2004/07/SentezWDSLWcfService.GLModule
// ************************************************************************ //
PostGLAccountBO2 = class(TRemotable)
private
FPostData: ArrayOfErp_GLAccount;
FPostData_Specified: boolean;
FReplaceAll: Boolean;
FReplaceAll_Specified: boolean;
FSession: guid;
FSession_Specified: boolean;
procedure SetPostData(Index: Integer; const AArrayOfErp_GLAccount: ArrayOfErp_GLAccount);
function PostData_Specified(Index: Integer): boolean;
procedure SetReplaceAll(Index: Integer; const ABoolean: Boolean);
function ReplaceAll_Specified(Index: Integer): boolean;
procedure SetSession(Index: Integer; const Aguid: guid);
function Session_Specified(Index: Integer): boolean;
public
destructor Destroy; override;
published
property PostData: ArrayOfErp_GLAccount Index (IS_OPTN or IS_NLBL) read FPostData write SetPostData stored PostData_Specified;
property ReplaceAll: Boolean Index (IS_OPTN) read FReplaceAll write SetReplaceAll stored ReplaceAll_Specified;
property Session: guid Index (IS_OPTN) read FSession write SetSession stored Session_Specified;
end;
// ************************************************************************ //
// XML : PostGLAccountBO, global, <element>
// Namespace : http://schemas.datacontract.org/2004/07/SentezWDSLWcfService.GLModule
// ************************************************************************ //
PostGLAccountBO = class(PostGLAccountBO2)
private
published
end;
IGLModuleService = interface(IInvokable)
['{2498D499-3448-FA9F-9016-9C0070FFAA53}']
procedure DoWork; stdcall;
function GetAllGLAccountBO(const Session: guid): ReturnGLAccountBO2; stdcall;
function PostAllGLAccountBO(const postObject: PostGLAccountBO2): ReturnGLAccountBO2; stdcall;
end;
function GetIGLModuleService(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): IGLModuleService;
implementation
uses System.SysUtils;
function GetIGLModuleService(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): IGLModuleService;
const
defWSDL = 'http://192.168.1.7/GLModule/GLModuleService.svc?singleWsdl';
defURL = 'http://192.168.1.7/GLModule/GLModuleService.svc';
defSvc = 'GLModuleService';
defPrt = 'BasicHttpBinding_IGLModuleService';
var
RIO: THTTPRIO;
begin
Result := nil;
if (Addr = '') then
begin
if UseWSDL then
Addr := defWSDL
else
Addr := defURL;
end;
if HTTPRIO = nil then
RIO := THTTPRIO.Create(nil)
else
RIO := HTTPRIO;
try
Result := (RIO as IGLModuleService);
if UseWSDL then
begin
RIO.WSDLLocation := Addr;
RIO.Service := defSvc;
RIO.Port := defPrt;
end else
RIO.URL := Addr;
finally
if (Result = nil) and (HTTPRIO = nil) then
RIO.Free;
end;
end;
procedure BaseClass2.SetSetDelete(Index: Integer; const ABoolean: Boolean);
begin
FSetDelete := ABoolean;
FSetDelete_Specified := True;
end;
function BaseClass2.SetDelete_Specified(Index: Integer): boolean;
begin
Result := FSetDelete_Specified;
end;
destructor ReturnGLAccountBO2.Destroy;
var
I: Integer;
begin
for I := 0 to System.Length(FReturn)-1 do
System.SysUtils.FreeAndNil(FReturn[I]);
System.SetLength(FReturn, 0);
System.SysUtils.FreeAndNil(FReturnDate);
inherited Destroy;
end;
procedure ReturnGLAccountBO2.SetErrorMessages(Index: Integer; const AArrayOfstring: ArrayOfstring);
begin
FErrorMessages := AArrayOfstring;
FErrorMessages_Specified := True;
end;
function ReturnGLAccountBO2.ErrorMessages_Specified(Index: Integer): boolean;
begin
Result := FErrorMessages_Specified;
end;
procedure ReturnGLAccountBO2.SetReturn(Index: Integer; const AArrayOfErp_GLAccount: ArrayOfErp_GLAccount);
begin
FReturn := AArrayOfErp_GLAccount;
FReturn_Specified := True;
end;
function ReturnGLAccountBO2.Return_Specified(Index: Integer): boolean;
begin
Result := FReturn_Specified;
end;
procedure ReturnGLAccountBO2.SetReturnCode(Index: Integer; const AInteger: Integer);
begin
FReturnCode := AInteger;
FReturnCode_Specified := True;
end;
function ReturnGLAccountBO2.ReturnCode_Specified(Index: Integer): boolean;
begin
Result := FReturnCode_Specified;
end;
procedure ReturnGLAccountBO2.SetReturnDate(Index: Integer; const ATXSDateTime: TXSDateTime);
begin
FReturnDate := ATXSDateTime;
FReturnDate_Specified := True;
end;
function ReturnGLAccountBO2.ReturnDate_Specified(Index: Integer): boolean;
begin
Result := FReturnDate_Specified;
end;
procedure ReturnGLAccountBO2.SetReturnMessage(Index: Integer; const Astring: string);
begin
FReturnMessage := Astring;
FReturnMessage_Specified := True;
end;
function ReturnGLAccountBO2.ReturnMessage_Specified(Index: Integer): boolean;
begin
Result := FReturnMessage_Specified;
end;
procedure ReturnGLAccountBO2.SetSession(Index: Integer; const Aguid: guid);
begin
FSession := Aguid;
FSession_Specified := True;
end;
function ReturnGLAccountBO2.Session_Specified(Index: Integer): boolean;
begin
Result := FSession_Specified;
end;
procedure ReturnGLAccountBO2.SetSucceedMessages(Index: Integer; const AArrayOfstring: ArrayOfstring);
begin
FSucceedMessages := AArrayOfstring;
FSucceedMessages_Specified := True;
end;
function ReturnGLAccountBO2.SucceedMessages_Specified(Index: Integer): boolean;
begin
Result := FSucceedMessages_Specified;
end;
destructor PostGLAccountBO2.Destroy;
var
I: Integer;
begin
for I := 0 to System.Length(FPostData)-1 do
System.SysUtils.FreeAndNil(FPostData[I]);
System.SetLength(FPostData, 0);
inherited Destroy;
end;
procedure PostGLAccountBO2.SetPostData(Index: Integer; const AArrayOfErp_GLAccount: ArrayOfErp_GLAccount);
begin
FPostData := AArrayOfErp_GLAccount;
FPostData_Specified := True;
end;
function PostGLAccountBO2.PostData_Specified(Index: Integer): boolean;
begin
Result := FPostData_Specified;
end;
procedure PostGLAccountBO2.SetReplaceAll(Index: Integer; const ABoolean: Boolean);
begin
FReplaceAll := ABoolean;
FReplaceAll_Specified := True;
end;
function PostGLAccountBO2.ReplaceAll_Specified(Index: Integer): boolean;
begin
Result := FReplaceAll_Specified;
end;
procedure PostGLAccountBO2.SetSession(Index: Integer; const Aguid: guid);
begin
FSession := Aguid;
FSession_Specified := True;
end;
function PostGLAccountBO2.Session_Specified(Index: Integer): boolean;
begin
Result := FSession_Specified;
end;
procedure Erp_GLAccount2.SetAccessCode(Index: Integer; const Astring: string);
begin
FAccessCode := Astring;
FAccessCode_Specified := True;
end;
function Erp_GLAccount2.AccessCode_Specified(Index: Integer): boolean;
begin
Result := FAccessCode_Specified;
end;
procedure Erp_GLAccount2.SetAccountCode(Index: Integer; const Astring: string);
begin
FAccountCode := Astring;
FAccountCode_Specified := True;
end;
function Erp_GLAccount2.AccountCode_Specified(Index: Integer): boolean;
begin
Result := FAccountCode_Specified;
end;
procedure Erp_GLAccount2.SetAccountName(Index: Integer; const Astring: string);
begin
FAccountName := Astring;
FAccountName_Specified := True;
end;
function Erp_GLAccount2.AccountName_Specified(Index: Integer): boolean;
begin
Result := FAccountName_Specified;
end;
procedure Erp_GLAccount2.SetAccountType(Index: Integer; const ASmallInt: SmallInt);
begin
FAccountType := ASmallInt;
FAccountType_Specified := True;
end;
function Erp_GLAccount2.AccountType_Specified(Index: Integer): boolean;
begin
Result := FAccountType_Specified;
end;
procedure Erp_GLAccount2.SetCDType(Index: Integer; const ASmallInt: SmallInt);
begin
FCDType := ASmallInt;
FCDType_Specified := True;
end;
function Erp_GLAccount2.CDType_Specified(Index: Integer): boolean;
begin
Result := FCDType_Specified;
end;
procedure Erp_GLAccount2.SetCompanyId(Index: Integer; const AInteger: Integer);
begin
FCompanyId := AInteger;
FCompanyId_Specified := True;
end;
function Erp_GLAccount2.CompanyId_Specified(Index: Integer): boolean;
begin
Result := FCompanyId_Specified;
end;
procedure Erp_GLAccount2.SetExplanation(Index: Integer; const Astring: string);
begin
FExplanation := Astring;
FExplanation_Specified := True;
end;
function Erp_GLAccount2.Explanation_Specified(Index: Integer): boolean;
begin
Result := FExplanation_Specified;
end;
procedure Erp_GLAccount2.SetForexCode(Index: Integer; const Astring: string);
begin
FForexCode := Astring;
FForexCode_Specified := True;
end;
function Erp_GLAccount2.ForexCode_Specified(Index: Integer): boolean;
begin
Result := FForexCode_Specified;
end;
procedure Erp_GLAccount2.SetForexId(Index: Integer; const AInteger: Integer);
begin
FForexId := AInteger;
FForexId_Specified := True;
end;
function Erp_GLAccount2.ForexId_Specified(Index: Integer): boolean;
begin
Result := FForexId_Specified;
end;
procedure Erp_GLAccount2.SetForexName(Index: Integer; const Astring: string);
begin
FForexName := Astring;
FForexName_Specified := True;
end;
function Erp_GLAccount2.ForexName_Specified(Index: Integer): boolean;
begin
Result := FForexName_Specified;
end;
procedure Erp_GLAccount2.SetInUse(Index: Integer; const ABoolean: Boolean);
begin
FInUse := ABoolean;
FInUse_Specified := True;
end;
function Erp_GLAccount2.InUse_Specified(Index: Integer): boolean;
begin
Result := FInUse_Specified;
end;
procedure Erp_GLAccount2.SetIsDeleted(Index: Integer; const ABoolean: Boolean);
begin
FIsDeleted := ABoolean;
FIsDeleted_Specified := True;
end;
function Erp_GLAccount2.IsDeleted_Specified(Index: Integer): boolean;
begin
Result := FIsDeleted_Specified;
end;
procedure Erp_GLAccount2.SetRecId(Index: Integer; const AInteger: Integer);
begin
FRecId := AInteger;
FRecId_Specified := True;
end;
function Erp_GLAccount2.RecId_Specified(Index: Integer): boolean;
begin
Result := FRecId_Specified;
end;
procedure Erp_GLAccount2.SetSpecialCode(Index: Integer; const Astring: string);
begin
FSpecialCode := Astring;
FSpecialCode_Specified := True;
end;
function Erp_GLAccount2.SpecialCode_Specified(Index: Integer): boolean;
begin
Result := FSpecialCode_Specified;
end;
end.
Mevzu biraz karmaşık, bir kaç gündür bununla uğraşıyorum hala çözemedim

Konu ile alakalı Bilgisi olan arkadaşlardan fikirlerini ve yardımlarını rica ediyorum.
Benim bu işleme kayıt yazmağa çalıştığım ve başarısız olduğum kodlarım şunlardır:
Kod: Tümünü seç
procedure TForm1.Button2Click(Sender: TObject);
var
GLM_S : IGLModuleService;
tmpGLAccount : Erp_GLAccount2;
postObject : PostGLAccountBO;
ret : ReturnGLAccountBO2;
begin
GLM_S := GetIGLModuleService(True,'', nil);
tmpGLAccount := Erp_GLAccount.Create;
postObject := PostGLAccountBO.Create;
ret := ReturnGLAccountBO2.Create;
tmpGLAccount.AccountCode := '00.01';
tmpGLAccount.AccountName := 'Örnek';
tmpGLAccount.AccountType := 1;
tmpGLAccount.CDType := 3;
tmpGLAccount.InUse := True;
tmpGLAccount.SpecialCode := 'Nahit';
try
postObject.Session := MySession;
postObject.PostData[0] := tmpGLAccount;
ret := GLM_S.PostAllGLAccountBO(postObject);
except on E : Exception do begin
ShowMessage(E.Message);
end;
end;
end;