Update Service Reference is not working in WCF

39,081

Solution 1

uncheck the Reuse types in referenced assemblies checkbox and put address of your new service in Address textbox.

Solution 2

While configuring service reference append /mex (address of your end point with mexHttpBinding ) at the end of your service URL.

https://service.domain.com/serivce1.svc/mex

This will enable metadata exchange. So Reference.cs will be modified / added (if you are adding service reference for the first time).

Edit : On analysis I found that this issue happens when a service (which implements one ServiceContract) is exposed via more than one end point.

This issue can be avoided by using different Service Contracts (Interface) for each end point and making the service class (service1) implement all these Interfaces.

Solution 3

If you cannot browse the URL, then you will not be able to add the service reference. Try hosting your web service locally in IIS. When you're able to browse the URL, then you can add the service reference.

Solution 4

Unchecking the reuse option the Update Service option works fine.

Solution 5

There are few things you can do first Clean the solution, delete the output directory and the service reference. Restart the Visual Studio and re configure the web service.

Share:
39,081
ujjaval
Author by

ujjaval

Updated on July 09, 2022

Comments

  • ujjaval
    ujjaval almost 2 years

    I am using VS 2012.

    I add services reference to my WPF project, but when I've changed my services and updated service reference my Reference.svcmap -> Reference.CS file will be blank and I can't use reference anymore. I can see it in project, but I can't use.

    My settings of Services References are :- enter image description here

    Reference.cs file

    //------------------------------------------------------------------------------
    // <auto-generated>
    //     This code was generated by a tool.
    //     Runtime Version:4.0.30319.17929
    //
    //     Changes to this file may cause incorrect behavior and will be lost if
    //     the code is regenerated.
    // </auto-generated>
    //------------------------------------------------------------------------------