0
votes

I am hosting a WCF service on Windows Service (let's call it WCF B) and then trying to consume it from another WCF service (which is self hosted) (let's call it WCF A).

enter image description here

I am able to add service reference perfectly, end points are getting auto generated properly. But when I am trying to instantiate the client object.

I am communicating over TCP. I am getting following error.

Error Message, when I try to instantiate the client service object

Configuration Code of WCF B is as below

enter image description here

Auto generated Endpoint details(After adding Service Reference) in WCF A web.config are as below.

enter image description here

1
You mean App.config, right? Because you said it's a console app.Marcel N.
After build, check the bin/debug or bin/release folder and open yourapp.exe.config. Is the client endpoint configuration there?Marcel N.
WCF A is hosted on Console app. But WCF B's service reference is added in WCF Service A's project not in Console app(host) project. Do I need to add service reference in Console app(host) project?Wasif Subzwari
You said that A consumes B, right? So, the client configuration for B should be in A's config. That makes sense.Marcel N.
Yes. Let me check .exe.config quickly.Wasif Subzwari

1 Answers

0
votes

We have to copy the endpoint details from our WCF A web.config and paste them into it's host (Console app.config in this case)

Information to be copy pasted is configuration which is auto generated after adding Service Reference.

enter image description here