WCF request works from windows forms but not windows service

佐手、 提交于 2019-12-11 23:55:12

问题


My WCF service is installed as a windows service configured to use NETTCP binding. I did not do anything special other than importing the service definition, making the client and calling the function.

When I call the WCF service from a windows forms application, I am able to send requests normally. But when I run the same code inside a windows service running as Local System, I get "The service does not allow you to log on anonymously." warning and a "socket connection aborted" in the service trace file.

Can someone give me an idea of what else I need to take care of when making WCF requests from a windows service instead of windows forms from an authentication perspective?


回答1:


From this MSDN page, it looks like any WCF client that uses Local System account for the service will be treated with Anonymous NTLM. That's what solved my problem -changing the account for the service. I still don't know what account a windows forms uses, but that's ok.



来源:https://stackoverflow.com/questions/23449869/wcf-request-works-from-windows-forms-but-not-windows-service

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