calling a WCF service object method in another WCF service

扶醉桌前 提交于 2020-01-06 19:38:30

问题


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 - i.e. 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 - i.e. 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


回答1:


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.



来源:https://stackoverflow.com/questions/3049560/calling-a-wcf-service-object-method-in-another-wcf-service

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!