简体   繁体   中英

calling a WCF service object method in another WCF service

I using two WCF services. WCF service A is hosted in my .NET Winform application and WCF Service B is hosted on a Windows Service.

I am able to instantiate a client for WCF Service B and use the methods - ie call the WCF service hosted on Windows service from the .NET Winform app.

I am not able to accomplish the reverse with WCF Service A - ie call the WCF Service hosted on the .NET Winform application from the Windows Service. The call to the method times out.

I have used the WCF Test client from the Visual Studio command prompt and it can successfully make calls to WCF Service A.

Is this due to a security issue or something from the Windows Service?

Please advise.

Thanks in advance!

Subbu

I think the only viable approach (without the extreme of having some messaging infrastructure), is to have the service invoke operations back on your client via a WCF callback. A good example of this can be found here:

What steps do I need to take to use WCF Callbacks?

This is good for dealing with events that happen server side and allowing the client to respond to them. If events isn't what you're looking for, then your client could just register with the server (specifying the callback contract), and then the server can invoke your client at will.

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