WS-发现:跨机器 [英] WS-Discovery: across machines

查看:58
本文介绍了WS-发现:跨机器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个可发现的WCF服务.我已经如下所示配置了服务.我已经创建了一个客户端,该客户端使用"DiscoveryClient"类来探测该服务.在我的服务器上同时安装了服务和客户端后,一切正常 机器.但是,当服务安装在另一台计算机上时,该功能将不起作用.为了发现在另一台计算机上运行的服务,我需要做些特别的事情吗?它与防火墙有关系吗?

 

<服务名="WebServiceDiscovery.DiscoverableServices"; behaviorConfiguration =" ServiceDiscoveryBehavior">
       <端点合同="WebServiceDiscovery.IDiscoverableServices" binding ="wsHttpBinding"名称="WebServiceDiscovery.DiscoverableServices"; bindingConfiguration ="NoSecurity"; behaviorConfiguration ="EndpointDiscoveryBehavior"; />
       < endpoint contract ="IMetadataExchange" binding ="mexHttpBinding"地址=墨西哥" name ="IMetadataExchange"; />
       < endpoint kind ="udpDiscoveryEndpoint"; />
     </service>

 <行为>
     < serviceBehaviors>
       <行为名称="ServiceDiscoveryBehavior">
         < serviceDiscovery>
           < announcementEndpoints>
            < endpoint kind ="udpAnnouncementEndpoint"; />
           </announcementEndpoints>
         </serviceDiscovery>
         < serviceMetadata httpGetEnabled ="true"; />
         < serviceDebug includeExceptionDetailInFaults =" false" />
       </行为>
       <行为名称=" DefaultBehavior">
         < serviceMetadata httpGetEnabled ="true"; />
         < serviceDebug includeExceptionDetailInFaults =" false" />
       </行为>
     </serviceBehaviors>
     < endpointBehaviors>
       <行为名称="EndpointDiscoveryBehavior">
         < endpointDiscovery已启用="true">
           < extensions>
            < xmlElement xmlElement =名称"> Zephyr</xmlElement>
           </extensions>
         </endpointDiscovery>
       </行为>
     </endpointBehaviors>
    </行为>


MP

解决方案

根据[http://msdn.microsoft.com/zh-cn/library/dd456791.aspx]

"

要使WCF服务可被发现,它们必须正在运行.在IIS或WAS下托管的WCF服务在IIS/WAS收到绑定到该服务的消息之前不会运行,因此默认情况下无法发现它们.有两种方法可以使网络托管 可发现的服务:

  1. 使用Windows Server AppFabric自动启动功能

  2. 使用发现代理代表服务进行通信

"

能否请您检查该服务是否已启动?


I am trying to create one discoverable WCF service. I have configured the service as shown below. I have created a client, that probes for the service using 'DiscoveryClient' class. Everything works fine when both, service and client, are installed on my machine. But it does not work when service is installed on another machine. Is there anything special that I need to do in order to discover services running on another machine? Does it have to do anything with firewall?

 

<service name="WebServiceDiscovery.DiscoverableServices" behaviorConfiguration="ServiceDiscoveryBehavior">
        <endpoint contract="WebServiceDiscovery.IDiscoverableServices" binding="wsHttpBinding" name="WebServiceDiscovery.DiscoverableServices" bindingConfiguration="NoSecurity" behaviorConfiguration="EndpointDiscoveryBehavior" />
        <endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex" name="IMetadataExchange" />
        <endpoint kind="udpDiscoveryEndpoint" />
      </service>

 <behaviors>
      <serviceBehaviors>
        <behavior name="ServiceDiscoveryBehavior">
          <serviceDiscovery>
            <announcementEndpoints>
              <endpoint kind="udpAnnouncementEndpoint" />
            </announcementEndpoints>
          </serviceDiscovery>
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
        <behavior name="DefaultBehavior">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
      <endpointBehaviors>
        <behavior name="EndpointDiscoveryBehavior">
          <endpointDiscovery enabled ="true">
            <extensions>
              <xmlElement xmlElement="Name">Zephyr</xmlElement>
            </extensions>
          </endpointDiscovery>
        </behavior>
      </endpointBehaviors>
    </behaviors>


MP

解决方案

As per [http://msdn.microsoft.com/en-us/library/dd456791.aspx]

"

In order for WCF services to be discoverable they must be running. WCF services hosted under IIS or WAS do not run until IIS/WAS receives a message bound for the service, so they cannot be discoverable by default. There are two options for making Web-Hosted services discoverable:

  1. Use the Windows Server AppFabric Auto-Start feature

  2. Use a discovery proxy to communicate on behalf of the service

"

Can you, please, check if the service is started?


这篇关于WS-发现:跨机器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆