locked
Generating proxy class for the Callback wcf service RRS feed

  • Question

  • Hi,
    I have crated the callback wcf service, after that i added the service reference to  the web application.

    but  when i create the object for the proxy class it ask

    InstanceContext

     

    context = new InstanceContext(this);
    ProxyClient objProxyClient = new ProxyClient(context);

    this code i am writing in the default.aspx.cs page , but it ask for the implemetaion the callback interface in this page.
    how to avoid this code in the each aspx page by just creating the proxy object for the service. like Below the code.
    ProxyClient objProxyClient = new ProxyClient();

    i donot want to remove the callback interface in the wcf servie.
    i am using the callback interface for some other control and that is working fine.

    only problem with all aspx page to avoid the callback interface in the WEB application.


    Thanks,
    krishna



     



    Thursday, July 30, 2009 12:31 PM

Answers

  • Hi,

    You have to implement callback interface at the client side (in your example it is default.aspx) in order to handle the callback send by WCF service.

    Regards,
    Prabi

    I can be still better.
    • Proposed as answer by Prabodh Sawant Tuesday, August 4, 2009 4:35 AM
    • Marked as answer by Bin-ze Zhao Tuesday, August 4, 2009 9:12 AM
    Tuesday, August 4, 2009 4:35 AM
  • Hi krishna
    for WCF callback,
    1)you must defined an Iterface in the Service;
    2)CLient must impletement the Interface itself,
    3)Service owens a reference of the client context,then service can all back;
      I have write a callback demo,you can take it as a refernce.:/Files/frank_xl/WCFServiceOperationFrankXuLei20090503.rar
    Regards.
    Frank Xu Lei--谦卑若愚,好学若饥
    专注于.NET平台下分布式应用系统开发和企业应用系统集成
    Focus on Distributed Applications Development and EAI based on .NET
    欢迎访问老徐的中文技术博客:Welcome to My Chinese Technical Blog
    欢迎访问微软WCF中文技术论坛:Welcome to Microsoft Chinese WCF Forum
    欢迎访问微软WCF英文技术论坛:Welcome to Microsoft English WCF Forum
    • Marked as answer by Bin-ze Zhao Tuesday, August 4, 2009 9:12 AM
    Tuesday, August 4, 2009 4:51 AM

All replies

  • Hi,

    You have to implement callback interface at the client side (in your example it is default.aspx) in order to handle the callback send by WCF service.

    Regards,
    Prabi

    I can be still better.
    • Proposed as answer by Prabodh Sawant Tuesday, August 4, 2009 4:35 AM
    • Marked as answer by Bin-ze Zhao Tuesday, August 4, 2009 9:12 AM
    Tuesday, August 4, 2009 4:35 AM
  • Hi krishna
    for WCF callback,
    1)you must defined an Iterface in the Service;
    2)CLient must impletement the Interface itself,
    3)Service owens a reference of the client context,then service can all back;
      I have write a callback demo,you can take it as a refernce.:/Files/frank_xl/WCFServiceOperationFrankXuLei20090503.rar
    Regards.
    Frank Xu Lei--谦卑若愚,好学若饥
    专注于.NET平台下分布式应用系统开发和企业应用系统集成
    Focus on Distributed Applications Development and EAI based on .NET
    欢迎访问老徐的中文技术博客:Welcome to My Chinese Technical Blog
    欢迎访问微软WCF中文技术论坛:Welcome to Microsoft Chinese WCF Forum
    欢迎访问微软WCF英文技术论坛:Welcome to Microsoft English WCF Forum
    • Marked as answer by Bin-ze Zhao Tuesday, August 4, 2009 9:12 AM
    Tuesday, August 4, 2009 4:51 AM