locked
Error 404(not found),help! RRS feed

  • Question

  • I'm sure my wcf service goes ok, because I can use my wcf to upload a file.but when  I upload the file completed and next to upload another file ,it returns the 404(not found) error? somebody can tell me why? thanks

    flowlling are section codes:
                 ....

    1            ServiceReference1.UploadServiceClient wcfService = new ServiceReference1.UploadServiceClient();
    2 wcfService.ActionUploadCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(wcfService_ActionUploadCompleted);
    3 wcfService.ActionUploadAsync("a.jpg", combGalleryName.SelectionBoxItem.ToString(), uploadFile.Context[0], false, uploadFile);
    4 private void wcfService_ActionUploadCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
    5 {
    6
    7 if (e.Error == null)
    8 {
    //it gose ok, now to update the xml file
    ...
    9
    UTF8Encoding utf8 = new UTF8Encoding();
    10 Byte[] encodedBytes = utf8.GetBytes("&lt;?xml version=\"1.0\" encoding=\"utf-8\" ?>" + galleryXML.ToString());
    11 //Byte[] encodedBytes = utf8.GetBytes("hahahaha");
    12 ServiceReference1.UploadServiceClient wcfService = new ServiceReference1.UploadServiceClient();
    13 wcfService.ActionUploadCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(wcfService_ActionSaveCompleted);
    14 wcfService.ActionUploadAsync("b.xml", "", uploadFile.Context[0], false, uploadFile);
    15 }
    16 else
    17 {
    18 MessageBox.Show(e.Error.Message);
    19 }
    20 }
    21
    22 private void wcfService_ActionSaveCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
    23 {
    24
    25 if (e.Error == null)
    26 {
    27
    28 }
    29 else
    30 {
    31 //it returns not found error
    32 MessageBox.Show(e.Error.Message);
    33
    34 }
    35 }
    36
     
    Thursday, March 25, 2010 4:45 AM

Answers

  •  soluted. The file permission access settings caused this problem.


    Saturday, March 27, 2010 2:58 AM

All replies

  • I am not sure what the problem is but you can use fiddler to have a more descriptive view of error.

    You can get fiddler from http://www.fiddler2.com/

    Thanks,
    Radhey

    Thursday, March 25, 2010 6:00 AM
  •  thanks radhey, I have fiddled installed, but nothing can help me.

    Thursday, March 25, 2010 9:11 PM
  • Do you mean it always fails at the 2nd time you call this service? Or it fails randomly? I'm sure your Service code are fine too, because when you have this 404 error, you are even hitting your service code.

    Thursday, March 25, 2010 9:15 PM
  • thanks sladapter, the error occurs ervery time.

    Thursday, March 25, 2010 10:33 PM
  •  But you said " I upload the file completed and next to upload another file ,it returns the 404(not found) error?".

    If you mean you had it working, then it stops working for some reason.  Could you try to update your Service Reference? Or delete that service Reference then re-add it back.

    Thursday, March 25, 2010 10:56 PM
  • Also to help debug can you confirm whether you are using RIA services or just Core WCF services?

    Friday, March 26, 2010 12:04 AM
  •  yes ,my Service Reference is the newest. Maybe I make you puzzledSmile.

    I need upload two files,  now the first file can be uploaded normally,but the second fails and the Service returns not found erro.

    Friday, March 26, 2010 2:33 AM
  •  Any difference on those two files? Like size of the file?  Have you tried other files?

     

    Friday, March 26, 2010 9:03 AM
  •  soluted. The file permission access settings caused this problem.


    Saturday, March 27, 2010 2:58 AM