Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. C# Webservice help -- catching an event

C# Webservice help -- catching an event

Scheduled Pinned Locked Moved C#
csharpgraphicshelptutorial
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    amclint
    wrote on last edited by
    #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

    A 1 Reply Last reply
    0
    • A amclint

      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

      A Offline
      A Offline
      amclint
      wrote on last edited by
      #2

      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

      A 1 Reply Last reply
      0
      • A amclint

        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

        A Offline
        A Offline
        amclint
        wrote on last edited by
        #3

        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

        P 1 Reply Last reply
        0
        • A amclint

          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

          P Offline
          P Offline
          pmarfleet
          wrote on last edited by
          #4

          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

          A 1 Reply Last reply
          0
          • P pmarfleet

            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

            A Offline
            A Offline
            amclint
            wrote on last edited by
            #5

            Ah, that is so simple and effective, thank you it works great.

            amclint There's no place like 127.0.0.1

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups