简体   繁体   中英

How to call WCF service by WEB App -> Class Library -> WCF Service?

I have a WCF Service Project. I have another Class library project where I am calling the WCF service. And from a Web Application i am callign the class librabry.

In the Class library I am writing

new ChannelFactory<CompanyServiceContract>("CompanyServiceEndPoint")

But an exception is coming which says unable to find the End point "CompanyServiceEndPoint".

I have seen this question Could not find default endpoint element but I don't know about WS configuration settings into the main projects app.config

Can someone please help?

Shouldn't "CompanyServiceEndPoint" actually be an endpoint? (a string url to the service method, eg: "http://me.me.com/myService" or an EndpointAddress).

Can you access your wcf endpoint by other means? a browser? Fiddler ? WcfTestClient?

Did you define an endpoint for the scv in code? eg: http://msdn.microsoft.com/en-us/library/ms734681.aspx

I think in the first instance you need to find out if the fault is with the service or the client that calls the service. If you can hit the service with any of the clients above - then look to the client.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM