For full functionality of this site it is necessary to enable JavaScript.
Here are the instructions how to enable JavaScript in your web browser.

Knowledge base

Find the answer to your question

Advanced Search PView

Search terms
Search Type
Sort by

Exception in AddItemCall.setAutoSetItemUUID(true) in Java SDK

  • Answer ID 567
  • Published 07/26/2006 08:48 PM
  • Updated 10/20/2013 06:41 AM
  • Permalink
I am passing an UUID that generated with AddItemCall.newUUID() method to my AddItem call but I am getting the following exception: com.ebay.sdk.ApiException: The UUID can only contain Numbers and Letters from A to F and must be 32 characters long . Why?

You can only pass Numbers and Letters characters to Item.UUID parameter. You should not just directly plug the UUID returned from AddItemCall.newUUID() method into Item.UUID property since the method uses Axis UUIDGenFactory to generate an UUID, which contains '-' character, without filtering out the '-' character.
The removing '-' routine is provided for you in the AddItemCall.newUUID() method, you can modify the method, compile and archive the ebaycalls.jar library as below:

JAVA SDK ( old and new versions),

1. Modify AddItemCall.newUUID() method (in ${JAVA_SDK_HOME}/source/apiCalls/src/com/ebaysdk/call the directory). The modified method should be:

public static UUIDType newUUID() {
String uuid = org.apache.axis.components.uuid.UUIDGenFactory.getUUIDGen(null).nextUUID();
StringBuffer goodUuid = new StringBuffer();
for(int i = 0; i < uuid.length(); i ++)
char c = uuid.charAt(i);
if( c != '-' )
return new UUIDType(goodUuid.toString())
//return new UUIDType(uuid);


2. build and archive the apiCalls libraty:
% cd ${JAVA_SDK_HOME}/source/apiCalls/src/com/ebaysdk/call
% ant

How well did this answer your question?

Answers others found helpful

Print Email This Page Delicious Digg Facebook Reddit StumbleUpon Twitter