0

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

halfer
  • 19,824
  • 17
  • 99
  • 186
Wasif Subzwari
  • 199
  • 3
  • 13
  • You mean App.config, right? Because you said it's a console app. – Marcel N. Aug 11 '14 at 12:12
  • 1
    After build, check the bin/debug or bin/release folder and open yourapp.exe.config. Is the client endpoint configuration there? – Marcel N. Aug 11 '14 at 12:14
  • 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 Aug 11 '14 at 12:18
  • 1
    You said that A consumes B, right? So, the client configuration for B should be in A's config. That makes sense. – Marcel N. Aug 11 '14 at 12:19
  • Yes. Let me check .exe.config quickly. – Wasif Subzwari Aug 11 '14 at 12:19
  • Marcel, your inputs were very crucial, they gave me a direction and I could solve the problem. We have to paste endpoint information in host app.config as well. – Wasif Subzwari Aug 11 '14 at 12:32
  • Client endpoints need to be on the consuming side. Must have been some confusion going on when you created the reference – Marcel N. Aug 11 '14 at 12:33
  • But, it is trying to read end point details from app.config of host. – Wasif Subzwari Aug 11 '14 at 12:40
  • After pasting those details to host, it is working – Wasif Subzwari Aug 11 '14 at 12:40
  • Hi there. Just so you know, code is best rendered as text on sites like Stack Overflow - here we have code formatting tools as well. This makes it much easier for people to copy and paste what you provide - which is not possible with images. – halfer Dec 14 '15 at 22:14

1 Answers1

0

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

Wasif Subzwari
  • 199
  • 3
  • 13