2 min read

Google Search: ebay asp.net api soap wsdl [part deux]

Paul Kinlan

Paul Kinlan

Lead of Chrome DevRel

Just following on from one of my previous post about using SOAP requests from ASP.Net to access Ebay.

I have finally worked out [it wasn't hard in the end] how to do it.

A few things that I had problems with were:

  • Most of the request REQUIRE the version attribute to be set
  • The DetailLevel attribute must be set on some request to enable you to
  • A Authentication Token is required to send request to Ebay. The Authentication token is used so that the user doesn't need to give their user name and password credentials away to the program. The auth token seems to be a cryptographic hash.
  • If you are using the WSDL url, you must also provide query string parameters so that Ebay know what to do with the request. [http://developer.ebay.com/DevZone/SOAP/docs/WebHelp/wwhelp/wwhimpl/js/html/wwhelp.htm]
The Code Follows:

Ebay.eBayAPIInterfaceService service = new Ebay.eBayAPIInterfaceService();string appId = "APPID"; // use your app IDstring devId = "DEVID"; // use your dev IDstring certId = "CERTID"; // use your cert IDstring endpoint = "https://api.sandbox.ebay.com/wsapi";string callName = "GetSearchResults";string siteId = "0";

string version = "437";// Build the request URLstring requestURL = endpoint+ "?callname=" + callName+ "&siteid=" + siteId+ "&appid=" + appId+ "&version=" + version+ "&routing=default";// Create the service

// Assign the request URL to the service locator.service.Url = requestURL; //"https://api.sandbox.ebay.com/wsapi";// Set credentialsservice.RequesterCredentials = new Ebay.CustomSecurityHeaderType();

service.RequesterCredentials.eBayAuthToken = "MY_TOKEN"; // use your tokenservice.RequesterCredentials.Credentials = new Ebay.UserIdPasswordType();

service.RequesterCredentials.Credentials.AppId = appId;service.RequesterCredentials.Credentials.DevId = devId;service.RequesterCredentials.Credentials.AuthCert = certId;

Ebay.GetSearchResultsRequestType req = new Ebay.GetSearchResultsRequestType();

req.Query = "SSX";req.DetailLevel = new Ebay_Test.com.ebay.developer.DetailLevelCodeType[1];req.DetailLevel[0] = Ebay.DetailLevelCodeType.ReturnAll;

req.Version = version;

Ebay.GetSearchResultsResponseType resp = service.GetSearchResults(req);//Do some more stuff

Stay in the loop.

I'm trialing a newsletter. Join for monthly insights into web dev, Chrome, and the open web.

alternate_email

Get in touch

Open to chat about Chrome or Web development.

Book a consultation