Home
Find the answer to your question
How do I access response information, such as Errors (Warnings) from my AddItemCall in VB.NET when using the .NET SDK?
You can access information returned in the response of an AddItemCall in the following ways (in vb.net):
1. For fees you can do the following:
Dim fees As FeeTypeCollection = ApiCall.AddItem(item)
Dim fee As FeeType
For Each fee In fees
If fee.Name = "ListingFee" Then
strfees = fee.Fee.Value.ToString()
End If
Next
2. To access other data points returned by the call you can do the following:
For accessing the EndTime returned in the response of the AddItemCall:
ApiCall.ApiResponse.EndTime
For errors you will usually get them as an ApiException, but you can check for errors by using the following (<SeverityCode>Error</SeverityCode> will usually generate an exception, but <SeverityCode>Warning</SeverityCode> will not):
Dim oError As ErrorType
For Each oError In ApiCall.ApiResponse.Errors
Dim longmessage As String
longmessage = oError.LongMessage
...
Next