8

I want to consume a WCF service in my .NET Core application without adding service reference?

I am able to consume WCF by installing WCF connected service and adding service reference but I don't want to add any service reference.

TidyDev
  • 3,470
  • 9
  • 29
  • 51

3 Answers3

2

Please refer to the follow link. It has some minors issues, but is easy to fix.

Calling Web Method Without a Service Reference

1

if you are using wcf service then you can expose it as a restful service. then you can simply consume it. actully i have been use it for many years and its been really useful. here you can read more about that: REST / SOAP endpoints for a WCF service

Community
  • 1
  • 1
Mohammad
  • 2,724
  • 6
  • 29
  • 55
-2

you can create a service proxy using svcutil.exe and use the proxy class as a reference.

here is a sample:

SvcUtil.exe http://www.temperatureservice.com:8080/TemperatureService.svc /ser:DataContractSerializer /s /language:cs  /out:TemperatureServiceProxy.cs  /n:*,WCF.Client.Proxies.Proxy

It will generate TemperatureServiceProxy.cs file, include this file in your project and create a service client by referencing this file.

techdips
  • 23
  • 1
  • 5
    *How to consume wcf in .net core without adding service reference?*, and *I want to consume a wcf service in my core application without adding service reference*, and *I don't want to add any service reference*. The OP has specifically stated **three times** in their question that they do not want to use a service reference. Yet your solution is to use a service reference. Did you actually read the question? – tom redfern Feb 03 '17 at 11:45