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. Async Callback in Web Service

Async Callback in Web Service

Scheduled Pinned Locked Moved C#
wcf
1 Posts 1 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
    Adam Jasper
    wrote on last edited by
    #1

    When I use the wsdl tool to create a web service proxy, it always makes the call back delegate a module level object variable, it then puts the code in as follows: private SendOrPostCallback _cb; public void GetProductsAsync(ProductsRequestEntity request, object userState) { if (_cb == null) _cb = new SendOrPostCallback(OnGetProductsCompleted); this.Invoke("GetProducts", new object[] { request}, _cb, userState); } Does the callback delegate need to be a module level variable, will coding it the following way cause me any problems: public void GetProductsAsync(ProductsRequestEntity request, object userState) { this.Invoke("GetProducts", new object[] { request}, new SendOrPostCallback(OnGetProductsCompleted), userState); } I have a lot of proxies to create and tidy up, taking a few shortcuts will save me a lot of time. Thanks in advance, Adam

    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