question

anupooh avatar image
0 Likes"
anupooh asked ·

ASP.Net (C#) developer needs help getting started - AddItem

i need to write a web based system to get data from my ms SQL base and send / list/ add/ post them to ebay for auctions.

i can filter the items from my base and prepare them to be listed in ebay.

But i need the help for listing them in ebay.

I've went through the tutorials, KB articles and all.

but cannot find sample program even.

i have generated my development keys.

 

Then how can i call AddItem call in my asp.nt(c#) code?

 

this is the one currently i have .

 

try
        {

            string endpoint = "https://api.sandbox.ebay.com/wsapi";
            string callName = "AddItem";
            string siteId = "0";
            string appId = "xxxx";     // use your app ID
            string devId = "xxxx";     // use your dev ID
            string certId = "xxxx";   // use your cert ID
            string version = "837";

            // Build the request URL
            string requestURL = endpoint
                + "?callname=" + callName
                + "&siteid=" + siteId
                + "&appid=" + appId
                + "&version=" + version
                + "&routing=default";

            // Create the service
            WSebay.eBayAPIInterfaceService service = new WSebay.eBayAPIInterfaceService();

            // Assign the request URL to the servicelocator.
            service.Url = requestURL;

            // Set credentials
            service.RequesterCredentials = new WSebay.CustomSecurityHeaderType();
            service.RequesterCredentials.eBayAuthToken = "xxxx";    // use your token
            service.RequesterCredentials.Credentials = new WSebay.UserIdPasswordType();
            service.RequesterCredentials.Credentials.AppId = appId;
            service.RequesterCredentials.Credentials.DevId = devId;
            service.RequesterCredentials.Credentials.AuthCert = certId;

            // Make the call to AddItem
            WSebay.AddItemRequestType request = new WSebay.AddItemRequestType();
            request.Version = version;

            // Build ItemType
            WSebay.ItemType item = new WSebay.ItemType();
            item.Title = "test titl one";
            item.Description = "test titl oneThis is the first book in the Harry Potter series. In excellent condition!";
            //item.PrimaryCategory.CategoryID = "1463";
            CategoryType category = new CategoryType();
            category.CategoryID = "139973";
            item.PrimaryCategory = category;

            //item.StartPrice.Value = 1.00;
            item.StartPrice = new AmountType();
            item.StartPrice.currencyID = CurrencyCodeType.USD;
            item.StartPrice.Value = 1.00;
             
            item.CategoryMappingAllowed = true;
            item.Country = CountryCodeType.US;
            item.Currency = CurrencyCodeType.USD;
            item.DispatchTimeMax = 3;
            item.ListingDuration = "Days_7";
            item.ListingType = ListingTypeCodeType.Chinese;
            item.PaymentMethods = new BuyerPaymentMethodCodeType[1] { BuyerPaymentMethodCodeType.PayPal };
            item.PayPalEmailAddress = "test@yahoo.com";

            PictureDetailsType pic = new PictureDetailsType();
            string[] extpicurl = new string[1];
            extpicurl[0] = "http://www.google.co.in/imgres?q=book&num=10&hl=en&tbo=d&biw=1366&bih=66...
            pic.ExternalPictureURL = extpicurl;
            pic.GalleryDuration = "3";
            pic.GalleryStatus = GalleryStatusCodeType.Success;
            pic.PhotoDisplay = PhotoDisplayCodeType.CustomCode;
            item.PictureDetails = pic;

            item.PostalCode = "95125";
            item.Quantity = 1;

            
            item.Site = SiteCodeType.US;
            
            item.UUID = "a0d8c70c27cd478b87204f3510f55071";

            request.Item = item;

            WSebay.AddItemResponseType response = service.AddItem(request);

            //return response.ToString();
            outPut = response.Ack.ToString()+","+ response.AckSpecified.ToString();
            //outPut = request.ToString();
        }
        catch(Exception aditm)
        {
            outPut = aditm.Message.ToString() +"<br>"+aditm.StackTrace.ToString();
        }

additem
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

prussianmotors avatar image
0 Likes"
prussianmotors answered ·
@truonnguyennha_0 >Where the eBay Developers Program Team? Why the eBay Developers Program Team not support us? I don't even know where to start with this one
· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

truonnguyennha_0 avatar image
0 Likes"
truonnguyennha_0 answered ·
Where the eBay Developers Program Team? Why the eBay Developers Program Team not support us?
· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

truonnguyennha_0 avatar image
0 Likes"
truonnguyennha_0 answered ·
Where the eBay Developers Program Team?
· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

floyd_arquea avatar image
0 Likes"
floyd_arquea answered ·
Hello, I know this post is a while back, any samples on how to list item in .net c#? I am having similar issues. Regards,
· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.