Google Search: ebay api soap wsdl [part deux]

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. []

The Code Follows:

Ebay.eBayAPIInterfaceService service = new Ebay.eBayAPIInterfaceService();
string appId = "APPID"; // use your app ID
string devId = "DEVID"; // use your dev ID
string certId = "CERTID"; // use your cert ID
string endpoint = "";
string callName = "GetSearchResults";
string siteId = "0";

string version = "437";
// Build the request URL
string 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; //"";
// Set credentials
service.RequesterCredentials = new Ebay.CustomSecurityHeaderType();

service.RequesterCredentials.eBayAuthToken = "MY_TOKEN"; // use your token
service.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[1];
req.DetailLevel[0] = Ebay.DetailLevelCodeType.ReturnAll;

req.Version = version;

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

Technorati Tags
[feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed]

Related Wikipedia Documents
, , , , , , , , , ,

My Related Documents

Related Amazon Books
Web Services Platform Architecture: Soap, WSDL, WS-Policy, WS-Addressing, WS-Bpel, WS-Reliable Messaging and More: / Building Web Services with Java: Making Sense of XML, Soap, WSDL and UDDI: / Understanding Web Services: XML, WSDL, SOAP and UDDI: / Perspectives on Web Services: Applying SOAP, WSDL, and UDDI to Real-World Projects (Springer Professional Computing S.): / Make Money on EBay UK: The Inside Guide To Getting Started, Buying and Selling Successfully and Securely on EBay.Co.Uk: / Absolute Beginner's Guide to Launching an EBay Business (Absolute Beginner's Guides S.): / What to Sell on EBay and Where to Get It: / EBay Powerseller Secrets: / Enterprise Applications Integration Using.Net and XML/Soap: / Applied SOAP: Implementing .NET Web Services: / Internet Security: Cryptographic Principles, Algorithms and Protocols: /

Related Images From Flickr