API Call returns an 'XML Error Text' error
Find the answer to your question
Please enter a search keyword.
Advanced Search
Products
Question
Question: Why am I getting the following error message when I make an AddItem request when I try to add HTML to my descrption? <Errors> <ShortMessage>XML Parse error. </ShortMessage> <LongMessage>XML Error Text: "; nested exception is: org.xml.sax.SAXParseException: The element type "br" must be terminated by the matching end-tag ...".</LongMessage> </Errors>
Answer
Answer:
Summary
To add HTML content to your description, you need to wrap it in CDATA so that server does not try to parse the content when the request is received.
Detailed Description
Here is a sample AddItem request that demonstrates how to send in the description:
<?xml version="1.0" encoding="utf-8"?>
<AddItemRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<Version>1123</Version>
<ErrorLanguage>en_US</ErrorLanguage>
<WarningLevel>High</WarningLevel>
<Item>
<Country>US</Country>
<Currency>USD</Currency>
<Description><![CDATA[ your description goes here ....]]></Description>
<ListingDuration>Days_7</ListingDuration>
<PostalCode>San Jose, CA</PostalCode>
<PaymentMethods>PaymentSeeDescription</PaymentMethods>
<PrimaryCategory>
<CategoryID>1463</CategoryID>
</PrimaryCategory>
<Quantity>1</Quantity>
<StartPrice>1.0</StartPrice>
<Title>title</Title>
</Item>
<RequesterCredentials>
<eBayAuthToken>***</eBayAuthToken>
</RequesterCredentials>
</AddItemRequest>
Summary
To add HTML content to your description, you need to wrap it in CDATA so that server does not try to parse the content when the request is received.
Detailed Description
Here is a sample AddItem request that demonstrates how to send in the description:
<?xml version="1.0" encoding="utf-8"?>
<AddItemRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<Version>1123</Version>
<ErrorLanguage>en_US</ErrorLanguage>
<WarningLevel>High</WarningLevel>
<Item>
<Country>US</Country>
<Currency>USD</Currency>
<Description><![CDATA[ your description goes here ....]]></Description>
<ListingDuration>Days_7</ListingDuration>
<PostalCode>San Jose, CA</PostalCode>
<PaymentMethods>PaymentSeeDescription</PaymentMethods>
<PrimaryCategory>
<CategoryID>1463</CategoryID>
</PrimaryCategory>
<Quantity>1</Quantity>
<StartPrice>1.0</StartPrice>
<Title>title</Title>
</Item>
<RequesterCredentials>
<eBayAuthToken>***</eBayAuthToken>
</RequesterCredentials>
</AddItemRequest>