-1

我正在尝试使用此 XML 请求通过 eBay API 获取产品:

<aspectFilter>
    <aspectName>Genre</aspectName>
    <aspectValueName>Comedy & Spoken Word</aspectValueName>
</aspectFilter>

但我收到以下错误响应:

<errorMessage xmlns="http://www.ebay.com/marketplace/search/v1/services">
   <error>
      <errorId>2030</errorId>
      <domain>CoreRuntime</domain>
      <severity>Error</severity>
      <category>System</category>
      <message>Internal error: [com.ctc.wstx.exc.WstxLazyException] com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character ' ' (code 32) (missing name?)
         at javax.xml.stream.SerializableLocation@1b0a1b0a</message>
      <subdomain>System</subdomain>
      <parameter name="Param1">[com.ctc.wstx.exc.WstxLazyException] com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character ' ' (code 32) (missing name?)
         at javax.xml.stream.SerializableLocation@1b0a1b0a</parameter>
   </error>
</errorMessage>

谁能告诉我我做错了什么?

4

1 回答 1

0

This is because of the special character & which is causing the error. eBay system doesn't accept special character as inpit so you should convert to html code, so & should be passed as &#38;. Then your request should look like this

<aspectFilter>
    <aspectName>Genre</aspectName>
    <aspectValueName>Comedy &#38; Spoken Word</aspectValueName>
</aspectFilter>
于 2013-05-07T13:20:44.560 回答