For full functionality of this site it is necessary to enable JavaScript.
Here are the instructions how to enable JavaScript in your web browser.

Knowledge base

Find the answer to your question

Advanced Search PView

Search terms
Search Type
Product
Category
Language
Format
SDK
Sort by
Direction

What is the difference between Execute() and ExecuteRequest() in the .NET SDK

  • Answer ID 616
  • Published 08/15/2006 02:03 PM
  • Updated 10/20/2013 06:41 AM
  • Permalink https://ebaydts.com/eBayKBDetails?KBid=616
Product
What is the difference between Execute() and ExecuteRequest() in the .NET SDK?
When using the .NET SDK, the Execute() method should be used to actually make the API call.

The idea with ExecuteRequest is to give the ability to instantiate a call wrapper object (CompleteSaleCall for example is an SDK call wrapper), but use the actual underlying SOAP request object to make the call, and use the actual underlying SOAP response object to receive the response.

This is useful if you uprev the WSDL version, but the release of the wrapper classes you are using do not have properties for newer properties that are in the request or response WSDL. This allows you to use newer features that are in the API call, but that are not yet implemented in the SDK call wrapper.

Using CompleteSale as an example, you could do this:

  CompleteSaleCall api = new CompleteSaleCall(Context);
  CompleteSaleRequestType CompleteSaleRequest = new CompleteSaleRequestType();
  // set your call parameters through CompleteSaleRequest
  CompleteSaleRequest.Paid = true;
  ...
  CompleteSaleResponseType res = new CompleteSaleResponseType();
  res = api.ExecuteRequest(CompleteSaleRequest);

The general recommendation is to use Execute() especially in light of the frequent SDK releases that we are now doing.

ExecuteRequest should only be used in the case where there is no explicit call wrapper support for some request or response elements that you need to use.

How well did this answer your question?

Answers others found helpful

Print Email This Page Delicious Digg Facebook Reddit StumbleUpon Twitter