从地址SqlTableDependency下载$元数据时出错

时间:2019-01-23 18:52:39

标签: c# sql wcf

我正在使用Sqltabledependency包和以下链接的示例基于ChristianDelBianco项目制作一个控制台应用程序

https://github.com/christiandelbianco/monitor-table-change-with-WPF-WCF-sqltabledependency-example

该示例仅包含一个tableDependency类,因此我使用相同的结构复制并添加了3个更多的tableDepency类,从而更改了其他SQL表的值和接口。

问题是

  

我只能将第一个服务添加到客户端应用程序(BD_API)

enter image description here

在同一项目中,但解决方案(ServicioBroker)不同,还有3个服务

enter image description here

ServiceReference1基于tabla_contenedor类。对于其余的内容,我无法将它们添加为参考。我以为错误出在我的App.config文件中,代码的一部分:

  

这是我可以添加到客户端应用程序中的服务

<service name="ServicioBroker.Servicio.tabla_contenedor">
    <endpoint address="get" binding="wsDualHttpBinding" contract="ServicioBroker.Cambios.IContenedor">
      <identity>
        <dns value="localhost" />
      </identity>
    </endpoint>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
    <host>
      <baseAddresses>
        <add baseAddress="http://localhost:8000/ServicioTablaContenedor/" />
      </baseAddresses>
    </host>
  </service>
  

这个和另外两个不能添加为参考

  <service name="ServicioBroker.Servicio.buques">
    <endpoint address="get" binding="wsDualHttpBinding" contract="ServicioBroker.Cambios.IBuques">
      <identity>
        <dns value="localhost" />
      </identity>
    </endpoint>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
    <host>
      <baseAddresses>
        <add baseAddress="http://localhost:8001/ServicioTablaBuques/" />
      </baseAddresses>
    </host>
  </service>

当我启动控制台服务器时,它表明所有SqlTableDependency都在运行

enter image description here

因此,在我的客户端应用中,我尝试添加服务,但这是我使用Servicio 2,Servicio 3,Servicio 4地址时出现的内容

enter image description here

这是所有项目的链接

  

https://github.com/jafetrd/BDatos_API

在ServicioBroker中服务器控制台的位置,App.config文件包含端点的配置,Servicio文件夹内是我的四个sqltabledependency类别。 Service1局部类将启动所有内容。

客户端应用程序是BD_API,在Vistas(文件夹)>> Principal.xaml.cs内部实现了侦听SQL数据库中tabla_principal表的更改的服务

我一直在这个问题上停留了几天,找不到添加其他三个服务的解决方案。

0 个答案:

没有答案