You must Sign In to post a response.
  • Category: WCF

    WCF- regarding proxy generation - URGENT

    Have one method in WCF service and deployed in IIS after testing the test client.
    I have to add one more method in WCF.
    Question: Should i need to regenerate the proxy again?

  • #767261
    How you have created the proxy?
    If by adding service reference to Visual Studio, then just update the reference of added service. You will not require to regenerate the proxy again. New method will be accessible to you.

  • #767262
    Yes, whenever you do changes in the C# code you need to re-generate proxy and that has to be updated in the server [IIS] you hosted site.

    Note: The server cache may hold values of holder proxy, so I would suggest you to restart IIS once you deploy new proxy code.

    Mark as answer, if helpful.

  • #767265
    If you have update it then you need to create again, you can do it by following three ways
    1. Generate Proxy Adding Service Reference
    simply by adding a service reference you can do it.
    2. Generate Proxy by implementing ClientBase<T> class
    it creates proxy at run time, so it will accommodate service implementation changes. Let's follow the steps to generate proxy
    3. Generate Proxy by using SvcUtil.exe Tool
    - First Add a Client Project to solution named as "ClientApp3" that is basically a Console Application
    - Our WCF Service must be running, so let's run our service.
    - In Visual studio, generate proxy using svcutil.exe tool, see below syntax
    svcutil http://localhost/servicename /out:serviceProxy.cs
    - It will generate a new class

    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]

  • #767290
    Hi Raj.

    As you have added new method in the same class you no need to regenerate the proxy. Proxy is nothing but creation of object for a class which is in remote position or remote place.
    You have to re add the reference(service reference) which makes sure that the new method is accessible. How ever you need to restart IIS webserver to effect the changes and to make new method accessible.
    Hope it helps. If any problem let me know.

    Sridhar Thota.
    Editor: DNS Forum.

  • Sign In to post your comments