Skip to main content
Published: April 22 2015, 11:36:00 PMUpdated: July 25 2022, 5:20:13 PM

Question:

Can the API let me know when unknown tags are in my request rather than ignoring them?

Answer:

Every API call that uses a CompatibilityLevel (Version) of at least 439 can use <WarningLevel>High</WarningLevel> in the request to get this functionality.
Indicating <WarningLevel>High</WarningLevel> in a request will cause the API to return a Warning when elements that are in the request are not defined in the schema.
Since schema elements are case sensitive, this is a good way to remove any potential hidden bugs within your application before putting your application into a Production setting.

Our recommendation is to use <WarningLevel>High</WarningLevel> in your development and debugging.
We recommend that you do not keep this in your requests in Production code.
This is only a recommendation at this time and not a requirement.
You should use <WarningLevel>High</WarningLevel> much like Debug.Assert statements to help you in development and testing of your application.

Here is an example of what can be returned when <WarningLevel>High</WarningLevel> is used in the request:
Let's say you have an AddItemRequest in which the Item has the following:

<StoreFront>
  <StoreCategoryID>3</StoreCategoryID>
</StoreFront>

In this case the element <StoreFront> is not defined in the schema (the correct element is <Storefront>).
Using <WarningLevel>High</WarningLevel> in such an AddItemRequest will return the following warning:

<Errors>
  <ShortMessage>Unrecognized element <Item.StoreFront> in SOAP request.</ShortMessage>
  <LongMessage>The element <Item.StoreFront> was found in the input SOAP request. This is not a declared element in the schema and will be ignored.</LongMessage>
  <ErrorCode>21927</ErrorCode>
  <SeverityCode>Warning</SeverityCode>
  <ErrorParameters ParamID="0">
    <Value>Item.StoreFront</Value>
  </ErrorParameters>
  <ErrorClassification>RequestError</ErrorClassification>
</Errors>

Note that a SeverityCode of Warning is returned and not a SeverityCode of Error. The call will not be blocked due to these unrecognized elements.

Please note that <WarningLevel>High</WarningLevel> will not report a Warning on attributes (XML attributes, this has nothing to do with Item Specifics) within XML elements that are not in the schema.
Please note that <WarningLevel>High<WarningLevel> does not control warnings related to unrecognized values within elements.
Please note that this feature relies on all of our complexTypes having xs:any declared (for complexTypes that do not have xs:any declared, there will be no warning produced in that type)
We believe that 100% or very nearly 100% of our complexTypes do have xs:any declared as of this writing.


The following documentation resources are available:

http://developer.ebay.com/Devzone/XML/docs/Reference/ebay/types/WarningLevelCodeType.html

http://developer.ebay.com/devzone/guides/ebayfeatures/Basics/Call-ErrorHandling.html

 

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