first import

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
inoussa
2006-08-26 00:35:42 +00:00
parent 63891b7276
commit 4381e28da6
104 changed files with 27836 additions and 0 deletions

View File

@ -0,0 +1,9 @@
LazarusResources.Add('EBAY','wst_meta',[
#0#0#0#20'WST_METADATA_0.2.2.0'#0#0#0#4'ebay'#1#0#0#0#24'IeBayAPIInterfaceSer'
+'vice'#2#0#0#0#13'GetCategories'#2#0#0#0#20'GetCategoriesRequest'#0#0#0#25'T'
+'GetCategoriesRequestType'#0#0#0#0#0#0#0#1#0#0#0#21'GetCategoriesResponse'#0
+#0#0#26'TGetCategoriesResponseType'#0#0#0#0#0#0#0#3#0#0#0#18'GetPopularKeywo'
+'rds'#2#0#0#0#25'GetPopularKeywordsRequest'#0#0#0#30'TGetPopularKeywordsRequ'
+'estType'#0#0#0#0#0#0#0#1#0#0#0#26'GetPopularKeywordsResponse'#0#0#0#31'TGet'
+'PopularKeywordsResponseType'#0#0#0#0#0#0#0#3
]);

View File

@ -0,0 +1,562 @@
unit ebay;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, base_service_intf;
const
sAPP_ID = '<your AppId>';
sEBAY_VERSION = '467';
type
TAckCodeType = ( Success, Failure, Warning, PartialFailure, CustomCode );
{ TErrorType = class(TBaseComplexRemotable)
published
property ShortMessage : string read FShortMessage write FShortMessage stored HasShortMessage;
property LongMessage : string read FLongMessage write FLongMessage stored HasLongMessage;
end;
}
{ TPaginationType }
TPaginationType = class(TBaseComplexRemotable)
private
FEntriesPerPage: Integer;
FPageNumber: Integer;
function HasEntriesPerPage: boolean;
function HasPageNumber: boolean;
published
property EntriesPerPage : Integer read FEntriesPerPage write FEntriesPerPage stored HasEntriesPerPage;
property PageNumber : Integer read FPageNumber write FPageNumber stored HasPageNumber;
end;
{ TPaginationResultType }
TPaginationResultType = class(TBaseComplexRemotable)
private
FTotalNumberOfEntries: Integer;
FTotalNumberOfPages: Integer;
function HasTotalNumberOfEntries: boolean;
function HasTotalNumberOfPages: boolean;
published
property TotalNumberOfPages : Integer read FTotalNumberOfPages write FTotalNumberOfPages stored HasTotalNumberOfPages;
property TotalNumberOfEntries : Integer read FTotalNumberOfEntries write FTotalNumberOfEntries stored HasTotalNumberOfEntries;
end;
{ TCategoryType }
TCategoryType = class(TBaseComplexRemotable)
private
FAutoPayEnabled: Boolean;
FB2BVATEnabled: Boolean;
FBestOfferEnabled: Boolean;
FCatalogEnabled: Boolean;
FCategoryID: string;
FCategoryLevel: Integer;
FCategoryName: string;
FCategoryParentID: string;
FCategoryParentName: string;
FKeywords: string;
FProductFinderAvailable: Boolean;
FProductFinderID: Integer;
FProductSearchPageAvailable: Boolean;
function HasCategoryID: boolean;
function HasCategoryLevel: boolean;
function HasCategoryName: boolean;
function HasCategoryParentID: boolean;
function HasCategoryParentName: boolean;
function HasKeywords: boolean;
function HasProductFinderID: boolean;
published
property BestOfferEnabled : Boolean read FBestOfferEnabled write FBestOfferEnabled stored FBestOfferEnabled;
property AutoPayEnabled : Boolean read FAutoPayEnabled write FAutoPayEnabled stored FAutoPayEnabled;
property B2BVATEnabled : Boolean read FB2BVATEnabled write FB2BVATEnabled stored FB2BVATEnabled;
property CatalogEnabled : Boolean read FCatalogEnabled write FCatalogEnabled stored FCatalogEnabled;
property CategoryID : string read FCategoryID write FCategoryID stored HasCategoryID;
property CategoryLevel : Integer read FCategoryLevel write FCategoryLevel stored HasCategoryLevel;
property CategoryName : string read FCategoryName write FCategoryName stored HasCategoryName;
property CategoryParentID : string read FCategoryParentID write FCategoryParentID stored HasCategoryParentID;
property CategoryParentName : string read FCategoryParentName write FCategoryParentName stored HasCategoryParentName;
property ProductFinderID : Integer read FProductFinderID write FProductFinderID stored HasProductFinderID;
property ProductSearchPageAvailable : Boolean read FProductSearchPageAvailable write FProductSearchPageAvailable stored FProductSearchPageAvailable;
property ProductFinderAvailable : Boolean read FProductFinderAvailable write FProductFinderAvailable stored FProductFinderAvailable;
property Keywords : string read FKeywords write FKeywords stored HasKeywords;
end;
{ TCategoryArrayType }
TCategoryArrayType = class(TBaseObjectArrayRemotable)
private
function GetCategoryItem(AIndex: Integer): TCategoryType;
public
class function GetItemClass():TBaseRemotableClass;override;
property Item[AIndex:Integer] : TCategoryType read GetCategoryItem;
property Category[AIndex:Integer] : TCategoryType read GetCategoryItem;default;
end;
{ TUserIdPasswordType }
TUserIdPasswordType = class(TBaseComplexRemotable)
private
FAppId: string;
FAuthCert: string;
FDevId: string;
FPassword: string;
FUsername: string;
function HasAppId: boolean;
function HasAuthCert: boolean;
function HasDevId: boolean;
function HasPassword: boolean;
function HasUsername: boolean;
published
property AppId : string read FAppId write FAppId stored HasAppId;
property DevId : string read FDevId write FDevId stored HasDevId;
property AuthCert : string read FAuthCert write FAuthCert stored HasAuthCert;
property Username : string read FUsername write FUsername stored HasUsername;
property Password : string read FPassword write FPassword stored HasPassword;
end;
{ TCustomSecurityHeaderType }
TCustomSecurityHeaderType = class(THeaderBlock)
private
FCredentials: TUserIdPasswordType;
FeBayAuthToken: string;
public
constructor Create();override;
destructor Destroy();override;
published
property eBayAuthToken : string read FeBayAuthToken write FeBayAuthToken;
property Credentials : TUserIdPasswordType read FCredentials write FCredentials;
end;
{ TAbstractRequestType }
TAbstractRequestType = class(TBaseComplexRemotable)
private
FVersion: string;
published
property Version : string read FVersion write FVersion;
end;
{ TAbstractResponseType }
TAbstractResponseType = class(TBaseComplexRemotable)
private
FAck: TAckCodeType;
FCorrelationID: string;
FMessage: string;
FVersion: string;
function HasAck: boolean;
function HasCorrelationID: boolean;
function HasMessage: boolean;
function HasVersion: boolean;
published
property CorrelationID : string read FCorrelationID write FCorrelationID stored HasCorrelationID;
property Message : string read FMessage write FMessage stored HasMessage;
property Version : string read FVersion write FVersion stored HasVersion;
property Ack : TAckCodeType read FAck write FAck stored HasAck;
end;
{ TGetCategoriesRequestType }
TGetCategoriesRequestType = class(TAbstractRequestType)
private
FCategorySiteID: string;
function HasCategorySiteID: boolean;
published
property CategorySiteID : string read FCategorySiteID write FCategorySiteID stored HasCategorySiteID;
end;
{ TGetCategoriesResponseType }
TGetCategoriesResponseType = class(TAbstractResponseType)
private
FCategoryCount: Integer;
FCategoryVersion: string;
FMinimumReservePrice: Double;
FReservePriceAllowed: Boolean;
function HasCategoryCount: boolean;
function HasCategoryVersion: boolean;
function HasMinimumReservePrice: boolean;
function HasReservePriceAllowed: boolean;
published
property CategoryCount : Integer read FCategoryCount write FCategoryCount stored HasCategoryCount;
property CategoryVersion : string read FCategoryVersion write FCategoryVersion stored HasCategoryVersion;
property ReservePriceAllowed : Boolean read FReservePriceAllowed write FReservePriceAllowed stored HasReservePriceAllowed;
property MinimumReservePrice : Double read FMinimumReservePrice write FMinimumReservePrice stored HasMinimumReservePrice;
end;
{ TGetPopularKeywordsRequestType }
TGetPopularKeywordsRequestType = class(TAbstractRequestType)
private
FCategoryID: string;
FIncludeChildCategories: Boolean;
FMaxKeywordsRetrieved: Integer;
FPagination: TPaginationType;
function HasCategoryID: boolean;
function HasIncludeChildCategories: boolean;
function HasMaxKeywordsRetrieved: boolean;
function HasPagination: boolean;
public
constructor Create();override;
destructor Destroy();override;
published
property CategoryID : string read FCategoryID write FCategoryID stored HasCategoryID;
property IncludeChildCategories : Boolean read FIncludeChildCategories write FIncludeChildCategories stored HasIncludeChildCategories;
property MaxKeywordsRetrieved : Integer read FMaxKeywordsRetrieved write FMaxKeywordsRetrieved stored HasMaxKeywordsRetrieved;
property Pagination : TPaginationType read FPagination write FPagination stored HasPagination;
end;
{ TGetPopularKeywordsResponseType }
TGetPopularKeywordsResponseType = class(TAbstractResponseType)
private
FCategoryArray: TCategoryArrayType;
FHasMore: Boolean;
FPaginationResult: TPaginationResultType;
function HasCategoryArray: boolean;
function HasPaginationResult: boolean;
procedure SetCategoryArray(const AValue: TCategoryArrayType);
procedure SetPaginationResult(const AValue: TPaginationResultType);
public
constructor Create();override;
destructor Destroy();override;
published
property HasMore : Boolean read FHasMore write FHasMore stored FHasMore;
property CategoryArray : TCategoryArrayType read FCategoryArray write SetCategoryArray stored HasCategoryArray;
property PaginationResult : TPaginationResultType read FPaginationResult write SetPaginationResult stored HasPaginationResult;
end;
IeBayAPIInterfaceService = interface
{function GetCategories(GetCategoriesRequest : TGetCategoriesRequestType ) : TGetCategoriesResponseType;}
procedure GetCategories(
const GetCategoriesRequest : TGetCategoriesRequestType;
out GetCategoriesResponse : TGetCategoriesResponseType
);
procedure GetPopularKeywords(
const GetPopularKeywordsRequest : TGetPopularKeywordsRequestType;
out GetPopularKeywordsResponse : TGetPopularKeywordsResponseType
);
end;
procedure Register_ebay_ServiceMetadata();
implementation
uses imp_utils, metadata_repository;
const
sE_BAY_API_VERSION = 'Version 467';
sE_BAY_NAME_SPACE = 'urn:ebay:apis:eBLBaseComponents';
{ TAbstractResponseType }
function TAbstractResponseType.HasCorrelationID: boolean;
begin
Result := not IsStrEmpty(FCorrelationID);
end;
function TAbstractResponseType.HasAck: boolean;
begin
Result := FAck > Success;
end;
function TAbstractResponseType.HasMessage: boolean;
begin
Result := not IsStrEmpty(FMessage);
end;
function TAbstractResponseType.HasVersion: boolean;
begin
Result := not IsStrEmpty(FVersion);
end;
{ TGetCategoriesRequestType }
function TGetCategoriesRequestType.HasCategorySiteID: boolean;
begin
Result := not IsStrEmpty(FCategorySiteID);
end;
{ TGetCategoriesResponseType }
function TGetCategoriesResponseType.HasCategoryCount: boolean;
begin
Result := ( FCategoryCount > 0 );
end;
function TGetCategoriesResponseType.HasCategoryVersion: boolean;
begin
Result := not IsStrEmpty(FCategoryVersion);
end;
function TGetCategoriesResponseType.HasMinimumReservePrice: boolean;
begin
Result := ( MinimumReservePrice <> 0 );
end;
function TGetCategoriesResponseType.HasReservePriceAllowed: boolean;
begin
Result := FReservePriceAllowed;
end;
{ TUserIdPasswordType }
function TUserIdPasswordType.HasAppId: boolean;
begin
Result := not IsStrEmpty(FAppId);
end;
function TUserIdPasswordType.HasAuthCert: boolean;
begin
Result := not IsStrEmpty(FAuthCert);
end;
function TUserIdPasswordType.HasDevId: boolean;
begin
Result := not IsStrEmpty(FDevId);
end;
function TUserIdPasswordType.HasPassword: boolean;
begin
Result := not IsStrEmpty(FPassword);
end;
function TUserIdPasswordType.HasUsername: boolean;
begin
Result := not IsStrEmpty(FUsername);
end;
{ TCustomSecurityHeaderType }
constructor TCustomSecurityHeaderType.Create();
begin
inherited Create();
FCredentials := TUserIdPasswordType.Create();
end;
destructor TCustomSecurityHeaderType.Destroy();
begin
FreeAndNil(FCredentials);
inherited Destroy();
end;
{ TPaginationType }
function TPaginationType.HasEntriesPerPage: boolean;
begin
Result := HasEntriesPerPage;
end;
function TPaginationType.HasPageNumber: boolean;
begin
Result := ( FPageNumber <> 0 );
end;
{ TGetPopularKeywordsRequestType }
function TGetPopularKeywordsRequestType.HasCategoryID: boolean;
begin
Result := not IsStrEmpty(FCategoryID);
end;
function TGetPopularKeywordsRequestType.HasIncludeChildCategories: boolean;
begin
Result := IncludeChildCategories;
end;
function TGetPopularKeywordsRequestType.HasMaxKeywordsRetrieved: boolean;
begin
Result := ( MaxKeywordsRetrieved <> 0 );
end;
function TGetPopularKeywordsRequestType.HasPagination: boolean;
begin
Result := Assigned(FPagination) and
( FPagination.HasEntriesPerPage or FPagination.HasPageNumber);
end;
constructor TGetPopularKeywordsRequestType.Create();
begin
inherited Create();
end;
destructor TGetPopularKeywordsRequestType.Destroy();
begin
FreeAndNil(FPagination);
inherited Destroy();
end;
{ TCategoryType }
function TCategoryType.HasCategoryID: boolean;
begin
Result := not IsStrEmpty(FCategoryID);
end;
function TCategoryType.HasCategoryLevel: boolean;
begin
Result := ( FCategoryLevel <> 0 );
end;
function TCategoryType.HasCategoryName: boolean;
begin
Result := not IsStrEmpty(FCategoryName);
end;
function TCategoryType.HasCategoryParentID: boolean;
begin
Result := not IsStrEmpty(FCategoryParentID);
end;
function TCategoryType.HasCategoryParentName: boolean;
begin
Result := not IsStrEmpty(FCategoryParentName);
end;
function TCategoryType.HasKeywords: boolean;
begin
Result := not IsStrEmpty(FKeywords);
end;
function TCategoryType.HasProductFinderID: boolean;
begin
Result := ( FProductFinderID > 0 );
end;
{ TCategoryArrayType }
function TCategoryArrayType.GetCategoryItem(AIndex: Integer): TCategoryType;
begin
Result := inherited GetItem(AIndex) as TCategoryType;
end;
class function TCategoryArrayType.GetItemClass(): TBaseRemotableClass;
begin
Result := TCategoryType;
end;
{ TGetPopularKeywordsResponseType }
function TGetPopularKeywordsResponseType.HasCategoryArray: boolean;
begin
Result := ( FCategoryArray.Length > 0 );
end;
function TGetPopularKeywordsResponseType.HasPaginationResult: boolean;
begin
Result := ( FPaginationResult.TotalNumberOfEntries <> 0 ) or
( FPaginationResult.TotalNumberOfPages <> 0 ) ;
end;
procedure TGetPopularKeywordsResponseType.SetCategoryArray(
const AValue: TCategoryArrayType
);
begin
if ( FCategoryArray = AValue ) then
exit;
FCategoryArray.Assign(AValue) ;
end;
procedure TGetPopularKeywordsResponseType.SetPaginationResult(
const AValue: TPaginationResultType
);
begin
if ( FPaginationResult = AValue ) then
exit;
FPaginationResult.Assign(AValue);
end;
constructor TGetPopularKeywordsResponseType.Create();
begin
FCategoryArray := TCategoryArrayType.Create();
FPaginationResult := TPaginationResultType.Create();
inherited Create();
end;
destructor TGetPopularKeywordsResponseType.Destroy();
begin
FreeAndNil(FPaginationResult);
FreeAndNil(FCategoryArray);
inherited Destroy();
end;
procedure RegisterEbayTypes();
Var
r : TTypeRegistry;
ri : TTypeRegistryItem;
begin
r := GetTypeRegistry();
r.Register(sE_BAY_NAME_SPACE,TypeInfo(TAckCodeType),'AckCodeType');
r.Register(sE_BAY_NAME_SPACE,TypeInfo(TCategoryType),'CategoryType');
r.Register(sE_BAY_NAME_SPACE,TypeInfo(TCategoryArrayType),'CategoryArrayType');
r.Register(sE_BAY_NAME_SPACE,TypeInfo(TPaginationType),'PaginationType');
r.Register(sE_BAY_NAME_SPACE,TypeInfo(TPaginationResultType),'PaginationResultType');
r.Register(sE_BAY_NAME_SPACE,TypeInfo(TGetPopularKeywordsRequestType),'GetPopularKeywordsRequestType');
r.Register(sE_BAY_NAME_SPACE,TypeInfo(TGetPopularKeywordsResponseType),'GetPopularKeywordsResponseType');
r.Register(sE_BAY_NAME_SPACE,TypeInfo(TUserIdPasswordType),'UserIdPasswordType');
r.Register(sE_BAY_NAME_SPACE,TypeInfo(TCustomSecurityHeaderType),'RequesterCredentials');//'CustomSecurityHeaderType');
r.Register(sE_BAY_NAME_SPACE,TypeInfo(TGetCategoriesRequestType),'GetCategoriesRequestType');
r.Register(sE_BAY_NAME_SPACE,TypeInfo(TGetCategoriesResponseType),'GetCategoriesResponseType');
end;
procedure Register_ebay_ServiceMetadata();
var
mm : IModuleMetadataMngr;
begin
mm := GetModuleMetadataMngr();
mm.SetOperationCustomData(
'ebay',
'IeBayAPIInterfaceService',
'GetCategories',
'Address',
'https://api.sandbox.ebay.com/wsapi?' +
'callname=GetCategories' +
'&siteid=0' +
'&appid=' + sAPP_ID +
'&version=' + sEBAY_VERSION
);
mm.SetOperationCustomData(
'ebay',
'IeBayAPIInterfaceService',
'GetPopularKeywords',
'Address',
'https://api.sandbox.ebay.com/wsapi?' +
'callname=GetPopularKeywords' +
'&siteid=0' +
'&appid=' + sAPP_ID +
'&version=' + sEBAY_VERSION
);
end;
{ TPaginationResultType }
function TPaginationResultType.HasTotalNumberOfEntries: boolean;
begin
Result := ( FTotalNumberOfEntries <> 0 );
end;
function TPaginationResultType.HasTotalNumberOfPages: boolean;
begin
Result := ( FTotalNumberOfPages <> 0 );
end;
initialization
RegisterEbayTypes();
end.

Binary file not shown.

View File

@ -0,0 +1,98 @@
{
This unit has been produced by ws_helper.
Input unit name : "ebay".
This unit name : "ebay_proxy".
Date : "30/07/2006 21:52".
}
Unit ebay_proxy;
{$mode objfpc}{$H+}
Interface
Uses SysUtils, Classes, TypInfo, base_service_intf, service_intf, ebay;
Type
TeBayAPIInterfaceService_Proxy=class(TBaseProxy,IeBayAPIInterfaceService)
Protected
class function GetServiceType() : PTypeInfo;override;
procedure GetCategories(
Const GetCategoriesRequest : TGetCategoriesRequestType;
Out GetCategoriesResponse : TGetCategoriesResponseType
);
procedure GetPopularKeywords(
Const GetPopularKeywordsRequest : TGetPopularKeywordsRequestType;
Out GetPopularKeywordsResponse : TGetPopularKeywordsResponseType
);
End;
Implementation
uses LResources, metadata_repository;
{ TeBayAPIInterfaceService_Proxy implementation }
class function TeBayAPIInterfaceService_Proxy.GetServiceType() : PTypeInfo;
begin
result := TypeInfo(IeBayAPIInterfaceService);
end;
procedure TeBayAPIInterfaceService_Proxy.GetCategories(
Const GetCategoriesRequest : TGetCategoriesRequestType;
Out GetCategoriesResponse : TGetCategoriesResponseType
);
Var
locSerializer : IFormatterClient;
strPrmName : string;
Begin
locSerializer := GetSerializer();
Try
locSerializer.BeginCall('GetCategories', GetTarget(),(Self as ICallContext));
locSerializer.Put('GetCategoriesRequest', TypeInfo(TGetCategoriesRequestType), GetCategoriesRequest);
locSerializer.EndCall();
MakeCall();
locSerializer.BeginCallRead((Self as ICallContext));
Pointer(GetCategoriesResponse) := Nil;
strPrmName := 'GetCategoriesResponse';
locSerializer.Get(TypeInfo(TGetCategoriesResponseType), strPrmName, GetCategoriesResponse);
Finally
locSerializer.Clear();
End;
End;
procedure TeBayAPIInterfaceService_Proxy.GetPopularKeywords(
Const GetPopularKeywordsRequest : TGetPopularKeywordsRequestType;
Out GetPopularKeywordsResponse : TGetPopularKeywordsResponseType
);
Var
locSerializer : IFormatterClient;
strPrmName : string;
Begin
locSerializer := GetSerializer();
Try
locSerializer.BeginCall('GetPopularKeywords', GetTarget(),(Self as ICallContext));
locSerializer.Put('GetPopularKeywordsRequest', TypeInfo(TGetPopularKeywordsRequestType), GetPopularKeywordsRequest);
locSerializer.EndCall();
MakeCall();
locSerializer.BeginCallRead((Self as ICallContext));
Pointer(GetPopularKeywordsResponse) := Nil;
strPrmName := 'GetPopularKeywordsResponse';
locSerializer.Get(TypeInfo(TGetPopularKeywordsResponseType), strPrmName, GetPopularKeywordsResponse);
Finally
locSerializer.Clear();
End;
End;
initialization
{$i ebay.lrs}
{$IF DECLARED(Register_ebay_ServiceMetadata)}
Register_ebay_ServiceMetadata();
{$ENDIF}
End.

View File

@ -0,0 +1,386 @@
<?xml version="1.0"?>
<CONFIG>
<ProjectOptions>
<PathDelim Value="\"/>
<Version Value="5"/>
<General>
<MainUnit Value="0"/>
<IconPath Value="./"/>
<TargetFileExt Value=".exe"/>
<ActiveEditorIndexAtStart Value="0"/>
</General>
<PublishOptions>
<Version Value="2"/>
<IgnoreBinaries Value="False"/>
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
</local>
</RunParams>
<RequiredPackages Count="1">
<Item1>
<PackageName Value="indylaz"/>
</Item1>
</RequiredPackages>
<Units Count="22">
<Unit0>
<Filename Value="test_ebay.lpr"/>
<IsPartOfProject Value="True"/>
<UnitName Value="test_ebay"/>
<CursorPos X="34" Y="63"/>
<TopLine Value="1"/>
<EditorIndex Value="0"/>
<UsageCount Value="43"/>
<Loaded Value="True"/>
</Unit0>
<Unit1>
<Filename Value="ebay.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="ebay"/>
<CursorPos X="18" Y="103"/>
<TopLine Value="156"/>
<UsageCount Value="43"/>
</Unit1>
<Unit2>
<Filename Value="..\..\service_intf.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="service_intf"/>
<CursorPos X="1" Y="151"/>
<TopLine Value="140"/>
<EditorIndex Value="2"/>
<UsageCount Value="43"/>
<Loaded Value="True"/>
</Unit2>
<Unit3>
<Filename Value="..\..\soap_formatter.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="soap_formatter"/>
<CursorPos X="25" Y="244"/>
<TopLine Value="236"/>
<EditorIndex Value="6"/>
<UsageCount Value="43"/>
<Loaded Value="True"/>
</Unit3>
<Unit4>
<Filename Value="..\..\base_service_intf.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="base_service_intf"/>
<CursorPos X="20" Y="30"/>
<TopLine Value="11"/>
<UsageCount Value="43"/>
</Unit4>
<Unit5>
<Filename Value="..\..\base_soap_formatter.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="base_soap_formatter"/>
<CursorPos X="1" Y="619"/>
<TopLine Value="608"/>
<UsageCount Value="43"/>
<Bookmarks Count="1">
<Item0 X="11" Y="610" ID="1"/>
</Bookmarks>
</Unit5>
<Unit6>
<Filename Value="ebay_proxy.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="ebay_proxy"/>
<CursorPos X="1" Y="34"/>
<TopLine Value="23"/>
<EditorIndex Value="1"/>
<UsageCount Value="43"/>
<Loaded Value="True"/>
</Unit6>
<Unit7>
<Filename Value="..\..\ics_http_protocol.pas"/>
<UnitName Value="ics_http_protocol"/>
<CursorPos X="33" Y="161"/>
<TopLine Value="143"/>
<UsageCount Value="19"/>
</Unit7>
<Unit8>
<Filename Value="D:\Lazarus\others_package\indy\indy-10.2.0.1\fpc\Protocols\IdSSLOpenSSL.pas"/>
<UnitName Value="IdSSLOpenSSL"/>
<CursorPos X="14" Y="267"/>
<TopLine Value="250"/>
<UsageCount Value="17"/>
</Unit8>
<Unit9>
<Filename Value="..\..\indy_http_protocol.pas"/>
<UnitName Value="indy_http_protocol"/>
<CursorPos X="1" Y="38"/>
<TopLine Value="38"/>
<UsageCount Value="20"/>
</Unit9>
<Unit10>
<Filename Value="D:\Lazarus\others_package\indy\indy-10.2.0.1\fpc\Protocols\IdHTTP.pas"/>
<UnitName Value="IdHTTP"/>
<CursorPos X="9" Y="342"/>
<TopLine Value="328"/>
<UsageCount Value="12"/>
</Unit10>
<Unit11>
<Filename Value="D:\Lazarus\others_package\indy\indy-10.2.0.1\fpc\Protocols\IdSSL.pas"/>
<UnitName Value="IdSSL"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="14"/>
<UsageCount Value="10"/>
</Unit11>
<Unit12>
<Filename Value="D:\Lazarus\others_package\indy\indy-10.2.0.1\fpc\Core\IdTCPClient.pas"/>
<UnitName Value="IdTCPClient"/>
<CursorPos X="3" Y="144"/>
<TopLine Value="165"/>
<UsageCount Value="12"/>
</Unit12>
<Unit13>
<Filename Value="..\..\synapse_http_protocol.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="synapse_http_protocol"/>
<CursorPos X="1" Y="155"/>
<TopLine Value="132"/>
<EditorIndex Value="3"/>
<UsageCount Value="24"/>
<Loaded Value="True"/>
</Unit13>
<Unit14>
<Filename Value="D:\lazarusClean\others_package\synapse\httpsend.pas"/>
<UnitName Value="httpsend"/>
<CursorPos X="30" Y="143"/>
<TopLine Value="132"/>
<UsageCount Value="12"/>
</Unit14>
<Unit15>
<Filename Value="D:\lazarusClean\others_package\synapse\blcksock.pas"/>
<UnitName Value="blcksock"/>
<CursorPos X="1" Y="3571"/>
<TopLine Value="3560"/>
<UsageCount Value="12"/>
</Unit15>
<Unit16>
<Filename Value="D:\lazarusClean\others_package\synapse\ssl_openssl.pas"/>
<UnitName Value="ssl_openssl"/>
<CursorPos X="1" Y="506"/>
<TopLine Value="495"/>
<UsageCount Value="10"/>
</Unit16>
<Unit17>
<Filename Value="D:\lazarusClean\others_package\synapse\ssl_openssl_lib.pas"/>
<UnitName Value="ssl_openssl_lib"/>
<CursorPos X="1" Y="1233"/>
<TopLine Value="1222"/>
<UsageCount Value="10"/>
</Unit17>
<Unit18>
<Filename Value="D:\lazarusClean\fpcsrc\rtl\objpas\classes\classesh.inc"/>
<CursorPos X="14" Y="604"/>
<TopLine Value="593"/>
<UsageCount Value="10"/>
</Unit18>
<Unit19>
<Filename Value="D:\lazarusClean\fpcsrc\rtl\objpas\classes\streams.inc"/>
<CursorPos X="7" Y="180"/>
<TopLine Value="158"/>
<UsageCount Value="10"/>
</Unit19>
<Unit20>
<Filename Value="D:\Lazarus\others_package\synapse\httpsend.pas"/>
<UnitName Value="httpsend"/>
<CursorPos X="1" Y="566"/>
<TopLine Value="555"/>
<EditorIndex Value="4"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
</Unit20>
<Unit21>
<Filename Value="D:\Lazarus\others_package\synapse\blcksock.pas"/>
<UnitName Value="blcksock"/>
<CursorPos X="1" Y="1901"/>
<TopLine Value="1890"/>
<EditorIndex Value="5"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
</Unit21>
</Units>
<JumpHistory Count="26" HistoryIndex="25">
<Position1>
<Filename Value="D:\Lazarus\others_package\synapse\httpsend.pas"/>
<Caret Line="531" Column="1" TopLine="520"/>
</Position1>
<Position2>
<Filename Value="D:\Lazarus\others_package\synapse\httpsend.pas"/>
<Caret Line="534" Column="1" TopLine="523"/>
</Position2>
<Position3>
<Filename Value="D:\Lazarus\others_package\synapse\httpsend.pas"/>
<Caret Line="537" Column="1" TopLine="526"/>
</Position3>
<Position4>
<Filename Value="D:\Lazarus\others_package\synapse\httpsend.pas"/>
<Caret Line="538" Column="11" TopLine="527"/>
</Position4>
<Position5>
<Filename Value="D:\Lazarus\others_package\synapse\httpsend.pas"/>
<Caret Line="541" Column="32" TopLine="530"/>
</Position5>
<Position6>
<Filename Value="D:\Lazarus\others_package\synapse\httpsend.pas"/>
<Caret Line="543" Column="1" TopLine="532"/>
</Position6>
<Position7>
<Filename Value="D:\Lazarus\others_package\synapse\httpsend.pas"/>
<Caret Line="544" Column="1" TopLine="533"/>
</Position7>
<Position8>
<Filename Value="D:\Lazarus\others_package\synapse\httpsend.pas"/>
<Caret Line="558" Column="1" TopLine="547"/>
</Position8>
<Position9>
<Filename Value="D:\Lazarus\others_package\synapse\httpsend.pas"/>
<Caret Line="559" Column="1" TopLine="548"/>
</Position9>
<Position10>
<Filename Value="D:\Lazarus\others_package\synapse\httpsend.pas"/>
<Caret Line="561" Column="1" TopLine="550"/>
</Position10>
<Position11>
<Filename Value="D:\Lazarus\others_package\synapse\httpsend.pas"/>
<Caret Line="562" Column="1" TopLine="551"/>
</Position11>
<Position12>
<Filename Value="D:\Lazarus\others_package\synapse\httpsend.pas"/>
<Caret Line="563" Column="1" TopLine="552"/>
</Position12>
<Position13>
<Filename Value="D:\Lazarus\others_package\synapse\httpsend.pas"/>
<Caret Line="565" Column="1" TopLine="554"/>
</Position13>
<Position14>
<Filename Value="D:\Lazarus\others_package\synapse\httpsend.pas"/>
<Caret Line="566" Column="1" TopLine="555"/>
</Position14>
<Position15>
<Filename Value="D:\Lazarus\others_package\synapse\httpsend.pas"/>
<Caret Line="572" Column="1" TopLine="561"/>
</Position15>
<Position16>
<Filename Value="D:\Lazarus\others_package\synapse\httpsend.pas"/>
<Caret Line="574" Column="1" TopLine="563"/>
</Position16>
<Position17>
<Filename Value="D:\Lazarus\others_package\synapse\httpsend.pas"/>
<Caret Line="580" Column="1" TopLine="569"/>
</Position17>
<Position18>
<Filename Value="D:\Lazarus\others_package\synapse\httpsend.pas"/>
<Caret Line="582" Column="1" TopLine="571"/>
</Position18>
<Position19>
<Filename Value="D:\Lazarus\others_package\synapse\httpsend.pas"/>
<Caret Line="561" Column="1" TopLine="550"/>
</Position19>
<Position20>
<Filename Value="D:\Lazarus\others_package\synapse\httpsend.pas"/>
<Caret Line="562" Column="1" TopLine="551"/>
</Position20>
<Position21>
<Filename Value="D:\Lazarus\others_package\synapse\httpsend.pas"/>
<Caret Line="563" Column="1" TopLine="552"/>
</Position21>
<Position22>
<Filename Value="D:\Lazarus\others_package\synapse\httpsend.pas"/>
<Caret Line="565" Column="1" TopLine="554"/>
</Position22>
<Position23>
<Filename Value="D:\Lazarus\others_package\synapse\httpsend.pas"/>
<Caret Line="566" Column="1" TopLine="555"/>
</Position23>
<Position24>
<Filename Value="test_ebay.lpr"/>
<Caret Line="75" Column="64" TopLine="58"/>
</Position24>
<Position25>
<Filename Value="test_ebay.lpr"/>
<Caret Line="1" Column="1" TopLine="1"/>
</Position25>
<Position26>
<Filename Value="test_ebay.lpr"/>
<Caret Line="63" Column="34" TopLine="52"/>
</Position26>
</JumpHistory>
</ProjectOptions>
<CompilerOptions>
<Version Value="5"/>
<PathDelim Value="\"/>
<SearchPaths>
<OtherUnitFiles Value="..\..\;D:\Lazarus\others_package\ics\latest_distr\Delphi\Vc32\;D:\Lazarus\others_package\indy\indy-10.2.0.1\fpc\Protocols\;D:\lazarus\others_package\synapse\"/>
<UnitOutputDirectory Value="obj"/>
</SearchPaths>
<CodeGeneration>
<Generate Value="Faster"/>
</CodeGeneration>
<Other>
<CompilerPath Value="$(CompPath)"/>
</Other>
</CompilerOptions>
<Debugging>
<BreakPoints Count="12">
<Item1>
<Source Value="..\google_api\home\inoussa\Projets\Laz\tests\soap\test_soap.pas"/>
<Line Value="15"/>
</Item1>
<Item2>
<Source Value="..\google_api\home\inoussa\Projets\Laz\tests\soap\test_soap.pas"/>
<Line Value="16"/>
</Item2>
<Item3>
<Source Value="..\google_api\home\inoussa\Projets\Laz\tests\soap\test_soap.pas"/>
<Line Value="18"/>
</Item3>
<Item4>
<Source Value="..\google_api\home\inoussa\Projets\Laz\tests\soap\googleintfimpunit.pas"/>
<Line Value="63"/>
</Item4>
<Item5>
<Source Value="..\google_api\home\inoussa\Projets\Laz\v0.2\indy_http_protocol.pas"/>
<Line Value="69"/>
</Item5>
<Item6>
<Source Value="..\google_api\home\inoussa\Projets\Laz\v0.2\service_intf.pas"/>
<Line Value="567"/>
</Item6>
<Item7>
<Source Value="..\google_api\home\inoussa\Projets\Laz\v0.2\imp_utils.pas"/>
<Line Value="83"/>
</Item7>
<Item8>
<Source Value="test_ebay.lpr"/>
<Line Value="67"/>
</Item8>
<Item9>
<Source Value="..\..\synapse_http_protocol.pas"/>
<Line Value="160"/>
</Item9>
<Item10>
<Source Value="D:\lazarusClean\others_package\synapse\ssl_openssl.pas"/>
<Line Value="813"/>
</Item10>
<Item11>
<Source Value="..\..\synapse_http_protocol.pas"/>
<Line Value="156"/>
</Item11>
<Item12>
<Source Value="..\..\synapse_http_protocol.pas"/>
<Line Value="150"/>
</Item12>
</BreakPoints>
<Watches Count="1">
<Item1>
<Expression Value="ASource.Memory^"/>
</Item1>
</Watches>
</Debugging>
</CONFIG>

View File

@ -0,0 +1,83 @@
program test_ebay;
{$mode objfpc}{$H+}
uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Classes, SysUtils,
service_intf, soap_formatter, base_service_intf, base_soap_formatter,
//ics_http_protocol,
//indylaz,
//indy_http_protocol,
ebay, ebay_proxy,
ssl_openssl, synapse_http_protocol;
var
locService : IeBayAPIInterfaceService;
locHdr : TCustomSecurityHeaderType;
r : TGetCategoriesRequestType;
rsp : TGetCategoriesResponseType;
begin
//Indy_RegisterHTTP_Transport();
SYNAPSE_RegisterHTTP_Transport();
r := nil;
rsp := nil;
locHdr := TCustomSecurityHeaderType.Create();
try
locHdr.eBayAuthToken := {
'AgAAAA**AQAAAA**aAAAAA**OeGvRA**nY+sHZ2PrBmdj6wVnY+sEZ2PrA2dj6wJnY+lAZOE'+
'pgqdj6x9nY+seQ**uoUAAA**AAMAAA**z5djiOw1a7Tk12KGGPqSpvnxxNYOVUtaSbmQ7hYd4p'+
'X4XfafLKBtImKsW9SUsbmBS9fXOyBnXA3k0jLelpiMptvlZ8N52UQA/ePc6+JE7LJFrARMoBaW5l'+
'HEQOMESJLAdFJiGmLwrnagdeo6WRI89guRtDkydPyHwHUJ7aCFQvwzeD/b+1pnXelHQvQBRFtD3drU'+
'BV9FbAf1/d4w/C+x5EHrBHyA+/T9uBelb3wkI8Rk/jnwF+L1qZlSW90pcyi3uxoSuBGVolgihrL/IKE'+
'2mPcK3GAtqROu6Tsasjzz/tqkSIuFLeJ9HphAzdB+LNhyR1NGbe+l+goY74saRbEb2iqYo5wCTTLELC2k3'+
'9p0V1Fp7CWn3Fet+y6fz8PXMb1BfYKg6fLzHXaqCRaffHJCSkvhrWwIVEuxbot4o5T8/v'+
'TcmmAm3T78S4B6NBdLPv7f4WxbzYYRS8Y8k7Y9GZ1/8Jomfv+LlGNrs0/sN+PkCJATAJZ3W'+
'tIWqyg9GHnHVA+oKCdmItd2j6nEiNq7whNdJegMOWp3jI2BvJoauJc06lw6ZMHhuj4zDiDnEwP'+
'DCBmY6sHWMUx1xacahKYrRsvKYvE9/eOlEaQP7OCDmJm6VVwJIkSejOnmnMmUxLGMu6to17jruAj'+
'Wb4s0oXSKPg9J/M2rvgE0l0tWj3O6kt9jPH533K5Wj2I/i6s0blc9z9eY/WY4+HDHe+VFX9AqMmHuD'+
'yog//CUNDaG5HUSw10GM26gvswNpYWGih5Ju5ylvf9B';}
'AgAAAA**AQAAAA**aAAAAA**5Ca0RA**nY+sHZ2PrBmdj6wVnY+sEZ2PrA2dj6wJnY+lAZSFpg'+
'Wdj6x9nY+seQ**uoUAAA**AAMAAA**CVYGMzI5zQ2Wh9dcHROrT0o6/BWlHNSzb+sPVl+W7UK8o0'+
'zpmispZNrnzXjlqd5m5nZjWfXzEGFTZVw7B+2k14tcQyiCQQn0nD6ft5KUWsxZ4Ugx/EgilEFNhT7l'+
'iQXBxblWq1K3CJJtyCRu1Q/eyW0c4cttutktG3c5wFGR20QUm8pFBaXVNEB11jAyzz2dB+Ij3efuSTZR'+
'umGNaVHeNXkLXTfaVuOzREjU5zye4bh1cHtw72pS+oTbmKB+Svflhtq7asqnfrsllRENP6fEpCzJSVqbMW'+
'Om+rulRa0qKOOpEGk2Mme8HDdccwtqHIq1MwT9WbcF2pV6aGKpllU4H+ii7SYwDTr8mwb45t7l26loyszoZo'+
'NelhXq3TS85KwmDqwgZzVlHoY+4yZVe8FRvOY7rYbtCJtZnwv7fx8+tdoogeE2eW5hNkXPvuS+Wh9yj+T1yexp'+
'5szSfOVmn1Obik6Cz/qOxF+AIHpdO1N8qC6D/x85nlkxUbvVWBHkAVYsAxbQ1uZzpRIednc8wKLZ47cTUGPinP1B'+
'hgC9+l14Isquhsx5gx9t3vc79lzfRPMOaQ5k42vZaUFYTpQ2tYn7kQ9y850NPBdNVmUxLi5hCActWCHFplNrYVnnnm'+
'WOcuZT+DTUmh2OHiL59Av33CPhGNCGktEX0/I3FNTbM2OHCqet/eSRXNHM4JuuLhP2p7IyDfbowkXpwDZtanew64itUr'+
'iSInDbHpO9xlVK32t/+na6yNuCGqFEEtnl5gJ2OI1P';
//locHdr.Credentials.Username := 'inousa12';
//locHdr.Credentials.Password := 'atou121076';
locHdr.Credentials.AppId := 'INOUSSAOUEU258CIC9Z5E83UXC1BE5';
locHdr.Credentials.DevId := 'L11ZDC63VDJ1FPLJL5EA161OQ2MS95';
locHdr.Credentials.AuthCert := 'A266GKZC9F5$HI2HIH58A-D3JH2YA4';//'L11ZDC63VDJ1FPLJL5EA161OQ2MS95;INOUSSAOUEU258CIC9Z5E83UXC1BE5;A266GKZC9F5$HI2HIH58A-D3JH2YA4';
locService := TeBayAPIInterfaceService_Proxy.Create(
'eBayAPIInterfaceService',
'SOAP:Style=Document;EncodingStyle=Litteral',
'http:Address=https://api.sandbox.ebay.com/wsapi?callname=GetCategories&siteid=0&appid=INOUSSAOUEU258CIC9Z5E83UXC1BE5&version=467'
); //https://api.sandbox.ebay.com/wsapi
//https://api.sandbox.ebay.com/wsapi
//https://api.sandbox.ebay.com/ws/api.dll
(locService as ICallContext).AddHeader(locHdr,True);
r := TGetCategoriesRequestType.Create();
r.Version := '467';
try
locService.GetCategories(r,rsp);
except
on e : Exception do begin
WriteLn('Exception : ',e.Message);
raise;
end;
end;
finally
r.Free();
rsp.Free();
end;
end.

View File

@ -0,0 +1,304 @@
<?xml version="1.0"?>
<CONFIG>
<ProjectOptions>
<PathDelim Value="\"/>
<Version Value="5"/>
<General>
<MainUnit Value="0"/>
<IconPath Value="./"/>
<TargetFileExt Value=".exe"/>
<ActiveEditorIndexAtStart Value="3"/>
</General>
<PublishOptions>
<Version Value="2"/>
<IgnoreBinaries Value="False"/>
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
</local>
</RunParams>
<RequiredPackages Count="1">
<Item1>
<PackageName Value="LCL"/>
</Item1>
</RequiredPackages>
<Units Count="23">
<Unit0>
<Filename Value="test_ebay_gui.lpr"/>
<IsPartOfProject Value="True"/>
<UnitName Value="test_ebay_gui"/>
<CursorPos X="1" Y="17"/>
<TopLine Value="1"/>
<UsageCount Value="63"/>
</Unit0>
<Unit1>
<Filename Value="umain.pas"/>
<ComponentName Value="Form1"/>
<IsPartOfProject Value="True"/>
<ResourceFilename Value="umain.lrs"/>
<UnitName Value="umain"/>
<CursorPos X="39" Y="144"/>
<TopLine Value="137"/>
<EditorIndex Value="1"/>
<UsageCount Value="63"/>
<Loaded Value="True"/>
</Unit1>
<Unit2>
<Filename Value="..\..\synapse_http_protocol.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="synapse_http_protocol"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="157"/>
<EditorIndex Value="0"/>
<UsageCount Value="63"/>
<Loaded Value="True"/>
</Unit2>
<Unit3>
<Filename Value="..\..\base_service_intf.pas"/>
<UnitName Value="base_service_intf"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<EditorIndex Value="4"/>
<UsageCount Value="30"/>
<Loaded Value="True"/>
</Unit3>
<Unit4>
<Filename Value="..\..\service_intf.pas"/>
<UnitName Value="service_intf"/>
<CursorPos X="23" Y="333"/>
<TopLine Value="320"/>
<UsageCount Value="31"/>
</Unit4>
<Unit5>
<Filename Value="..\..\soap_formatter.pas"/>
<UnitName Value="soap_formatter"/>
<CursorPos X="60" Y="159"/>
<TopLine Value="149"/>
<UsageCount Value="24"/>
</Unit5>
<Unit6>
<Filename Value="..\..\imp_utils.pas"/>
<UnitName Value="imp_utils"/>
<CursorPos X="3" Y="119"/>
<TopLine Value="109"/>
<UsageCount Value="17"/>
</Unit6>
<Unit7>
<Filename Value="..\..\base_soap_formatter.pas"/>
<UnitName Value="base_soap_formatter"/>
<CursorPos X="33" Y="86"/>
<TopLine Value="76"/>
<UsageCount Value="26"/>
<Bookmarks Count="2">
<Item0 X="14" Y="670" ID="1"/>
<Item1 X="1" Y="437" ID="2"/>
</Bookmarks>
</Unit7>
<Unit8>
<Filename Value="D:\lazarusClean\others_package\synapse\httpsend.pas"/>
<UnitName Value="httpsend"/>
<CursorPos X="40" Y="123"/>
<TopLine Value="122"/>
<UsageCount Value="10"/>
</Unit8>
<Unit9>
<Filename Value="ebay.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="ebay"/>
<CursorPos X="13" Y="536"/>
<TopLine Value="525"/>
<EditorIndex Value="3"/>
<UsageCount Value="47"/>
<Loaded Value="True"/>
</Unit9>
<Unit10>
<Filename Value="..\..\metadata_service.pas"/>
<UnitName Value="metadata_service"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="43"/>
<UsageCount Value="8"/>
</Unit10>
<Unit11>
<Filename Value="..\..\metadata_repository.pas"/>
<UnitName Value="metadata_repository"/>
<CursorPos X="46" Y="84"/>
<TopLine Value="84"/>
<UsageCount Value="17"/>
<Bookmarks Count="1">
<Item0 X="1" Y="91" ID="3"/>
</Bookmarks>
</Unit11>
<Unit12>
<Filename Value="ebay_proxy.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="ebay_proxy"/>
<CursorPos X="26" Y="96"/>
<TopLine Value="77"/>
<EditorIndex Value="2"/>
<UsageCount Value="47"/>
<Loaded Value="True"/>
</Unit12>
<Unit13>
<Filename Value="D:\lazarusClean\fpcsrc\rtl\inc\heaph.inc"/>
<CursorPos X="10" Y="94"/>
<TopLine Value="82"/>
<UsageCount Value="8"/>
</Unit13>
<Unit14>
<Filename Value="D:\lazarusClean\fpcsrc\rtl\inc\heap.inc"/>
<CursorPos X="3" Y="342"/>
<TopLine Value="346"/>
<UsageCount Value="8"/>
</Unit14>
<Unit15>
<Filename Value="D:\lazarusClean\fpcsrc\rtl\objpas\typinfo.pp"/>
<UnitName Value="typinfo"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="94"/>
<UsageCount Value="9"/>
</Unit15>
<Unit16>
<Filename Value="ebay.lrs"/>
<CursorPos X="20" Y="1"/>
<TopLine Value="1"/>
<UsageCount Value="9"/>
</Unit16>
<Unit17>
<Filename Value="D:\lazarusClean\lcl\lresources.pp"/>
<UnitName Value="LResources"/>
<CursorPos X="3" Y="930"/>
<TopLine Value="907"/>
<UsageCount Value="9"/>
</Unit17>
<Unit18>
<Filename Value="D:\Lazarus\fpcsrc\rtl\inc\objpash.inc"/>
<CursorPos X="20" Y="169"/>
<TopLine Value="157"/>
<UsageCount Value="10"/>
</Unit18>
<Unit19>
<Filename Value="D:\Lazarus\fpcsrc\rtl\inc\objpas.inc"/>
<CursorPos X="28" Y="446"/>
<TopLine Value="428"/>
<UsageCount Value="10"/>
</Unit19>
<Unit20>
<Filename Value="D:\Lazarus\fpcsrc\fcl\inc\contnrs.pp"/>
<UnitName Value="contnrs"/>
<CursorPos X="23" Y="520"/>
<TopLine Value="517"/>
<UsageCount Value="10"/>
</Unit20>
<Unit21>
<Filename Value="D:\Lazarus\fpcsrc\rtl\objpas\classes\classesh.inc"/>
<CursorPos X="15" Y="204"/>
<TopLine Value="192"/>
<UsageCount Value="10"/>
</Unit21>
<Unit22>
<Filename Value="D:\Lazarus\fpcsrc\rtl\objpas\classes\lists.inc"/>
<CursorPos X="3" Y="417"/>
<TopLine Value="412"/>
<UsageCount Value="10"/>
</Unit22>
</Units>
<JumpHistory Count="5" HistoryIndex="4">
<Position1>
<Filename Value="umain.pas"/>
<Caret Line="31" Column="25" TopLine="26"/>
</Position1>
<Position2>
<Filename Value="umain.pas"/>
<Caret Line="149" Column="36" TopLine="138"/>
</Position2>
<Position3>
<Filename Value="umain.pas"/>
<Caret Line="46" Column="24" TopLine="33"/>
</Position3>
<Position4>
<Filename Value="ebay_proxy.pas"/>
<Caret Line="96" Column="26" TopLine="77"/>
</Position4>
<Position5>
<Filename Value="ebay.pas"/>
<Caret Line="524" Column="5" TopLine="515"/>
</Position5>
</JumpHistory>
</ProjectOptions>
<CompilerOptions>
<Version Value="5"/>
<PathDelim Value="\"/>
<SearchPaths>
<OtherUnitFiles Value="D:\lazarus\others_package\synapse\;..\..\"/>
<UnitOutputDirectory Value="obj"/>
<SrcPath Value="$(LazarusDir)\lcl\;$(LazarusDir)\lcl\interfaces\$(LCLWidgetType)\"/>
</SearchPaths>
<CodeGeneration>
<Generate Value="Faster"/>
</CodeGeneration>
<Linking>
<Options>
<Win32>
<GraphicApplication Value="True"/>
</Win32>
</Options>
</Linking>
<Other>
<CustomOptions Value=""/>
<CompilerPath Value="$(CompPath)"/>
</Other>
</CompilerOptions>
<Debugging>
<BreakPoints Count="10">
<Item1>
<Source Value="..\google_api\home\inoussa\Projets\Laz\tests\soap\test_soap.pas"/>
<Line Value="15"/>
</Item1>
<Item2>
<Source Value="..\google_api\home\inoussa\Projets\Laz\tests\soap\test_soap.pas"/>
<Line Value="16"/>
</Item2>
<Item3>
<Source Value="..\google_api\home\inoussa\Projets\Laz\tests\soap\test_soap.pas"/>
<Line Value="18"/>
</Item3>
<Item4>
<Source Value="..\google_api\home\inoussa\Projets\Laz\tests\soap\googleintfimpunit.pas"/>
<Line Value="63"/>
</Item4>
<Item5>
<Source Value="..\google_api\home\inoussa\Projets\Laz\v0.2\indy_http_protocol.pas"/>
<Line Value="69"/>
</Item5>
<Item6>
<Source Value="..\google_api\home\inoussa\Projets\Laz\v0.2\service_intf.pas"/>
<Line Value="567"/>
</Item6>
<Item7>
<Source Value="..\google_api\home\inoussa\Projets\Laz\v0.2\imp_utils.pas"/>
<Line Value="83"/>
</Item7>
<Item8>
<Source Value="test_ebay.lpr"/>
<Line Value="67"/>
</Item8>
<Item9>
<Source Value="D:\lazarusClean\others_package\synapse\ssl_openssl.pas"/>
<Line Value="813"/>
</Item9>
<Item10>
<Source Value="umain.pas"/>
<Line Value="92"/>
</Item10>
</BreakPoints>
<Watches Count="1">
<Item1>
<Expression Value="ASource.Memory^"/>
</Item1>
</Watches>
</Debugging>
</CONFIG>

View File

@ -0,0 +1,18 @@
program test_ebay_gui;
{$mode objfpc}{$H+}
uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Interfaces, // this includes the LCL widgetset
Forms
{ add your units here }, umain, synapse_http_protocol, ebay, ebay_proxy;
begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

View File

@ -0,0 +1,121 @@
object Form1: TForm1
Left = 301
Height = 388
Top = 159
Width = 400
HorzScrollBar.Page = 399
VertScrollBar.Page = 387
ActiveControl = Button1
Caption = 'Form1'
OnCreate = FormCreate
object Panel1: TPanel
Height = 184
Width = 400
Align = alTop
TabOrder = 0
object Label1: TLabel
Left = 16
Height = 14
Top = 53
Width = 77
Caption = 'eBayAuthToken'
Color = clNone
ParentColor = False
end
object Label2: TLabel
Left = 16
Height = 14
Top = 79
Width = 30
Caption = 'AppId'
Color = clNone
ParentColor = False
end
object Label3: TLabel
Left = 16
Height = 14
Top = 111
Width = 30
Caption = 'DevId'
Color = clNone
ParentColor = False
end
object Label4: TLabel
Left = 16
Height = 14
Top = 144
Width = 45
Caption = 'AuthCert'
Color = clNone
ParentColor = False
end
object Bevel1: TBevel
Left = 10
Height = 170
Top = 4
Width = 380
Anchors = [akTop, akLeft, akRight]
end
object Button1: TButton
Left = 288
Height = 25
Top = 8
Width = 99
BorderSpacing.InnerBorder = 4
Caption = 'GetCategories'
OnClick = Button1Click
TabOrder = 0
Visible = False
end
object Button3: TButton
Left = 16
Height = 25
Top = 8
Width = 136
BorderSpacing.InnerBorder = 4
Caption = 'GetPopularKeywords'
OnClick = Button3Click
TabOrder = 1
end
object edteBayAuthToken: TEdit
Left = 96
Height = 23
Top = 48
Width = 288
Anchors = [akTop, akLeft, akRight]
TabOrder = 2
end
object edtAppId: TEdit
Left = 96
Height = 23
Top = 77
Width = 288
Anchors = [akTop, akLeft, akRight]
TabOrder = 3
end
object edtDevId: TEdit
Left = 96
Height = 23
Top = 108
Width = 288
Anchors = [akTop, akLeft, akRight]
TabOrder = 4
end
object edtAuthCert: TEdit
Left = 96
Height = 23
Top = 136
Width = 288
Anchors = [akTop, akLeft, akRight]
TabOrder = 5
end
end
object trvOut: TTreeView
Height = 204
Top = 184
Width = 400
Align = alClient
DefaultItemHeight = 15
TabOrder = 1
end
end

View File

@ -0,0 +1,31 @@
LazarusResources.Add('TForm1','FORMDATA',[
'TPF0'#6'TForm1'#5'Form1'#4'Left'#3'-'#1#6'Height'#3#132#1#3'Top'#3#159#0#5'W'
+'idth'#3#144#1#18'HorzScrollBar.Page'#3#143#1#18'VertScrollBar.Page'#3#131#1
+#13'ActiveControl'#7#7'Button1'#7'Caption'#6#5'Form1'#8'OnCreate'#7#10'FormC'
+'reate'#0#6'TPanel'#6'Panel1'#6'Height'#3#184#0#5'Width'#3#144#1#5'Align'#7#5
+'alTop'#8'TabOrder'#2#0#0#6'TLabel'#6'Label1'#4'Left'#2#16#6'Height'#2#14#3
+'Top'#2'5'#5'Width'#2'M'#7'Caption'#6#13'eBayAuthToken'#5'Color'#7#6'clNone'
+#11'ParentColor'#8#0#0#6'TLabel'#6'Label2'#4'Left'#2#16#6'Height'#2#14#3'Top'
+#2'O'#5'Width'#2#30#7'Caption'#6#5'AppId'#5'Color'#7#6'clNone'#11'ParentColo'
+'r'#8#0#0#6'TLabel'#6'Label3'#4'Left'#2#16#6'Height'#2#14#3'Top'#2'o'#5'Widt'
+'h'#2#30#7'Caption'#6#5'DevId'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#6
+'TLabel'#6'Label4'#4'Left'#2#16#6'Height'#2#14#3'Top'#3#144#0#5'Width'#2'-'#7
+'Caption'#6#8'AuthCert'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#6'TBevel'
+#6'Bevel1'#4'Left'#2#10#6'Height'#3#170#0#3'Top'#2#4#5'Width'#3'|'#1#7'Ancho'
+'rs'#11#5'akTop'#6'akLeft'#7'akRight'#0#0#0#7'TButton'#7'Button1'#4'Left'#3
+' '#1#6'Height'#2#25#3'Top'#2#8#5'Width'#2'c'#25'BorderSpacing.InnerBorder'#2
+#4#7'Caption'#6#13'GetCategories'#7'OnClick'#7#12'Button1Click'#8'TabOrder'#2
+#0#7'Visible'#8#0#0#7'TButton'#7'Button3'#4'Left'#2#16#6'Height'#2#25#3'Top'
+#2#8#5'Width'#3#136#0#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#18'GetP'
+'opularKeywords'#7'OnClick'#7#12'Button3Click'#8'TabOrder'#2#1#0#0#5'TEdit'
+#16'edteBayAuthToken'#4'Left'#2'`'#6'Height'#2#23#3'Top'#2'0'#5'Width'#3' '#1
+#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#8'TabOrder'#2#2#0#0#5'TEdit'#8
+'edtAppId'#4'Left'#2'`'#6'Height'#2#23#3'Top'#2'M'#5'Width'#3' '#1#7'Anchors'
+#11#5'akTop'#6'akLeft'#7'akRight'#0#8'TabOrder'#2#3#0#0#5'TEdit'#8'edtDevId'
+#4'Left'#2'`'#6'Height'#2#23#3'Top'#2'l'#5'Width'#3' '#1#7'Anchors'#11#5'akT'
+'op'#6'akLeft'#7'akRight'#0#8'TabOrder'#2#4#0#0#5'TEdit'#11'edtAuthCert'#4'L'
+'eft'#2'`'#6'Height'#2#23#3'Top'#3#136#0#5'Width'#3' '#1#7'Anchors'#11#5'akT'
+'op'#6'akLeft'#7'akRight'#0#8'TabOrder'#2#5#0#0#0#9'TTreeView'#6'trvOut'#6'H'
+'eight'#3#204#0#3'Top'#3#184#0#5'Width'#3#144#1#5'Align'#7#8'alClient'#17'De'
+'faultItemHeight'#2#15#8'TabOrder'#2#1#0#0#0
]);

View File

@ -0,0 +1,182 @@
unit umain;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, ExtCtrls,
Buttons, StdCtrls, ComCtrls;
type
{ TForm1 }
TForm1 = class(TForm)
Bevel1: TBevel;
Button1: TButton;
Button3: TButton;
edteBayAuthToken: TEdit;
edtAppId: TEdit;
edtDevId: TEdit;
edtAuthCert: TEdit;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Panel1: TPanel;
trvOut: TTreeView;
procedure Button1Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
uses TypInfo, StrUtils,
httpsend, ssl_openssl,
service_intf, soap_formatter, base_service_intf, base_soap_formatter,
ebay, ebay_proxy,
synapse_http_protocol;
{ TForm1 }
procedure TForm1.Button1Click(Sender: TObject);
var
locService : IeBayAPIInterfaceService;
locHdr : TCustomSecurityHeaderType;
r : TGetCategoriesRequestType;
rsp : TGetCategoriesResponseType;
begin
try
r := nil;
rsp := nil;
locHdr := TCustomSecurityHeaderType.Create();
try
locHdr.eBayAuthToken := edteBayAuthToken.Text;
locHdr.Credentials.AppId := edtAppId.Text;
locHdr.Credentials.DevId := edtDevId.Text;
locHdr.Credentials.AuthCert := edtAuthCert.Text;
locService := TeBayAPIInterfaceService_Proxy.Create(
'eBayAPIInterfaceService',
'SOAP:Style=Document;EncodingStyle=Litteral;UniqueAddress=false',
'http:Address=https://api.sandbox.ebay.com/wsapi'
);
(locService as ICallContext).AddHeader(locHdr,True);
r := TGetCategoriesRequestType.Create();
r.Version := sEBAY_VERSION;
locService.GetCategories(r,rsp);
if Assigned(rsp) then
ShowMessageFmt('CategoryCount=%d; Message=%s; Version = %s',[rsp.CategoryCount,rsp.Message,rsp.Version])
else
ShowMessage('rsp = nil');
finally
r.Free();
rsp.Free();
end;
except
on e : ESOAPException do begin
ShowMessageFmt('SOAP EXCEPTION Code : "%s"; String = "%s"',[e.FaultCode,e.FaultString]);
end;
end;
end;
procedure TForm1.Button3Click(Sender: TObject);
procedure ShowResponse(ARsp : TGetPopularKeywordsResponseType);
var
nd, an, nn, pn : TTreeNode;
k : Integer;
ci : TCategoryType;
begin
trvOut.BeginUpdate();
try
trvOut.Items.Clear();
if not Assigned(ARsp) then
Exit;
nd := trvOut.Items.AddChild(nil,'Response');
trvOut.Items.AddChild(nd,'Ack = ' + GetEnumName(TypeInfo(TAckCodeType),Ord(ARsp.Ack)));
trvOut.Items.AddChild(nd,'Version = ' + ARsp.Version);
trvOut.Items.AddChild(nd,'HasMore = ' + IfThen(ARsp.HasMore,'True','False'));
pn := trvOut.Items.AddChild(nd,'PaginationResult');
trvOut.Items.AddChild(pn,'TotalNumberOfEntries = ' + IntToStr(ARsp.PaginationResult.TotalNumberOfEntries));
trvOut.Items.AddChild(pn,'TotalNumberOfPages = ' + IntToStr(ARsp.PaginationResult.TotalNumberOfPages));
an := trvOut.Items.AddChild(nd,'CategoryArray ( ' + IntToStr(ARsp.CategoryArray.Length) + ')');
for k := 0 to Pred(ARsp.CategoryArray.Length) do begin
ci := ARsp.CategoryArray[k];
nn := trvOut.Items.AddChild(an,'Category ( ' + IntToStr(k) + ' )');
trvOut.Items.AddChild(nn,'CategoryID = ' + ci.CategoryID);
trvOut.Items.AddChild(nn,'CategoryParentID = ' + ci.CategoryParentID);
trvOut.Items.AddChild(nn,'Keywords = ' + ci.Keywords);
end;
finally
trvOut.EndUpdate();
end;
end;
var
locService : IeBayAPIInterfaceService;
locHdr : TCustomSecurityHeaderType;
r : TGetPopularKeywordsRequestType;
rsp : TGetPopularKeywordsResponseType;
kpCrs : TCursor;
begin
try
r := nil;
rsp := nil;
kpCrs := Screen.Cursor;
locHdr := TCustomSecurityHeaderType.Create();
try
Screen.Cursor := crHourGlass;
locHdr.eBayAuthToken := edteBayAuthToken.Text;
locHdr.Credentials.AppId := edtAppId.Text;
locHdr.Credentials.DevId := edtDevId.Text;
locHdr.Credentials.AuthCert := edtAuthCert.Text;
locService := TeBayAPIInterfaceService_Proxy.Create(
'eBayAPIInterfaceService',
'SOAP:Style=Document;EncodingStyle=Litteral;UniqueAddress=false',
'http:Address=https://api.sandbox.ebay.com/wsapi'
);
(locService as ICallContext).AddHeader(locHdr,True);
r := TGetPopularKeywordsRequestType.Create();
r.Version := sEBAY_VERSION;
r.IncludeChildCategories := True;
locService.GetPopularKeywords(r,rsp);
if Assigned(rsp) then begin
ShowResponse(rsp);
end else begin
ShowMessage('rsp = nil');
end;
finally
Screen.Cursor := kpCrs;
r.Free();
rsp.Free();
end;
except
on e : ESOAPException do begin
ShowMessageFmt('SOAP EXCEPTION Code : "%s"; String = "%s"',[e.FaultCode,e.FaultString]);
end;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
SYNAPSE_RegisterHTTP_Transport();
end;
initialization
{$I umain.lrs}
end.