Skip to main content
Published: August 05 2007, 9:07:00 PMUpdated: November 28 2020, 3:53:43 PM

Is there any sample code for GetSingleItem in C# using SOAP?

Shopping API - SOAP GetSingleItem sample in C#

Summary

SOAP GetSingleItem sample in C# using Shopping API using Visual Studio .NET 2003


Detailed Description

The attached command line sample project contains an implementation of the GetSingleItem Shopping API call.

Here is the main code snippet showing the actual use of this call contained in the attached sample project:

  // create a new service
  Shopping svc = new Shopping();
  // set the URL and it's parameters
  // Note: Since this is a demo appid, it is very critical to replace the appid with yours to ensure the proper servicing of your application.
  svc.Url = "http://open.api.ebay.com/shopping?appid=eBayAPID-73f4-45f2-b9a3-c8f6388b38d8&version=523&siteid=0&callname=GetSingleItem&responseencoding=SOAP&requestencoding=SOAP";
  // create a new request type
  GetSingleItemRequestType request = new GetSingleItemRequestType();
  // put in your own item number
  request.ItemID = "280140869222";
  // we will request Details
  // for IncludeSelector reference see
  // http://developer.ebay.com/DevZone/shopping/docs/CallRef/GetSingleItem.html#detailControls
  request.IncludeSelector = "Details";
  // create a new response type
  GetSingleItemResponseType response = new GetSingleItemResponseType();
  try
  {
    // make the call
    response = svc.GetSingleItem(request);
  }
  catch (Exception ex)
  {
    // catch generic exception
    Console.WriteLine(ex.Message);
  }
  // output some of the data
  Console.WriteLine(response.Item.ItemID);


Version Info

The attached project is based on the following versions:

Shopping API version 523
Visual Studio .NET 2003



Additional Resources

How well did this answer your question?
Answers others found helpful