我一直在研究 eBay 的大型商户服务 API 一段时间。这很艰难。我终于有了消息通过他们的系统,但我遇到了他们的架构问题。显然,存在比模式中定义的限制更多的限制。

例如,该架构定义了运输服务选项,可能如下所示:

  <ShippingServiceOptions>
    <ShippingService>USPSPriority</ShippingService>
    <ShippingServiceCost currencyID="USD">7.99</ShippingServiceCost>
    <ShippingServiceAdditionalCost currencyID="USD">0.0</ShippingServiceAdditionalCost>
    <ShippingServicePriority>1</ShippingServicePriority>
  </ShippingServiceOptions>

并在其架构中定义如下:

  <complexType name="ShippingServiceOptionsType">
    <complexContent>
      <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
        <sequence>
          <element name="ShippingInsuranceCost" type="{urn:ebay:apis:eBLBaseComponents}AmountType" minOccurs="0"/>
          <element name="ShippingService" type="{http://www.w3.org/2001/XMLSchema}token" minOccurs="0"/>
          <element name="ShippingServiceCost" type="{urn:ebay:apis:eBLBaseComponents}AmountType" minOccurs="0"/>
          <element name="ShippingServiceAdditionalCost" type="{urn:ebay:apis:eBLBaseComponents}AmountType" minOccur ="0"/>
          <element name="ShippingServicePriority" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
          <element name="ExpeditedService" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
          <element name="ShippingTimeMin" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
          <element name="ShippingTimeMax" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
          <element name="ShippingSurcharge" type="{urn:ebay:apis:eBLBaseComponents}AmountType" minOccurs="0"/>
          <element name="FreeShipping" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
        </sequence>
      </restriction>
    </complexContent>
  </complexType>

我在哪里可以找到有效值 ShippingService?我找到了一个例子,他们有 USPSPriority. 。这个有效,但我猜测的其他所有内容(UPS、UPSGround、UPS2ndDayAir 等)都会导致整个内容返回,并出现以下错误 Invalid data.

如果有人知道有效值列表或任何其他可以更好地解释 eBay 大型商户服务 (LMS) 架构的资源,请告诉我。

作为一个附带问题,“{http://www.w3.org/2001/XMLSchema}令牌”?JAXB 当前将其转换为字符串。

有帮助吗?

解决方案

一些事情可能会带来一些清晰的结果:

  1. eBay SDK 仅支持交易 API,不支持大型商户服务。
  2. eBay 大型商户服务的 XSD 位于 http://developer.ebay.com/webservices/latest/merchantdataservice.xsd. 。笔记:这与交易 API XSD 不同。
  3. 解决 ShippingService 困境的最简单方法是转到 AddFixedPriceItem 的调用参考并查看 http://developer.ebay.com/devzone/xml/docs/reference/ebay/AddFixedPriceItem.html#Request.Item.ShippingDetails.ShippingServiceOptions.ShippingService

看哪里说的

适用值:请参阅ShippingserviceCodeType

ShippingServiceCodeType 链接到您最终找到的页面。

希望这有帮助:)

其他提示

答案到侧问题:

XS:令牌中描述这里

作为

  

符号数据类型还包括   字符,但XML处理器会   删除换行符,回车   制表符,首尾空格,以及   多个空格。

有关您的主要问题,你必须要问易趣。

我终于找到了答案。他们(eBay的)文件是远远好于我已经初步实现,但它仍然可以采取一些闲逛找到的数据 - 它似乎在那里。

EBAY交易API呼叫参考

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top