eBay / trading-api-java-sdk

Eclipse Public License 2.0
3 stars 0 forks source link

Trading API Java SDK

Installation Instructions

Please note that upgrades to an SDK should always be done in a test environment and fully tested before used in production.

  1. Download the zip file for the version of the eBay SDK for Java that you are using.

  2. Note the location of the zip file you downloaded, but before extracting the file, create the following folder: C:\eBayJavaSDK.

  3. Within C:\eBayJavaSDK, create an "SDKInstallDir" folder to contain the SDK files. You could name that folder according to the Trading API version of the SDK you are installing. For example, for the SDK for Trading API version 1331, you could name the folder eBayJavaSDK1331.

  4. Go the location of the zip file you downloaded (noted in step 3), and extract the zip file into the SDKInstallDir folder you created in step 4.

  5. To build the SDK, see Building the SDK.(If you're using an Integrated Development Environment (IDE), you do not need to build the SDK, you just need to set the paths to point to the correct libraries and files. See DevEnvReadme for more information for configuring an IDE)


General Information

Development Requirements

Back to top

Post-Installation Configuration

Note:

Modify and run the setenv.bat file as follows:

  1. After upgrading to Apache Ant 1.6.x, or higher, modify the setenv.bat file by adding the bin directory of your ANT installation to the PATH environment variable.
  2. Modify the setenv.bat file so that the JAVA_HOME environmental variable is set to JDK 1.8.x directory.
  3. (Optional) If you have installed Tomcat, set the TOMCAT_HOME environment variable in setenv.bat to the Tomcat location. This step is required only if you wish to run the included JSP samples using Tomcat.
  4. Make sure to run setenv.bat from a command window.

Back to top

SDK-Related Links


Back to top

Usage

Prerequisites

Maven: version 3.5.0 
Java: 8 or higher

Install

Adding dependency:

<dependency>
  <groupId>com.ebay.developer</groupId>
  <artifactId>trading-api-sdkcore</artifactId>
  <version>1.0.0-RELEASE</version>
</dependency>

<dependency>
  <groupId>com.ebay.developer</groupId>
  <artifactId>trading-api-ebaycalls</artifactId>
  <version>1.0.0-RELEASE</version>
</dependency>

<dependency>
  <groupId>com.ebay.developer</groupId>
  <artifactId>trading-api-helper</artifactId>
  <version>1.0.0-RELEASE</version>
</dependency>

Building the SDK

In this section, you will use an ANT project file, build.xml, to do the following:

Note:

To build the SDK, use the following steps:

  1. Review and follow all the steps in the Installation Instructions

  2. In a command window, change the directory to the SDKInstallDir described in the Installation Instructions

  3. In SDKInstallDir, follow the instructions in Post-Installation Configuration to change 'JAVA_HOME' in the 'setenv.bat' file according to your local JDK installation, then run 'setenv.bat' in command line.

  4. In the same command window, in SDKInstallDir/build, run the following command: ant build,
    (for a list of available ant tasks, run: ant help)

  5. When a new WSDL is available, advanced users can use it to update the SDK:

  6. Read the Trading API Release Notes. The Release Notes contain changes for Trading API versions released after your current version. The Release Notes are located at the Trading API Release Notes .

  7. Download the new WSDL(see WSDL Locations) you want to use to SDKInstallDir\source\wsdl folder.

  8. At a command prompt, from ...\SDKInstallDir\build, run the following command:

ant build

Back to top

Documentation


Back to top

Known Issues


Back to top

Included in the eBay SDK for Java


Back to top

WSDL Locations

The WSDL is located at https://developer.ebay.com/webservices/_Version_/ebaySvc.wsdl.

Version in the URL means latest, or it means a numerical version of a WSDL release (see the top of the particular WSDL file).

In the case of Version meaning latest, the WSDL is the latest released version (https://developer.ebay.com/webservices/latest/ebaySvc.wsdl). If Version in the URL means a numerical version of the WSDL, Version is a number (for example, https://developer.ebay.com/webservices/1331/ebaySvc.wsdl).

Hypothetically, if the latest release of the WSDL were 1331, you would find that WSDL version at both https://developer.ebay.com/webservices/latest/ebaySvc.wsdl and at https://developer.ebay.com/webservices/1331/ebaySvc.wsdl.


Back to top

WSDL Updates


Back to top

Supported Client Environments

eBay has tested the eBay SDK for Java using the following client environments:

Note: You can use any integrated development environment (IDE) with the eBay SDK for Java, as long as it supports the above environments.


Back to top

Notes About Logging

Starting with SDK version 687, the eBay SDK uses the Simple Logging Facade for Java (SLF4J), a simple facade for various logging frameworks, e.g. log4j, java.uitl.logging (also referred to as JDK 1.4 logging).

By default, eBay SDK uses log4j as the underlying logging framework. To let log4j work properly, you need to configure log4j beforehand. For example, you can configure log4j in the log4j.properties file and put this file in the classpath of your application (for a sample log4j.properties file, please refer to the SDK sample consoleAddItem, in {SDKRoot}\samples\consoleAddItem\src\main\resources).

If you want to switch to another logging framework such as java.util.logging, you need to remove slf4j-log4j12-1.6.1.jar and log4j-1.2.16.jar from your classpath, then add slf4j-jdk14-1.6.1.jar (in {SDKRoot}\lib\externalLib\optional\slf4j-1.6.1) in your classpath. For details about how to configure java.util.logging, please refer to Java SDK documentation.

For more details about SLF4J, please refer to its official site.

SDK logging can be further configured by setting ApiContext instance accordingly, for example, if you want to disable SOAP payload logging (by default, it is enabled), just call setLogSOAPMessages (false) on the ApiLogging instance (property of ApiContext). For more settings of ApiLogging, please refer to SDK library reference.


Back to top


© 2024 eBay Inc. All rights reserved.