AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Probleme mit eBay Api benutzung

Ein Thema von saschab · begonnen am 24. Nov 2003 · letzter Beitrag vom 10. Aug 2006
Antwort Antwort
Seite 1 von 9  1 23     Letzte »    
Benutzerbild von saschab
saschab

Registriert seit: 24. Nov 2003
Ort: Overath
50 Beiträge
 
Delphi 2005 Personal
 
#1

Probleme mit eBay Api benutzung

  Alt 24. Nov 2003, 11:41
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
  Mit Zitat antworten Zitat
WtF

Registriert seit: 24. Nov 2003
Ort: Nähe München
72 Beiträge
 
FreePascal / Lazarus
 
#2

Re: Probleme mit eBay Api benutzung

  Alt 24. Nov 2003, 12:31

Ne du keinen Plan wie du das anstellen kannst,
ich kann die aber den Tip geben die ebay seite zu benutzen
Viel Glück
Werds mir merken @MrSpock
Steffen
Was meinst du als unbeteiligter eigentlich zum Thema Intelligenz ? Keep it real, Respect!
  Mit Zitat antworten Zitat
Benutzerbild von MrSpock
MrSpock
(Co-Admin)

Registriert seit: 7. Jun 2002
Ort: Owingen
5.865 Beiträge
 
Delphi 2010 Professional
 
#3

Re: Probleme mit eBay Api benutzung

  Alt 24. Nov 2003, 12:34
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.
Albert
Live long and prosper


MrSpock
  Mit Zitat antworten Zitat
Benutzerbild von saschab
saschab

Registriert seit: 24. Nov 2003
Ort: Overath
50 Beiträge
 
Delphi 2005 Personal
 
#4

Re: Probleme mit eBay Api benutzung

  Alt 24. Nov 2003, 13:51
@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
  Mit Zitat antworten Zitat
Kamil

Registriert seit: 16. Aug 2002
178 Beiträge
 
#5

Re: Probleme mit eBay Api benutzung

  Alt 24. Nov 2003, 15:54
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.
  Mit Zitat antworten Zitat
scp

Registriert seit: 31. Okt 2003
1.120 Beiträge
 
Delphi 7 Personal
 
#6

Re: Probleme mit eBay Api benutzung

  Alt 24. Nov 2003, 16:33
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.
  Mit Zitat antworten Zitat
Benutzerbild von saschab
saschab

Registriert seit: 24. Nov 2003
Ort: Overath
50 Beiträge
 
Delphi 2005 Personal
 
#7

Re: Probleme mit eBay Api benutzung

  Alt 24. Nov 2003, 19:46
@scp:
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
  Mit Zitat antworten Zitat
scp

Registriert seit: 31. Okt 2003
1.120 Beiträge
 
Delphi 7 Personal
 
#8

Re: Probleme mit eBay Api benutzung

  Alt 24. Nov 2003, 22:55
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.
Angehängte Dateien
Dateityp: rar ebaysdk.rar (308,7 KB, 161x aufgerufen)
  Mit Zitat antworten Zitat
Benutzerbild von saschab
saschab

Registriert seit: 24. Nov 2003
Ort: Overath
50 Beiträge
 
Delphi 2005 Personal
 
#9

Re: Probleme mit eBay Api benutzung

  Alt 25. Nov 2003, 19:32
@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.
Cu Sascha
----------------------------------------------------------------------------
Computer Helfen uns Probleme zu lösen die wir Früher nicht hatten.
  Mit Zitat antworten Zitat
scp

Registriert seit: 31. Okt 2003
1.120 Beiträge
 
Delphi 7 Personal
 
#10

Re: Probleme mit eBay Api benutzung

  Alt 25. Nov 2003, 23:36
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?
  Mit Zitat antworten Zitat
Antwort Antwort
Seite 1 von 9  1 23     Letzte »    


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 07:54 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz