简体   繁体   English

如何从 IIS7 中托管的另一个 WCF 服务评估托管 WCF 服务的 Windows 服务?

[英]How to assess a Windows Service hosted WCF service from another WCF service hosted in IIS7?

I have done a work which contains two parts我做了一个包含两个部分的工作

  1. WCF service which is hosted in Windows Service WCF 服务托管在 Windows 服务中
  2. WCF service project hosted in IIS7 I have done both comfortably,But i got a problem? WCF 托管在 IIS7 中的服务项目我都做得很舒服,但是我有问题吗? I want to call a method from WCF service hosted in WS from the 2nd WCF service hosted in IIS, but i was unable to do that?我想从托管在 IIS 中的第二个 WCF 服务调用托管在 WS 中的 WCF 服务的方法,但我无法做到这一点? Can anybody help in this?有人可以帮忙吗?

You should be able to configure a client endpoint in the service being hosted in IIS to the service being hosted as a Windows service, and make your call through a proxy just as you would normally make a call to a WCF service.您应该能够将 IIS 中托管的服务中的客户端端点配置为作为 Windows 服务托管的服务,并通过代理进行调用,就像您通常调用 ZFB608636129CB469B63FE911E92E2 服务一样。

Well, if your service hosted in IIS7 wants to call the other service, it needs to become a client of that other service.好吧,如果托管在 IIS7 中的服务想要调用其他服务,它需要成为该其他服务的客户端。

So basically, in Visual Studio or on the command line, you need to create a service reference to your second service, so that you'll get a client-side proxy class, which you can then use to call the second service.因此,基本上,在 Visual Studio 或命令行中,您需要创建对第二个服务的服务引用,以便获得客户端代理 class,然后您可以使用它来调用第二个服务。 Also, you will need to add some configuration settings to your web.config for the service hosted in IIS7 in order for it to be able to call the other service (in a Windows service).此外,您需要为托管在 IIS7 中的服务在web.config中添加一些配置设置,以便它能够调用其他服务(在 Windows 服务中)。

So where exactly are you stuck??那么你到底卡在哪里了?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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