Change Web Service Reference

Nov 7, 2008 at 4:21 PM
I really like and want to use your upload component in my website.  When I run the project locally it works as expected, but when I upload it to my server I get a file upload error.  When I navigate to SilverlightUploadService.svc on my server it shows the default information as expected.  Also, when I go to the mpost.SilverlightMultiFileUploadTestPage.aspx page the upload control shows up as expected, but when I go to upload somthing I get the upload error.  I've set the proper file permissions for the Upload folder with read/write access. 
1.  Is there a way to debug once it is on the server, for example when you are catching the exception and displaying the "Upload failed." is there a way just to get the exception to be thrown so I can get some details of why it is failing. 

2. I think it may have somthing to do with the "localhost" references, so it would also be helpful if you could tell me what references I have to update to point to the service running on my server that is working, while still running the project locally.

Thanks,
Dan
Coordinator
Nov 7, 2008 at 4:29 PM
Hi,

The FileUploader.cs file had the reference to the webservice location. This line does the work:

EndpointAddress

 

address = new EndpointAddress(new CustomUri("SilverlightUploadService.svc"));

It expects your XAP file to be in the ClientBin directory and the webservice in the directory above that.
You could change the code and hard code your location to try to fix it.

In the same file, there's this method: 

 

 

 

 

void _client_StoreFileAdvancedCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
{

 

 

//Check for webservice errors

 

 

 

 

 

if (e.Error != null)
{

 

 

 

 



You can write custom code to log errors there.

Good luck,
Michiel