Readme for the SoapApiDemo C# Sample
This sample shows how to use SDK wrapper classes (AddItemCall, GetItemCall, etc).
Instructions for app.config
Before using the sample, please insert values
(and/or review the default values), as follows, in
the ...Samples\C#\SoapApiDemo\app.config file:
Key |
Value |
Environment.ApiServerUrl |
Api server to call API
|
Environment.EpsServerUrl |
Eps server to upload pictures
|
UserAccount.ApiToken |
The token for the user for whom you are making API calls |
It is recommended that you first try the sample with a sandbox-user token that you already have obtained. However, if you don't have a token for UserAccount.ApiToken,
you can create one using the sample.
Please also see the following Knowledge Base articles:
Using the Sample
- To build the sample, open ...Samples\C#\CSharp Samples.sln in Visual Studio .NET and choose Build.
- SoapApiDemo lists calls that correspond to wrapper classes in the main window.
Each wrapper class is represented by its verb in the list box (e.g., "AddItem"
in the list represents the AddItemCall wrapper class)
- Click the "Config Api Account" button in the main window to access
the FormAccount dialog. It demonstrates how to collect user input to
construct an ApiContext object, which is required for calling each class.
- When you click the "Run [Verb]" (e.g., "Run
AddItem") button, SoapApiDemo will invoke a form with the name
convention of "Form[Verb]". For example, if you click "Run AddItem",
FormAddItem will be displayed.
- Each API form (e.g., FormAddItem) follows the same pattern:
1) Collect user input in the form. For AddItem, the user needs to enter the Title,
Description, StartPrice, Quantity, etc.
2) Create an SDK call class. e.g., for AddItemCall:
ItemType
item = FillItem();
AddItemCall apicall = new
AddItemCall(Context);
3) Call the verb method in the call class.
FeeTypeCollection
fees = apicall.AddItem(item);
4) Display call results in a form.