Skip to main content
Published: July 10 2006, 11:29:00 AMUpdated: July 24 2022, 4:55:13 PM

Why do I get Web Service framework internal error when I try to relist an Item using the .NET SDK?

The .NET SDK adds a default value if for a lot of fields if you do not specify it explicitly.  For instance, if you set the BuyItNowPrice of an Item, but do not specify the currency, it will assign the first CurrencyID in the enumeration which is "AFA".  Now when you try to make the call, this currency will not match the site that you are making the call to and hence you will get the error. 

 

Here is a sample code snippet that will result in Web Service framework internal error:

    public void RelistItem()
    {
      RelistItemCall apicall = new RelistItemCall(apicontext);
      ItemType item = new ItemType();
      item.ItemID = "110001832173";
      item.BuyItNowPrice = new AmountType();
      item.BuyItNowPrice.Value = 8.95;
      //If you do not set the currencyID explicitly, it will default to AFA.
      //This will result in Web Service framework internal error.
      //To avoid this uncomment the next line of code
      //item.BuyItNowPrice.currencyID = CurrencyCodeType.USD;
      apicall.RelistItem(item);
    }

The easiest way to find out source of errors is to inspect the log file for the call.  For this call, this the request that is logged:
[7/10/2006 10:59:32 AM, Informational]
https://api.sandbox.ebay.com/wsapi?callname=RelistItem&siteid=0&client=netsoap&appid=

[7/10/2006 10:59:37 AM, Informational]
<?xml version="1.0" encoding="utf-8"?>
<
soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <
soap:Header>
    <
RequesterCredentials xmlns="urn:ebay:apis:eBLBaseComponents">
      <
eBayAuthToken>******</eBayAuthToken>
    </RequesterCredentials>
  </
soap:Header>
  <
soap:Body>
    <
RelistItemRequest xmlns="urn:ebay:apis:eBLBaseComponents">
      <
MessageID>ec021332-8872-4af0-b665-077a327e4a0d</MessageID>
      <
Version>1311</Version>
      <
Item>
        <
BuyItNowPrice currencyID="AFA">8.95</BuyItNowPrice>
        <
ItemID>110001832173</ItemID>
      </
Item>
    </
RelistItemRequest>
  </
soap:Body>
</
soap:Envelope>

From this, it is obvious that the currencyID for BuyItNowPrice is causing the error since the call is routed to siteID 0 (US) and AFA is not a valid currency on the US site.

To turn on logging with the .NET SDK, you just need to add these lines of code, where apicontext the ApiContext object:
ApiLogManager apiLogManager = new ApiLogManager();
apiLogManager.ApiLoggerList.Add(new eBay.Service.Util.FileLogger(@"c:\ebaylog.txt", true, true, true));
apiLogManager.EnableLogging = true;
apicontext.ApiLogManager = apiLogManager;

 

How well did this answer your question?
Answers others found helpful