English 中文(简体)
Does anyone have better information about eBay s Large Merchant Services schema?
原标题:

I ve been wrestling with eBay s Large Merchant Services API for a while. It s been rough. I finally have messages going all the way through their system, but I m having issues with their schema. Apparently there are alot more restrictions than what is defined in the schema.

As an example, the schema defines shipping service options, which may look something like this:

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

and is defined in their schema like so:

  <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>

Where can I find valid values for ShippingService? I found an example where they has USPSPriority. That one works, but everything else I ve guessed at (UPS, UPSGround, UPS2ndDayAir, etc) results in the entire thing getting returned with an error of Invalid data.

If anyone knows a list of valid values, or any other resources that better explains eBay s schema for Large Merchamt Services (LMS) please let me know.

As a side question, what exatly is a type of "{http://www.w3.org/2001/XMLSchema}token"? JAXB currently converts it to a String.

最佳回答

A few things that might bring some clarity:

  1. The eBay SDK only supports the Trading API, not Large Merchant Services.
  2. eBay Large Merchant Service s XSD is located at http://developer.ebay.com/webservices/latest/merchantdataservice.xsd. Note: This is not the same as the Trading API XSD.
  3. The easiest way to have solved your ShippingService dilemma would have been going to AddFixedPriceItem s Call Reference and seeing http://developer.ebay.com/devzone/xml/docs/reference/ebay/AddFixedPriceItem.html#Request.Item.ShippingDetails.ShippingServiceOptions.ShippingService

See where it says

Applicable values: See ShippingServiceCodeType

ShippingServiceCodeType links to the page you ultimately found.

Hopefully this helps :)

问题回答

Answer to side question:

xs:token is described here.

as

The token data type also contains characters, but the XML processor will remove line feeds, carriage returns, tabs, leading and trailing spaces, and multiple spaces.

For your main question, you d have to be asking eBay.

I finally found the answer concerning Shipping Service. Their (eBay s) documentation is much better than I had initially realized, although it still can take a bit of poking around to find the data - it does appear to be there.

EBAY Trading API Call Reference





相关问题
How to validate DataTable with XML Schema?

Does anyone know how to validate a DataTable against a particular DataTable XSD (Schema)? Which would be the best performance-optimized way of doing this? For example: <?xml version="1.0" ...

Deprecated XML validation code problem C#

I m trying to figure out how to correct his deprecated xml schema validation code. public static bool ValidateXml(string xmlFilename, string schemaFilename) { ⁞ //Forward stream reading ...

Getting an object representation of an .XSD file in Java

What is the easiest way to obtain a statically typed representation of an XML schema (.XSD) in Java? More specifically I want to be able to programatically traverse all defined simpleType:s and ...

xmlserializer validation

I m using XmlSerializer to deserialize Xml achives. But I found the class xsd.exe generated only offers capability to read the xml, but no validation. For example, if one node is missing in a document,...

regex for four-digit numbers (or "default")

I need a regex for four-digit numbers separated by comma ("default" can also be a value). Examples: 6755 3452,8767,9865,8766,3454 7678,9876 1234,9867,6876,9865 default Note: "default" ...

热门标签