Skip to main content
Published: June 08 2005, 5:33:00 PMUpdated: November 28 2020, 1:23:56 PM

Why do I get error messages for elements that do not exist in the new schema?

When using the new schema, you have to be careful about specifying the namespace. In the absence of a namespace, an attempt is made to execute the call against the old schema, although the rest of the elements are in the new schema format.

For e.g. when making an AddItem call if you make the following request:

<?xml version="1.0" encoding="utf-8"?>
<AddItemRequest>
<RequesterCredentials>
<eBayAuthToken>myebaytoken</eBayAuthToken>
</RequesterCredentials>
<Item>
<BuyItNowPrice>100.0</BuyItNowPrice>
<Country>US</Country>
<Currency>USD</Currency>
<Description><![CDATA[ Very lively]]></Description>
<ListingDuration>Days_7</ListingDuration>
<Location>San Jose, CA</Location>
<PaymentMethods>PayPal</PaymentMethods>
<PayPalEmailAddress>myaddress@foobar.com</PayPalEmailAddress>
<PrimaryCategory>
<CategoryID>307</CategoryID>
</PrimaryCategory>
<Quantity>1</Quantity>
<RegionID>0</RegionID>
<StartPrice>50.00</StartPrice>
<Title>Bright side - CD</Title>
</Item>
</AddItemRequest>

You are likely to get back this response:

<?xml version="1.0" encoding="utf-8" ?>
<eBay>
<EBayTime>200506-08 23:39:54</EBayTime>
<Errors>
<Error>
<Code>10009</Code>
<SeverityCode>1</SeverityCode>
<Severity>SeriousError</Severity>
<Line>0</Line>
<Column>0</Column>
<ErrorClass>RequestError</ErrorClass>
<ShortMessage> <![CDATA[ No <Quantity> exists or <Quantity> is specified as an empty tag.]]> </ShortMessage>
</Error>
<Error>
<Code>10009</Code>
<SeverityCode>1</SeverityCode>
<Severity>SeriousError</Severity>
<Line>0</Line>
<Column>0</Column>
<ErrorClass>RequestError</ErrorClass>
<ShortMessage> <![CDATA[No <Currency> exists or <Currency> is specified as an empty tag.]> </ShortMessage>
</Error>
<Error>
<Code>10009</Code>
<SeverityCode>1</SeverityCode>
<Severity>SeriousError</Severity>
<Line>0</Line>
<Column>0</Column>
<ErrorClass>RequestError</ErrorClass>
<ShortMessage> <![CDATA[No <Country> exists or <Country> is specified as an empty tag.]> </ShortMessage>
</Error>
<Error>
<Code>10009</Code>
<SeverityCode>1</SeverityCode>
<Severity>SeriousError</Severity>
<Line>0</Line>
<Column>0</Column>
<ErrorClass>RequestError</ErrorClass>
<ShortMessage> <![CDATA[No <MinimumBid> exists or <MinimumBid> is specified as an empty tag.]> </ShortMessage>
</Error>
<Error>
<Code>10009</Code>
<SeverityCode>1</SeverityCode>
<Severity>SeriousError</Severity>
<Line>0</Line>
<Column>0</Column>
<ErrorClass>RequestError</ErrorClass>
<ShortMessage><![CDATA[No <Duration> exists or <Duration> is specified as an empty tag.]> </ShortMessage>
</Error>
</Errors>
</eBay>

It returns errors for Quantity, Country and Currency although they are specified. In the old schema, we have the element MinimumBid, but in the new schema it is StartPrice. Trying to add the element in your request is not going to work because it does not exist. Similarly, Duration has been replaced by ListingDuration. These errors can be misleading, so you need to be very careful about the namespace.

Here is the correct xml:

<?xml version="1.0" encoding="utf-8"?>
<AddItemRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<RequesterCredentials>
<eBayAuthToken>myebaytoken</eBayAuthToken>
</RequesterCredentials>
<Item>
<BuyItNowPrice>100.0</BuyItNowPrice>
<Country>US</Country>
<Currency>USD</Currency>
<Description><![CDATA[ Very lively]]></Description>
<ListingDuration>Days_7</ListingDuration>
<Location>San Jose, CA</Location>
<PaymentMethods>PayPal</PaymentMethods>
<PayPalEmailAddress>myaddress@foobar.com</PayPalEmailAddress>
<PrimaryCategory>
<CategoryID>307</CategoryID>
</PrimaryCategory>
<Quantity>1</Quantity>
<RegionID>0</RegionID>
<StartPrice>50.00</StartPrice>
<Title>Bright side - CD</Title>
</Item>
</AddItemRequest>

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