Developers Program

ListingDurationCodeType / ShippingServiceCodeType are changed in WSDL457, should I change my JAVA SDK client code?

Published: July 21 2006, 5:04:00 PMยทUpdated: August 24 2022, 11:56:00 PM

Products

Question

ListingDurationCodeType / ShippingServiceCodeType are changed in WSDL457, should I change my JAVA SDK client code?

Answer

Detail Description

As stated in e457 release note, all WSDL elements previously based on ShippingServiceCodeType and ListingDurationCodeType are now based on xs:token. This update requires code change for Java SDK clients. Hence, the SDK e459 or higher SDK version is not backward-compatible with the SDK that is based on 455 or lower WSDL version.

  • Set the properties
    -- ListingDuration properties
    ItemType item = new ItemType();
    //New (Valid for the SDK based on e457 forward)
    item.setListingDuration(new org.apache.axis.types.Token("Days_7"));
    //Old (Valid for the SDK based on e455 or lower)
    item.setListingDuration(ListingDurationCodeType.Days_7);

    --- ShippingService properties
    ShippingServiceOptionsType st = new ShippingServiceOptionsType();
    //New (Valid for the SDK based on e457 forward)
    st.setShippingService(new org.apache.axis.types.Token ("USPSPriority"));
    //Old (Valid for the SDK based on e455 or lower)
    st.setShippingService( ShippingServiceCodeType.USPSPriority);

NOTE. The two types can also be set as:
item.setListingDuration(ListingDurationCodeType.Days_7.getValue())
st.setShippingService(ShippingServiceCodeType.USPSPriority.getValue())
respectively, however; applications should not depend on the ShippingServiceCodeType and ListingDurationCodeType sets retained in the corresponding Axis generated JAVA source code because there is no guarantee that the schema has all of the new and updated entries. You need to use GetCategoryFeatures for the available durations options for the site and use GeteBayDetails for the complete list of shipping services.

  • Retrieve the properties for the SDK based on e457 forward
    -- ListingDuration properties
    item.getListingDuration().toString();
    -- ShippingService properties
    st.getShippingService().toString();

Additional Resources

How well did this answer your question?