Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

org.tonicsoft.ebay:ebay-shopping-api

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

org.tonicsoft.ebay:ebay-shopping-api

This Java client enables you to use Java to make API calls in the eBay Shopping API, which is an XML API. This maven build is simply the Apache CXF generated client code for the Shopping API WSDL.

  • 989.0.0
  • Source
  • Maven
  • Socket score

Version published
Maintainers
1
Source

ebay-shopping-api

Build Status

This project is an JAX-WS generated java client for the eBay Shopping API. Use it to avoid the unpleasantries of configuring code generators and the manual downloading of WSDL files etc. This project will not help you create an instance of the generated service interface. For this you must choose a JAX-WS implementation such as Apache CXF or Axis2 etc.

download

Find the latest version of the project in the Maven Central Repository.

usage

For detailed usage help, see the documentation for JAX-WS and your chosen implementation. The eBay Shopping API documentation also needs careful reading to ensure the correct HTTP headers are set. The following is an example of how to create a client and make an API call with Apache CXF. First we create an instance of ShoppingInterface, then we set up a request context so that standard eBay HTTP headers will be added to each call. Note that you need an eBay APP-ID.

    public SimpleItemType getEbayItem(String itemId) {
        GetSingleItemRequestType request = new GetSingleItemRequestType();
        request.setItemID(itemId);
        return buildShoppingApiService().getSingleItem(request).getItem();
    }

    private ShoppingInterface buildShoppingApiService() {
        JaxWsProxyFactoryBean serviceFactory = new JaxWsProxyFactoryBean();
        serviceFactory.setServiceClass(ShoppingInterface.class);
        serviceFactory.setAddress("http://open.api.sandbox.ebay.com/shopping");
        Object port = serviceFactory.create();

        ClientProxy.getClient(port).getOutInterceptors().add(new AbstractSoapInterceptor(PRE_PROTOCOL) {
            @Override
            public void handleMessage(SoapMessage message) throws Fault {
                Map httpHeaders = (Map) message.get(PROTOCOL_HEADERS);
                MessageInfo soapMessageInfo = (MessageInfo) message.get(MessageInfo.class.getName());
                httpHeaders.put(
                        "X-EBAY-API-CALL-NAME",
                        singletonList(soapMessageInfo.getOperation().getName().getLocalPart())
                );
            }
        });

        Map<String, List<String>> headers = new HashMap<>();
        headers.put("X-EBAY-API-APP-ID", singletonList(...));
        headers.put("X-EBAY-API-REQUEST-ENCODING", singletonList("SOAP"));
        headers.put("X-EBAY-API-VERSION", singletonList("989"));
        ClientProxy.getClient(port).getRequestContext().put(PROTOCOL_HEADERS, headers);

        return (ShoppingInterface) port;
    }

To run the above example you will need the core CXF dependencies, org.apache.cxf:cxf-rt-frontend-jaxws:3.1.4 and org.apache.cxf:cxf-rt-transports-http:3.1.4.

  • User guide - Explains how the shopping API works and shows how to make an API call.
  • Making an API call - Details on standard parameters required for every API call.
  • API reference - Detailed documentation for each available API call.
  • Shopping API release notes - find details about what features of the API will be supported by different versions of this project.
  • eBay developers program home - Main site for all resources related to the eBay APIs. Here you can sign up to the eBay Developers Program and gain access to the eBay API.
  • WSDL on which this project is based: http://developer.ebay.com/webservices/VERSION/ShoppingService.wsdl where VERSION is the API version e.g. 989.
  • eBay Trading API SDK - A full featured SDK for the eBay Trading API.

versioning

Major versions are maintained in a one to one correspondance with the versions of releases detailed on the eBay Developer Program website. For example, version 989.0.0 of this project targets version 989 of the eBay shopping API. Subsequent minor or patch versions of this projects (981.0.1, 981.1.0 etc) target the same version of the eBay Shopping API.

FAQs

Package last updated on 04 Mar 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc