question

mfheimlich avatar image
0 Likes"
mfheimlich asked ·

Upload pictures

I've taken the example provided by eBay in the samples download. More specifically I've taken FrmUploadPictures and am trying to upload pictures. I took your sample out of the box and it gives the following error: Value cannot be null.\r\nParameter name: requestUriString. Does anyone know why? I did post another question on this forum about the current .net SDK missing fields for calculated shipping. I grabbed the one before it and the calculated shipping now works. Maybe this older library doesn't work? Here is ebay's code from the sample: private void uploadButton_Click2(object sender, EventArgs e) { try { eBayPictureService eps = new eBayPictureService(Context); string result = ""; int size = this.fileList.Count; //upload pictures one by one for (int i = 0; i < size; i++) { string file = this.fileList[i]; UploadSiteHostedPicturesRequestType request = new UploadSiteHostedPicturesRequestType(); if (this.checkBox.Checked) { request.PictureWatermark = new PictureWatermarkCodeTypeCollection(); request.PictureWatermark.Add(PictureWatermarkCodeType.User); } if (this.extDaysTextBox.Text != String.Empty) { int extDays = int.Parse(this.extDaysTextBox.Text); request.ExtensionInDays = extDays; } UploadSiteHostedPicturesResponseType response = eps.UpLoadSiteHostedPicture(request, file); result += Path.GetFileName(file) + " : " + response.SiteHostedPictureDetails.FullURL + "\r\n"; } this.textBox.Text = result; } catch (Exception ex) { MessageBox.Show(ex.Message); } }
.NET
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.

sree_developersupport avatar image
0 Likes"
sree_developersupport answered ·
Hi, Thanks for your post. Please use EPSServerURL = https://api.sandbox.ebay.com/ws/api.dll as part of your context. Please refer to the documentation for more info : https://developer.ebay.com/Devzone/XML/docs/Reference/eBay/UploadSiteHostedPictures.html KB Article for upload Pictures to Sandbox using C#.NET ; https://ebaydts.com/eBayKBDetails?KBid=2196 Best Regards, eBay Developer Support
· 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.

mfheimlich avatar image
0 Likes"
mfheimlich answered ·
It appears you have to use https instead of http as the documentation refers to.
· 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.

mfheimlich avatar image
0 Likes"
mfheimlich answered ·
It appears you have to use https instead of http as the documentation refers to.
· 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.

mfheimlich avatar image
0 Likes"
mfheimlich answered ·
System.Net.Sockets.SocketException: 'No connection could be made because the target machine actively refused it'
· 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.

mfheimlich avatar image
0 Likes"
mfheimlich answered ·
The property Environment.EpsServerUrl needs to be set. I tried value of http://api.sandbox.ebay.com/ws/api.dll but received a refused connection error.
· 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.

mfheimlich avatar image
0 Likes"
mfheimlich answered ·
Here's another example I created using the UploadPictureFile. The same error occurs: Value cannot be null.\r\nParameter name: requestUriString private void uploadButton_Click(object sender, EventArgs e) { try { eBayPictureService eps = new eBayPictureService(Context); string result = ""; int size = this.fileList.Count; //upload pictures one by one for (int i = 0; i < size; i++) { string file = this.fileList[i]; string tmpFile = System.IO.Path.GetTempFileName(); Bitmap resizeImage = ResizeImage(Image.FromFile(file), 100, 100); resizeImage.Save(tmpFile); string upLoadPictureFile = eps.UpLoadPictureFile(PhotoDisplayCodeType.None, tmpFile ); } this.textBox.Text = result; } catch (Exception ex) { MessageBox.Show(ex.Message); } }
· 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.