C# Webservice help -- catching an event
-
I'm trying to integrate into a webservice and haven't done C# in awhile, there is an event that I need to catch after calling a method but I'm drawing a blank on how to do this...ANY help is appreciated. So what happens is I am uploading a file using the code below and need to know when the upload is complete (as it returns an identifier for the file I just uploaded as well) The webservice description shows "public event ApplyUploadCompletedEventHandler ApplyUploadCompleted;" as a valid event
try { objDocushare.ApplyUpload("admin", "xerox", "DocuShare", sProperties, sValues, sParent, filename, data); } catch (Exception ex) { Response.Write(ex.Message); }
amclint There's no place like 127.0.0.1
-
I'm trying to integrate into a webservice and haven't done C# in awhile, there is an event that I need to catch after calling a method but I'm drawing a blank on how to do this...ANY help is appreciated. So what happens is I am uploading a file using the code below and need to know when the upload is complete (as it returns an identifier for the file I just uploaded as well) The webservice description shows "public event ApplyUploadCompletedEventHandler ApplyUploadCompleted;" as a valid event
try { objDocushare.ApplyUpload("admin", "xerox", "DocuShare", sProperties, sValues, sParent, filename, data); } catch (Exception ex) { Response.Write(ex.Message); }
amclint There's no place like 127.0.0.1
-
Not sure if i can post the entire bit of code in here describing the webservice, as I'm not familiar with this posting board, so if that helps I can put the webservice description in here.
amclint There's no place like 127.0.0.1
Here is what I've done just now, but UploadFileCallback isn't getting called
objDocushare.ApplyUploadCompleted += new com.src_solutions.srchq.ApplyUploadCompletedEventHandler(UploadFileCallback); try { objDocushare.ApplyUpload("admin", "xerox", "DocuShare", sProperties, sValues, sParent, filename, data); } catch (Exception ex) { Response.Write(ex.Message); } ..................... private static void UploadFileCallback(Object sender, com.src_solutions.srchq.ApplyUploadCompletedEventArgs e) { Console.WriteLine(e.Result.ToString()); }
amclint There's no place like 127.0.0.1
-
Here is what I've done just now, but UploadFileCallback isn't getting called
objDocushare.ApplyUploadCompleted += new com.src_solutions.srchq.ApplyUploadCompletedEventHandler(UploadFileCallback); try { objDocushare.ApplyUpload("admin", "xerox", "DocuShare", sProperties, sValues, sParent, filename, data); } catch (Exception ex) { Response.Write(ex.Message); } ..................... private static void UploadFileCallback(Object sender, com.src_solutions.srchq.ApplyUploadCompletedEventArgs e) { Console.WriteLine(e.Result.ToString()); }
amclint There's no place like 127.0.0.1
I think you would be better off looking at asynchronous[^] web service calls. Invoke your web method asynchronously and wait for the callback. Use the callback to pass back status information about the upload to your calling code.
Paul Marfleet
-
I think you would be better off looking at asynchronous[^] web service calls. Invoke your web method asynchronously and wait for the callback. Use the callback to pass back status information about the upload to your calling code.
Paul Marfleet