Skip to main content
Published: August 13 2007, 4:29:00 PMUpdated: November 28 2020, 3:54:40 PM

How to upload picture via RelistItemCall ?

Summary

  RelistItemCall wrapper makes uploading local stored images simple. 
  The  required steps of including Pictures in a ToBeRelisted item are:  

   1. Register EPS server URL in ApiContext object
   2. Register both a String array object ( a list of the image file name paths) and a PictureDetailsType object in RelistItemCall.uploadPictures() method


Detailed Description   

Here is an example java code that re-lists an item with a new StartPrice and new PictureDetails properties .  


  public static void  main(String [] args){
           try {
        
            String itemID = "110022274195";
            FeesType fees;
            String sandboxEPSURL = "http://msa-b1.sandbox.ebay.com/ws/eBayISAPI.dll?EpsBasicApp";

             //register EPS server URL in ApiContext object
            apiContext.setEpsServerUrl(sandboxEPSURL);
            RelistItemCall rliCall = new RelistItemCall(apiContext);
           
            ItemType item = new ItemType();
            item.setItemID(new ItemIDType(itemID));
            item.setStartPrice(new AmountType(0.89));
           
            rliCall.setItemToBeRelisted(item);


            // define gallery picture object  
            PictureDetailsType  pictureDetails = new PictureDetailsType();
            pictureDetails.setGalleryType(GalleryTypeCodeType.None);
            pictureDetails.setPhotoDisplay(PhotoDisplayCodeType.None);
            pictureDetails.setPictureSource(PictureSourceCodeType.EPS);
            // specify image file name path
            String [] pictureFiles = {"c:\\Sample.jpg"};

            //register both String array object (  a list of the image file name paths)  and  PictureDetailsType object 
            rliCall.uploadPictures(pictureFiles, pictureDetails);
            org.apache.axis.types.URI picURL = item.getPictureDetails().getPictureURL(0);
            System.out.println("Relisting Item ....");
            // fire relistItem request
            fees = rliCall.relistItem();
              
        }catch (Exception e){
             ....
        }
    }


Version Info

The code example above was based on the versions specified below:

API Schema Version 515
Java SDK Version javasdk v515 Point Release

Additional Resource

How well did this answer your question?
Answers others found helpful