Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Update Service Reference is not working in WCF

Tags:

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> //------------------------------------------------------------------------------ 
like image 745
ujjaval Avatar asked May 15 '13 04:05

ujjaval


People also ask

How do I change my WCF service reference?

In Solution Explorer, right-click the name of the project to which you want to add the service, and then click Add Service Reference. The Add Service Reference dialog box appears. Click Discover. All services (both WCF Data Services and WCF services) in the current solution are added to the Services list.

How do you update a Web service reference?

In Solution Explorer, open your project's App_WebReferences folder and click the node for the Web reference you want to update. Right-click the reference and click Update Web Reference. The new files for the XML Web service are downloaded to your project.

How do I add a WCF service reference in a net core 3.1 application?

NET Standard project, this option is available when you right-click on the Dependencies node of the project in Solution Explorer and choose Manage Connected Services.) On the Connected Services page, select Add Service Reference. The Add service reference page opens. Select WCF Web Service, and then choose Next.


2 Answers

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

like image 61
Abhishek B Patel Avatar answered Sep 22 '22 14:09

Abhishek B Patel


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.

like image 30
Dhivya DD Avatar answered Sep 21 '22 14:09

Dhivya DD