Delphi-PRAXiS
Seite 1 von 3  1 23      

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi Probleme mit eBay Api benutzung (https://www.delphipraxis.net/12268-probleme-mit-ebay-api-benutzung.html)

saschab 24. Nov 2003 11:41


Probleme mit eBay Api benutzung
 
Hallo zusammen,
ich habe probleme mit der Benutzung der eBay.SDK.Api.dll . Und zwar weis ich nicht genau wie ich darauf zugreifen muss bzw. Wie ich die Initalisieren muss.
In der SDK beschreibung steht folgendes :
Zitat:

API Library Design Model
Objects defined in API Library can be divided into two groups:

The eBay.SDK.Model namespace
The eBay.SDK.API Namespace
The eBay.SDK.Model namespace
The namespace eBay.SDK.Model contains the interfaces and classes that describe the eBay data model for the eBay SDK. Five sub-namespaces are defined to hold all objects, components, and data types that are used throughout the SDK:

eBay.SDK.Model.Account: IAccount and its related interfaces and classes.
eBay.SDK.Model.Feedback: IFeedback and its related interfaces and classes.
eBay.SDK.Model.Item: IItem and its related interfaces and classes.
eBay.SDK.Model.Sale: ISale and its related interfaces and classes.
eBay.SDK.Model.User: IUser and its related interfaces and classes.
eBay.SDK.Model.Attributes: IAttribute and its related interfaces and classes.
eBay.SDK.Model.Catalog: IProduct and its related interfaces and classes.
Collection classes have been defined for most data objects using the naming convention:

I[dataObj]Collection
Under this convention, [dataObj] is the data object name. For example, IUserCollection is the collection class for the IUser object.

The eBay.SDK.API Namespace
The namespace eBay.SDK.API contains the interfaces defined for each eBay API Call. Each eBay API is represented by one API call class. These classes are named using the convention:

[apiName]Call
Here [apiName] is the name of the API call for which the class is a wrapper. For example, AddItemCall correponds to the AddItem API call and IGetUserCall represents the GetUser API call. Each API call class implements two interfaces: IAPICall (which is common to all API call classes) and an interface specific to the particular API call.

IAPICall is the base interface that each API call class implements. It defines common properties and methods that are shared by all API call classes. Important properties include: DetailLevel, SiteId, Verb, Timeout, and most importantly ApiCallSession, which supplies API account and eBay account information and manages logging for each API call. You may notice that IAPICall has a method called Execute( ), which sends the composed XML request to eBay, gets the response back, and processes it. You can also override the method FilterRequest( ) to customize the request XML prior to its being sent to eBay and use the FilterResponse( ) method to intercept the response XML right after it is received from eBay.
Each API call class also implements its own interface that defines API properties and methods that are specific to the API it represents. The naming convention for API-specific interfaces is:


I[apiName]Call

For example, IGetFeedbackCall is the API-specific interface for the API call class GetFeedbackCall.
Class GetItemCall, for instance, implements both interface IGetItemCall and IAPICall.

Each I[apiName]Call interface has a "master" method that has the same name as [apiName]. The master method I[apiName]Call.[apiName] makes the actual call to eBay and returns the instantiated object or object collection. For instance, IGetAccountCall has the method GetAccount( ), which actually calls eBay by sending a GetAccount-specific XML request parses the response XML to extract account objects, and returns an IAccount instance. Some APIs contain other helper methods in addition to the usual master API method (e.g., IGetSellerListCall has the GetSellerList( ) method and the GetEntireSellerList( ) method, while the second one retrieves all seller item list by automatically handling the paginations for you).
Und Dann noch dieses hier :
Zitat:

API Library Usage
In order to make an API call, you need to:

1. Construct and configure an IApiSession object.
2. Instantiate an [apiName]Call object (which implements two interfaces: I[apiName]Call and IAPICall).
3. Fill all required fields in the IAPICall interface (one of them is the property "ApiSession").
4. Fill required fields in the I[apiName]Call object.
5. Call the "master" method of the API call object (I[apiName]Call.[apiName]). For example, the master method for IAddItemCall is IAddItemCall.AddItem.

Always use a try..catch construct to capture any exception, especially IAPIException which carries API-specific errors including the "Short Message" and "Long Message" that are defined in eBay API.

iPix support is built into IAddItemCall: all you need to do is to add the path for a photo file to IAddItemCall.PictureFiles, and during the IAddItemCall.AddItem( ) call, the specified images files are automatically uploaded to iPix. You can specify up to six photos for an item.
Und noch ein Beispiel aus der Api :
Zitat:

Adding an Item with the API
Overview
This topic illustrates the minimal steps to use a call to the API function AddItem to list an item on eBay from an eBay SDK application.

The SDK provides classes that are wrappers around API functions. In this particular case, the SDK class AddItemCall is the wrapper class for the API function AddItem. An instance of the Integration Library interface IItem is needed to contain the definition for the new item. This IItem object is used by the AddItemCall object, in its ItemToAdd property. The AddItemCall.AddItem method calls the API function AddItem and sends the item definition in ItemToAdd to eBay as a new item listing.

NOTE: When listing an item entirely using the Integration Library, data for the new item is stored in the Integration Database and synchronized to eBay from the Integration Database through built-in Integration Library class methods (IEBaySession.SaveItem and IEBaySynchronizer.ListItemsToEBay). But when listing an item using the AddItemCall class from the API library, no such local database integration and synchronization is provided. An application can still save the item data to the Integration Database (with IEBaySession.SaveItem), but once there its data must be maintained programmatically by the application. The call to the AddItemCall.AddItem method "synchronizes" to eBay only one item definition per call, and so this must be repeated for each additional new item.


While the source code examples shown here to illustrate the process of submitting an item with AddItemCall are in VB.NET, the same steps need to be performed regardless of the actual programming language used.

There are four simple steps to submitting an item using the API Library. An optional fifth step describes verifying that the item was successfully submitted.

Prerequisite: Import the Applicable Libraries
Step 1: Create an API Call Session
Step 2: Define the Item
Step 3: Create the AddItemCall object
Step 4: Submit the Item to eBay
Optional Step: Verify the Item Submission
Prerequisite: Import the Applicable Libraries
An application that uses the objects and methods described here must reference the libraries in which those objects are defined and the base SDK libraries that support them.

Imports System
Imports System.IO

Imports eBay.SDK
Imports eBay.SDK.API
Imports eBay.SDK.Model
Imports eBay.SDK.Model.Item
Imports eBay.SDK.Integration
Step 1: Create an API Call Session
The first step in submitting a new item to eBay using the AddItemCall class is to create and configure an API call session: an IAPISession object. The API call session object contains such information as the header data for the API call, the URL to which to send the API request, and the user name and password for the seller (the requestor for the call to the API function AddItem). In this example, the IAPISession object is named ApiCallSession and its properties are set here from memory variables.

' Instantiate a new IApiSession object
Dim ApiCallSession As eBay.SDK.API.IApiSession
ApiCallSession = new ApiSession()

' Enable API-XML logging
ApiCallSession.Log = new LogFile();
ApiCallSession.Log.Open("MyLogfile.txt");
ApiCallSession.LogCallXml = true;

' Set environment information
ApiCallSession.Developer = mTxtDeveloperId
ApiCallSession.Application = mTxtApplicationId
ApiCallSession.Certificate = mTxtCertificate

' Set URL for API Call
ApiCallSession.Url = mTxtUrl

' Set requesting user (seller) information
ApiCallSession.RequestUserId = mTxtUser
ApiCallSession.RequestPassword = mTxtUserPass
This step is only required once each time the application is run. However, if multiple users would be using the application, this step would need to be performed each time a different user would act as an item seller.

Step 2: Define the Item
The most verbose step in submitting an item is defining the item itself. This involves setting such item properties as its title, the duration of the listing, and the minimum bid for the item. The item is represented with an IItem object, in the variable item in this example. The first part of this step is creating the IItem object.

' Create the IItem object
Dim item As IItem = New eBay.SDK.Model.Item.Item()

Last, set the item's listing properties.

item.SiteId = SiteIdEnum.US

item.Type = ItemTypes.Auction
item.Title = "The item's title"
item.Description = "The item's description"
item.Currency = CurrencyEnum.USDollar
item.Location = "San Jose, CA"
item.Country = "us"

item.CategoryId = 355

item.Quantity = 1
item.Duration = 5

item.StartPrice = 10.00
item.BuyItNowPrice = 15.00

item.ReservePrice = 0
item.PaymentTerms.SeeDescription = True
item.ShippingOptions.ShippingRange = ShippingRangeEnum.SiteOnly
item.ShippingOptions.ShippingPayment.SeeDescriptio n = True
item.Uuid = New Uuid(True)
This step is required for each new item to be listed.

Step 3: Create the AddItemCall object
The AddItemCall class is a wrapper around the API function AddItem, that lists a new item to eBay. The AddItemCall.ItemToAdd property (which is of type IItem) represents the definition of the new item to list on eBay. Use the IItem object created in Step 2 for the value of the ItemToAdd property.

In this example, the instantiated AddItemCall object is named api.

' Instantiate the AddItemCall object
Dim api As AddItemCall = New AddItemCall(ApiCallSession)
' Insert the item definition from Step 2
api.ItemToAdd = item
' Set the level for returned API error strings
api.ErrorLevel = ErrorLevelEnum.BothShortAndLongErrorStrings
Step 4: Submit the Item to eBay
Once the item has been defined, the AddItemCall object has been created, and the item definition has been inserted into the AddItemCall object, the item is ready to be sent off to eBay. Do this with a call to the AddItemCall.AddItem method. Store the results from the call to AddItem into an IFees object (in this example, named ife).

' Always use a Try..Catch construct to handle API call exceptions.
Try
' IFees is returned with listing fee information.
Dim ife As IFees = api.AddItem()

' If there's an error an exception is thrown.
' So if we get to here, everything is okay.
MsgBox("AddItem succeeded! The new item ID is: " + item.ItemId)
' React to any API exception.
Catch ex As APIException
MsgBox("APIException - AddItem call failed: " + ex.Message)
' React to any general exception.
Catch ex As Exception
MsgBox("Exception - AddItem call failed: " + ex.Message)
End Try
The IFees object that is returned by a successful call to AddItem contains the fees for listing the new item on eBay. Of these fees, the insertion fee is the one that will almost always be a nonzero value (except on the Free Listing Days that eBay occasionally offers). So a nonzero insertion fee (and the lack of any exception) is typically a good indicator that the call was successful and the item was listed on eBay. To check the resulting insertion fee, inspect the value of the IFees.InsertionFee property.

Optional Step: Verify the Item Submission
The ultimate verification that the new item was successfully listed on eBay and all of its properties are correct is to view the item. In the context of an SDK application, this could be a matter of calling the API function GetItem (through use of a GetItemCall object). For information on how to do this, see Retrieving an Item with the API.
Kann mir jemand da vielleicht nen Gedanken anstoss geben wie ich das nach Delphi Portiere sprich Api laden (instazieren) und benutzen.

Vielen Dank schon mal im vorraus.

MFG Sascha

WtF 24. Nov 2003 12:31

Re: Probleme mit eBay Api benutzung
 
:wiejetzt:
Ne du keinen Plan wie du das anstellen kannst,
ich kann die aber den Tip geben die ebay seite zu benutzen :dance:
Viel Glück
Werds mir merken @MrSpock

MrSpock 24. Nov 2003 12:34

Re: Probleme mit eBay Api benutzung
 
Hallo WtF,

zunächst einmal herzlich willkommen im Delphi-Praxis Forum.

Eine Bitte für zukünftige Postings: wenn du zu einer Lösung nicht beitragen kannst, hilft ein Kommentar, der genau dies ausdrückt, ja nicht wirklich weiter. Deshalb werden solche Postings ungern gesehen.

saschab 24. Nov 2003 13:51

Re: Probleme mit eBay Api benutzung
 
@WtF:
Danke für die Antwort :-) So schlau bin ich auch schon nur leider sind auf developer.ebay.com Seite nur Beispiele für .NET C++ VB Java und keine für Delphi. Meine Anwendung die das benutzen soll ist halt in Delphi geschrieben. Ich brauche nur einen kleinen anstoß wie das alles Instanziert wird.

@MrSpock:
Danke

Cu Sascha

Kamil 24. Nov 2003 15:54

Re: Probleme mit eBay Api benutzung
 
Ich kenne mich mit der eBay API nicht aus. Wenn es sich um einen Webservice wie bei der Google API handelt, dann sollte dir http://www.tutorials.delphi-source.d...nt/index.shtml helfen.

scp 24. Nov 2003 16:33

Re: Probleme mit eBay Api benutzung
 
Zum einen musst du erst mal die RegSDK.bat im eBay\SDK Ordner ausführen. Eventuell musst du noch in die .bat als erste Zeile folgendes eintragen:
Code:
PATH %PATH%;C:\WINNT\Microsoft.NET\Framework\v1.0.3705
Wobei du den Ordner dementsprechend ändern musst, wo bei dier die regasm.exe zu finden ist.

Dann musst du in Delphi auf Komponente -> ActiveX importieren... gehen und die "EPSControl 1.0 Type Library" installieren.
Ausserdem musst du noch auf Projekt -> Typenbiblitohek importieren... gehen und die Einträge, die mit eBay_SDK anfangen importieren.

Leider müssen danach noch einige Korrekturen an den importierten Units vorgenommen werden, was alles gemacht werden muss, bin ich selber noch am rausfinden.

saschab 24. Nov 2003 19:46

Re: Probleme mit eBay Api benutzung
 
@scp: :thuimb:
Danke erstmal für die erklärung, habe das gerade mal ausprobiert bekomme aber nen haufen Fehlermeldungen von der RegSDK.bat. Werde das morgen mal genauer untersuchen.

Cu Sascha

scp 24. Nov 2003 22:55

Re: Probleme mit eBay Api benutzung
 
Liste der Anhänge anzeigen (Anzahl: 1)
Bin mittlerweile schon weiter:

Im Anhang ist ein Archiv mit einer kleinen Demo-App, ein Package, welches die eBay SDK in Delphi installiert und die dazugehörigen, veränderten Import Units.
Ausserdem ist auch eine veränderte RegSDK.bat dabei.

Zu der Demo noch was: Ich komme damit schon soweit, das er die eingegeben Daten für eine neu einzustellende Auktion akzeptiert und mit der Anmeldung beim Server losklegt. Allerdings sagt er derzeit noch, das meine eBay-Name ungültig wäre, obwohl ich mich ordnungsgemäss als Developer angemeldet hab. Das heisst, es stimmt irgendwas mit IApiSession bzw. TApiSession noch nicht.

saschab 25. Nov 2003 19:32

Re: Probleme mit eBay Api benutzung
 
@scp:
erst mal danke für das Archiv, nur leider krieg ich das trozdem nicht so ganz installiert wo muss ich die Dateien aus dem Verzeichnis IMPORTS aus dem Rar archiv von dir hinkopieren. Wenn ich unter delphi versuche die Typenbibliothek zu installieren meldet er mir nen fehler Typ byte nicht genügend deklariert. Und die RegSDK.Bat zickt auch noch rum. Na mal weiter probieren.

scp 25. Nov 2003 23:36

Re: Probleme mit eBay Api benutzung
 
Die .bat muss natürlich in den Ordner der eBay SDK.
Die Dateien im Ordner IMPORTS müssen im Delphi-Ordner unter dem gleichnamigen Unterordner IMPORTS abgelegt werden.
Der Fehler mit dem Typ Byte usw. liegt in der mscorlib_TLB.pas, wenn der erscheint bedeutet das wohl, das du die Datei schonmal selbst importiert hast. Aber wie gesagt, wenn du die IMPORTS kopiert hast (nicht verschieben!), dann werden deine alten Importe von der eBay SDK ja eh überschrieben und es müsste gehen.

PS:
Was für Fehler meldet die .bat denn? Sie zeigt immer Meldungen an, aber weisst du das es Fehler sind, oder hast du den Text nur so "vorbeifliegen" sehen?

horst 26. Nov 2003 00:07

Re: Probleme mit eBay Api benutzung
 
hallo...
sehr interessant...habe die komponente auch installiert.
was muss ich den eintragen bei:

Code:
Developer ID:
Application ID:
Certificate:
hast du diese komponente selber erstellt?

grüße horst

scp 26. Nov 2003 00:22

Re: Probleme mit eBay Api benutzung
 
Die Komponente(n) habe ich nicht selber erstellt, das macht er bei dem Import.

Nur das Demo ist von mir.

Delphi-Quellcode:
was muss ich den eintragen bei:

Code:
Developer ID:
Application ID:
Certificate:
Hmmmm... wenn du das nicht weisst, dan Frage ich mich, woher du die SDK hast? Und ob ich hier dann überhaupt noch weitermache.

Mach erst mal das:
http://developer.ebay.com/DevProgram...rship/join.asp

Dann weist du auch was die drei Dinger zu bedeuten haben.

PS: Eine Individual Tier Mitgliedschaft kostet nix, man muss nur ner Menge Agreements zustimmen und einen gültigen eBay Account besitzen.

horst 26. Nov 2003 00:25

Re: Probleme mit eBay Api benutzung
 
hi...ich habe kein sdk.
ich finden das thema lediglich interessant und möchte etwas darüber erfahren.
deshalb habe ich gefragt.
ich bin dumm und weiss überhaupt nichts.
deinen link habe ich auch schon vorher gesehen und bin nicht schlau daraus geworden.
ebay user in ich schon, für mehr reicht meon englisch nicht.
will dennoch was dazu lernen.

scp 26. Nov 2003 00:31

Re: Probleme mit eBay Api benutzung
 
ups... hab garnicht auf den Namen geguckt :oops:

@horst

Leider muss man das Prozedre der Dev-Anmeldung bei eBay trotzdem machen, auch wenn man mal nur gucken will. Allerdings würde ich das eh erstmal lassen, es ei denn du hast vor, dir ne Menge Arbeit zu machen :-)
Ich bin zwar gut in Delphi, aber diese eBay SDK ist schon ein Brocken, na ja die Hälfte ist ja jetzt schonmal geschafft.

horst 26. Nov 2003 00:37

Re: Probleme mit eBay Api benutzung
 
was macht dein demo-programm...
welches bei der komponente ist?

saschab 26. Nov 2003 07:40

Re: Probleme mit eBay Api benutzung
 
@scp:
Habe es hinbekommen habe jetzt die Ganzen Komponenten Importiert er meckerte zwar wegen ner Compilerdirektive die er angeblich nicht kennt, aber wie man weis ist wener manchmal mehr :-) Rausgeworfen un dann gings. :lol:
Ich werde mich heute mal daran versuchen die Api zu8 Programmieren und zu verstehen. :( Wobei ich denke letzteres ist das schwerste daran. Die SDK hilfe ist auch nicht gerade der Brüller. Tja eBay Halt :angle: Dein Demoprogramm ist auf jeden Fall sehr hilfreich thx. Wäre gut wenn wir hier so mit und mit einen Erfahrungsaustausch betreieben werden bis das wir beide den "BROCKEN" verstanden haben.

@horst:
Das Demoprogramm von scp versucht einen Artikel in der eBay sandbox einzustellen. Die ID´s nach denen Du gefragt hast sind ID´s die man von Ebay bekommt wenn man sich als Developer anmeldet. Die Sandbox ist eine Testumgebung von eBay für Developer die ein komplettes Ebay beinhaltet (online) da kann man mit der ebay.sdk.api rumfummeln versuchen Artikel einzustellen u.s.w und genau das versuchen scp und ich hinzubekommen.

Hoffe die erklärung dient zum besseren Verständnis. Ach ja ohne diese ID´s kannst Du mit dem Programm von scp nichts anfangen. Anhand dieser ID´s werden auch die Kosten durch zugriffe auf die API zugeordnet und abgerechnet. Deshalb wird Dir die auch keiner geben sorry. Ist nicht bös gemeint.

Alles weitere kannst du wie oben schon erwänt auf eBay Developer Forum

:duck:

horst 26. Nov 2003 09:19

Re: Probleme mit eBay Api benutzung
 
ja super...
mit diesen infos kann ich leben.
logisch das mir niemand diese id geben kann :spin2:

grüße horst

scp 26. Nov 2003 12:15

Re: Probleme mit eBay Api benutzung
 
@saschab
na, das ist doch schonmal was. Ich hab übrigens mal aus Spass das VB-Demo getestet, da passiert das gleiche, er akzeptiert irgendwie meinen eBay-Namen nicht.
Dass heisst dann wohl zum einen, das ich die SDK unter Delphi korrekt umgeschrieben hab, zum anderen muss ich jetzt rausfinden, ob ich irgendwie meinen eBay-Namen noch aktivieren muss. Vielleicht akzeptiert er auch den Punkt in meinem Namen nicht, obwohl er den im Original-eBay nimmt.

saschab 26. Nov 2003 23:01

Re: Probleme mit eBay Api benutzung
 
@horst:
Freut mich das ich Dir helfen konnte.

@scp:
Du musst Dich unter http://sandbox.ebay.com ganz normal einen Ebay benutzer anlegen. Bei mir war es nur so das ich das Ding nicht dazu bewegen konnte eine Deutsche (meine) Adresse zu benutzen so wohne ich jetzt für die Sandbox in Sydney :-D.
Ich habe gerade mal Dein testproggie angeworfen :
Kleiner Statusbericht :
Bein Drücken des Go Buttons akzepiert er meine UserID und Passwort (bei falschem meckert er) :-D -> Dies müssen die daten sein die bei o.g. Registration angegeben hast nicht die Daten deines Real eBay Accounts. Nach einem moment bekomme ich dann aber Trozdem ne Fehlermeldung, und zwar folgende in einem Fenster ->

---------------------------
ebay
---------------------------
EOleException: Internal error to the application
---------------------------
OK
--------------------------- :cry:

Also weiter suchen, ich werde mal sehen ob ich den Fehler finden Kann. Trozdem ist Dein Proggie echt interressant zum verstehen der Abläufe.
Werd mir jetzt erst mal nen Bier holen zum Denken :cheers:

saschab 27. Nov 2003 00:13

Re: Probleme mit eBay Api benutzung
 
@scp:
Hi,
so ich glaube ich weis jetzt woran es liegt :-D
und zwar habe ich folgendes festgestellt, ich habe die Quelltextzeilen

Code:
eBayItem1.SiteId := SiteIdEnum_US;
eBayItem1.Currency := CurrencyEnum_USDollar;
abgeändert da es ja in der sandbox Umgebung das Amerikanische eBay ist. Ich bekomme dann die Fehlermeldung :
Zitat:

---------------------------
ebay
---------------------------
EOleException: We're sorry, but before you list an item, you must create a seller's account by submitting a valid credit card through our secure form
---------------------------
OK
---------------------------
Habe darufhin mal versucht per Hand einen Artikel in der sandbox einzustellen, und siehe da bevor ich was einstellen kann verlangt das Amerikanische ebay anscheinend die Kreditkarteninformationen des verkäufers diurch ein Secure Form einzugeben. Nur leider funktioniert diese Anmeldung z.Zt. nicht wie so vieles in der sandbox. Ich schätze mal wenn man in die Produktivumgebung schaltet (andere ebay Api URL) funtioniert das ganze. Weist du vielleicht wie man die UUid für ein Item erzeugt?

Zitat:

Item.Uuid Property A globally unique identifier for the the item. This field is used by an application to avoid accidental double listing.

public eBay.SDK.Model.IUuid Uuid {get; set;}

Implements
IItem.Uuid
Hoffe das wir damit auf dem richtigen weg sind. Werde morgen nochmal versuchen die Kreditkarteninformationen einzugeben.
Gehe jetzt erst mal heiabubu machen :hi:

scp 27. Nov 2003 01:02

Re: Probleme mit eBay Api benutzung
 
Eine UUID wird automatisch erstellt. Wenn du eine neue haben willst, brauchste nur das hier machen:
Delphi-Quellcode:
  eBayItem1.Uuid.NewGuid;
Um die UUID als string zu bekommen, z.B.:
Delphi-Quellcode:
  ShowMessage(eBayItem1.Uuid.ToString);
Da hast du ja schon ein paar Sachen rausgefunden, gut das ich das mit der Currency und der Anmeldung jetzt weis, das mit der Creditcard Sache ist natürlich doof.

saschab 27. Nov 2003 10:02

Re: Probleme mit eBay Api benutzung
 
@scp:
Ui stimmt hätte ich ja auch selbst drauf kommen können mit der Uuid, war anscheinen schon was Spät gestern :)
Das mit der Anmeldung werde ich nacher nochmal probieren, ansonnsten bekommen die developer Admins von eBay ne Mail von mir :mrgreen:

saschab 1. Dez 2003 09:30

Re: Probleme mit eBay Api benutzung
 
@SCP:
Hi,
habe es geschafft :-D :-D
also Du musst als erstes unter sandbox.ebay.com einen Testuser anlegen. Danach erzeugst Du in Deinem Delphiprogramm einen ValidateTestUserRegistrationCall, diesen sendest Du mit dem angelegten Usernamen und Passwort ab. Danach kannst Du Items einstellen.
Hier der Quelltext :
Code:
procedure Tfrm_ebay_test_suite.btn_validate_test_userClick(
  Sender: TObject);
var
  callSession : IApiSession;
  vc : IValidateTestUserRegistrationCall;
begin
  callSession := CoApiSession.Create;
  callSession.Developer := ed_devid.Text;
  callSession.Application := ed_appid.Text;
  callSession.Certificate := ed_certid.Text;
  callSession.RequestUserId := ed_ebay_userid.Text;
  callSession.RequestPassword := ed_ebay_pass.Text;
  callSession.Url := ed_ebay_apiurl.Text;
  ShowMessage('CallSession Created !');

  ApiSession1.ConnectTo(callSession);

  vc := CoValidateTestUserRegistrationCall.Create;
  ValidateTestUserRegistrationCall1.ConnectTo(vc);

  ApiCall1.ConnectTo(ValidateTestUserRegistrationCall1.APICall);
  ApiCall1.ApiCallSession := ApiSession1.DefaultInterface;

  try
    ValidateTestUserRegistrationCall1.ValidateTestUserRegistration;
  except
    on E: EOleException do
      Showmessage(e.ClassName + ': ' + E.Message);
    else
      raise;
  end;
  ShowMessage('Done !!!!');
end;
Danach kannst Du Mit einem AddItemCall Items einstellen.
Ach ja bei Dir im Programm fehlte noch die Akzepierte Bezahlmethode und die UUid:
Code:
  eBayItem1.Uuid.NewGuid;
  eBayItem1.PaymentTerms.Set_VisaMaster(True);

scp 1. Dez 2003 17:00

Re: Probleme mit eBay Api benutzung
 
Cool!!! Es funzt tatsächlich. Nicht schlecht. :-D

saschab 3. Dez 2003 13:29

Re: Probleme mit eBay Api benutzung
 
@scp: Jep finde ich auch Cool, hast Du vielleicht ne Ahnung wie ich eine Item.Discription dazu bewegen kann eine HTML Seite anzuzeigen (wie Bei einstellung von hand das ich den Quelltext an eBay übergebe? :gruebel:

scp 3. Dez 2003 16:40

Re: Probleme mit eBay Api benutzung
 
Evtl. über ne Stringlist:

Delphi-Quellcode:
var
  StrList : TStringList;

//...

StrList := TStringList.Create;
try
  StrList.LoadFromFile('C:\irgendeine.htm');
  Item.Description := StrList.Text;
finally
  StrList.Free;
end;

saschab 3. Dez 2003 22:43

Re: Probleme mit eBay Api benutzung
 
@scp:
Yep, genau so geht's :-D so nü hab ich fast alles zusammen was ich für mein Proggy brauche. Muss mich jetzt mal mit den Categorien befassen (auslesen, setzen u.s.w) hast Du vielleicht schon damit erfahrungen gemacht ?
Ach ja weist Du vielleicht wie das mit den Bildereinstellen geht in der SDK Hilfe steht was von wegen in ein String Array schreiben. Würde gerne ein Bild von meinem Rechner nehmen un zur Auktion stellen nur wie kapier ich noch nicht ganz ? Ne Idee vielleicht ?

scp 6. Dez 2003 15:54

Re: Probleme mit eBay Api benutzung
 
So, habe mal mein Beispiel korrigiert und erweitert. Wer sich damit ausser uns beiden beschäftigen will, hat somit jetzt ne ganz gute Grundlage, ohne gross rumprobieren zu müssen.

eBay SDK Erweiterung für Delphi

saschab 7. Dez 2003 08:26

Re: Probleme mit eBay Api benutzung
 
@scp: Hi, hast Du schon was rausbekommen wie man die Categorien von Ebay laden kann oder ein Bild einstellen kann ? Ach ja habe gerade mal ganz kurz Dein neues Sample probiert da ist noch irgendein Fehler Drinne das Läuft nicht bei mir :-(

scp 7. Dez 2003 11:57

Re: Probleme mit eBay Api benutzung
 
Etwa so:
Delphi-Quellcode:
var
  callSession : IApiSession;
  gcc : IGetCategoriesCall;
  acc : ICategoryCollection;
  i:integer;
begin
  callSession := CoApiSession.Create;
  callSession.Developer := actForm.DevId.Text;
  callSession.Application := actForm.AppId.Text;
  callSession.Certificate := actForm.CertId.Text;
  callSession.RequestUserId := actForm.UserId.Text;
  callSession.RequestPassword := actForm.UserPwd.Text;
  callSession.Url := actForm.ServerUrl.Text;
  ShowMessage('CallSession Created !');

  ApiSession1.ConnectTo(callSession);

  gcc := CoGetCategoriesCall.Create;
  GetCategoriesCall1.ConnectTo(gcc);

  ApiCall1.ConnectTo(GetCategoriesCall1.APICall);
  ApiCall1.ApiCallSession := ApiSession1.DefaultInterface;

  try
    acc := GetCategoriesCall1.GetCategories;
    ItemForm.mTxtCategory.Items.Clear;
    for i := 0 to acc.ItemCount-1 do
      ItemForm.mTxtCategory.Items.AddObject(acc.Item[i].CategoryName, TObject(acc.Item[i].CategoryId));
  except
    on E: EOleException do
      Showmessage(e.ClassName + ': ' + E.Message);
    else
      raise;
  end;
  ShowMessage('Done !!!!');

end;
Jetzt muss man nur noch die Baumstruktur der Kategorien wiederherstellen.

scp 7. Dez 2003 15:47

Re: Probleme mit eBay Api benutzung
 
Was für ein Fehler kommt den bei dem Beispiel-Programm?

saschab 7. Dez 2003 20:35

Re: Probleme mit eBay Api benutzung
 
@scp:
Er meckert bei diesen beiden Zeilen das er auf eine nur lesen Eigenschaft nix zuweisen kann !
Code:
ac.ItemToAdd := item;
acbase.ApiCallSession := callSession;
Aber egal bei meinem Proggie meckert er nicht habe die Zeilen umgeschrieben :-)

Weist Du denn wie das mit den Bildern funktioniert ? Ich schmeiss den Rechner bald zu Fenster raus :wall:

scp 7. Dez 2003 21:29

Re: Probleme mit eBay Api benutzung
 
Achso, dann hast du wahrscheinlich ne andere Version der Import-Lib, hatte meine so umgestrickt, das die Eigenschaften nicht "Nur lesen" sind.

Das mit den Bildern müsste im VB-Beispiel stehen, guck dir die Files einfach mal mit nem Editor an. Das mit den Kategorien reicht mir erst mal, mit den Bildern guck ich die Tage mal.

PS: In meinem jetztigen Beispiel hab ich das eintragen der Kategorien in einen Treeview und das speichern in einer Datei eingebaut. Dauert ja schon ziemlich lange, das laden der Kategorien.
Klickt man auf einen Eintrag im Treeview, wird die Numer automatisch in die Combo der "Category ID" eingetragen.

scp 8. Dez 2003 09:13

Re: Probleme mit eBay Api benutzung
 
Ist gar nicht so viel, hab ich grad gesehen:

Delphi-Quellcode:
  ac.ItemToAdd := item;

  for i := 0 to itemForm.mLBPictures.Items.Count-1 do
    ac.PictureFiles.Add(itemForm.mLBPictures.Items[i]);
mLBPictures ist einfach eine ListBox, die die Dateinamen der Bilder enthält.

00data 14. Dez 2003 18:54

Re: Probleme mit eBay Api benutzung
 
Hi,
ich benutze die Api ebenfalls unter Delphi und komme damit auch ganz gut klar. Jetzt habe ich nur folgendes Problem.
Ich möchte mir meine beendetetn Auktionen anzeigen lassen und denke, dass dies mit ISaleCollection realisiert wird.
Leider kann man in der Sandbox keine Artikel kaufen. :wall:
Also wie soll man das testen?

Gruß
Timo

scp 15. Dez 2003 06:08

Re: Probleme mit eBay Api benutzung
 
Wie kommst du darauf, das man nicht bieten kann, ich habe gestern einen "test name" für 9999$ ersteigert :-)

00data 15. Dez 2003 12:48

Re: Probleme mit eBay Api benutzung
 
Ich gehe auf http://cgi.sandbox.ebay.com/
Bei allem was ich dort mache, bekomme ich folgende Meldung:

This function is currently unavailable
We apologize that you are not able to access this feature at the present time. Our Technical Support Team has been notified and we are working on resolving this difficulty as quickly as possible.

Please visit the eBay Announcements Board for updates on recent and upcoming changes, major system issues, and other important eBay news.

http://www2.ebay.com/aw/announce.shtml

scp 18. Dez 2003 00:17

Re: Probleme mit eBay Api benutzung
 
@00data

Ich bekomme diese Meldung zwar auch oft, aber nicht immer. Kann in "Mein eBay" fast problemlos umherklicken, kann nach sachen suchen usw. Ich weis nich, obs wichtig ist, aber ich gehe auf http://sandbox.ebay.com/, also ohne das cgi.

00data 19. Dez 2003 09:04

Re: Probleme mit eBay Api benutzung
 
Ja Du hast recht. Ab und zu geht es. Naja - zum testen reicht es.
Hast Du Dich schonmal damit befasst, beendete Auktionen (verkaufte Artikel) über die API anzeigen zu lassen?

Michel 28. Dez 2003 09:34

Re: Probleme mit eBay Api benutzung
 
Hallo zusammen,
nachdem ich diesen Thread zig mal rauf und runter gelesen habe, an einem Netscape Problem beim Anmelden bei developer.ebay.com fast verzweifelt bin, laufen bei mir endlich einige Beispielprogramme der eBay Sdk (EbaySales.exe und SimpleList aus dem cpp Bsp. aktzeptieren mich zumindest als Sandbox-User).
Ich arbeite unter Win2K (SP4) mit Delphi 6 Prof (ohne SP'S) und habe mir das Archiv von SCP (VIELEN DANK) vom 06.12.03 installiert.

Nun meine Fräge(n):

1. Was bedeutet die Compiler-Direktive {$VARPROPSETTER ON}. Mein Delphi kennt die nicht. Habe ich erst mal weg kommentiert. Können die ganz weg?

2. Beim Aufruf von <callSession := CoApiSession.Create> in EBayU.pas tritt eine Exception EOleSysError 'Klasse nicht registriert' auf. Die REGSDK.BAT von SCP lief ohne zu meckern. Habe gleich überall PAUSE(n) eingebaut, da ich mich mit dem .NET Zeug noch nicht auskenne.

Für jeden Tip dankbar
Michael (Umsteiger von C++ nach Delphi)


Alle Zeitangaben in WEZ +1. Es ist jetzt 12:32 Uhr.
Seite 1 von 3  1 23      

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz