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
Product
Category
Language
Format
SDK
Sort by
Direction

Error 40 returned for VerifyAddItemCall made with .NET SDK

  • Answer ID 888
  • Published 08/19/2014 09:26 AM
  • Updated 08/19/2014 09:26 AM
  • Permalink https://ebaydts.com/eBayKBDetails?KBid=888
Product

Why am I getting the following error when I make a VerifyAddItem request with the .NET SDK even though I have provided a valid GalleryImage via the picture upload feature of the SDK?
 

<Errors>

        <ShortMessage>No Gallery Picture Provided.</ShortMessage>

        <LongMessage>You have not supplied an image for the Gallery.</LongMessage>

        <ErrorCode>40</ErrorCode>

        <SeverityCode>Error</SeverityCode>

        <ErrorClassification>RequestError</ErrorClassification>

</Errors>



Summary

When you use the SDK for uploading pictures to the eBay Picture Server, it does not actually upload the pictures for VerifyAddItem.  Hence, the PictureDetails container contains no PictureURL tags and if you set the GalleryType to Gallery without any PictureURL, you get this error. 

Detailed Description

To see what happens let take this example C# code used for making a VerifyAddItem call with the .NET SDK and using EPS:
 

/*
© 2007-2014 eBay Inc., All Rights Reserved
Licensed under CDDL 1.0 - http://opensource.org/licenses/cddl1.php
*/


private void VerifyAddItem(string uuid)

{

VerifyAddItemCall apicall = new VerifyAddItemCall(GetContext());

ItemType item = new ItemType();

item.Currency = CurrencyCodeType.USD;

item.Country = CountryCodeType.US;

item.PaymentMethods = new BuyerPaymentMethodCodeTypeCollection();

item.PaymentMethods.Add(BuyerPaymentMethodCodeType.PayPal);

item.PayPalEmailAddress = 'test@foo.com';

item.Title = 'Title';

item.Description = 'Description';

item.Quantity = 1;                                   

item.PostalCode = '95125';               

item.ListingDuration = 'Days_7';               

item.PrimaryCategory = new CategoryType();                 

item.PrimaryCategory.CategoryID = '12';              

item.StartPrice = new AmountType();

item.StartPrice.currencyID = CurrencyCodeType.USD;

item.StartPrice.Value = 20;

item.UUID = uuid;

//use EPS to upload picture

addItem.PictureFileList = new StringCollection();

addItem.PictureFileList.Add(@'C:\temp\Pic1.jpg');

addItem.PictureFileList.Add(@'C:\TEMP\Pic2.jpg');

item.PictureDetails = new PictureDetailsType();

item.PictureDetails.GalleryType = GalleryTypeCodeType.Gallery;

FeeTypeCollection fees = apicall.VerifyAddItem(item);

}

 

 

If you look at the log file, this is the SOAP request this is what is actually sent:
 

<?xml version='1.0' encoding='utf-8'?>

<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>

  <soap:Header>

    <RequesterCredentials xmlns='urn:ebay:apis:eBLBaseComponents'>

      <eBayAuthToken>******</eBayAuthToken>

      <Credentials>

        <AppId/>

        <DevId/>

        <AuthCert/>

      </Credentials>

    </RequesterCredentials>

  </soap:Header>

  <soap:Body>

    <VerifyAddItemRequest xmlns='urn:ebay:apis:eBLBaseComponents'>

      <MessageID>50b7ab06-1f55-4dfe-9f3a-e4e2574f1c73</MessageID>

      <Version>485</Version>

      <Item>

        <Country>US</Country>

        <Currency>USD</Currency>

        <Description>Description</Description>

        <ListingDuration>Days_7</ListingDuration>

        <PaymentMethods>PayPal</PaymentMethods>

        <PayPalEmailAddress>test@foo.com</PayPalEmailAddress>

        <PrimaryCategory>

          <CategoryID>12</CategoryID>

        </PrimaryCategory>

        <Quantity>1</Quantity>

        <StartPrice currencyID='USD'>20</StartPrice>

        <Title>Title</Title>

        <UUID>c78c181c9e184399822f0df4bca5bc2b</UUID>

        <PostalCode>95125</PostalCode>

        <PictureDetails>

          <GalleryType>Gallery</GalleryType>

          <PhotoDisplay>None</PhotoDisplay>

        </PictureDetails>

      </Item>

    </VerifyAddItemRequest>

  </soap:Body>

</soap:Envelope>

 

Since this is a VerifyAddItem call, the pictures are not actually uploaded, there is no PictureURL, but the GalleryType is set to Gallery.  Hence it returns the error 'You have not supplied an image for the Gallery'.

Workaround:

  • Comment out the code to set the GalleryType for the VerifyAddItem call and the request will go through fine. 

  • Instead of using EPS to upload pictures, set dummy URLs as under:
        item.PictureDetails = new PictureDetailsType();
        item.PictureDetails.PictureURL = new StringCollection();
        item.PictureDetails.PictureURL.Add('http://www.mydomain.com/pic1.jpg');
        item.PictureDetails.PictureURL.Add('http://www.mydomain.com/pic2.jpg');
        item.PictureDetails.GalleryType = GalleryTypeCodeType.Gallery;
        item.PictureDetails.PhotoDisplay = PhotoDisplayCodeType.VendorHostedPictureShow;
    And when you actually make an AddItem call, use the EPS to upload pictures.
     


Version Info

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

API Schema Version 485
.NET SDK Version .NET SDK v485.0 full release



How well did this answer your question?

Answers others found helpful

Print Email This Page Delicious Digg Facebook Reddit StumbleUpon Twitter