简体   繁体   English

在WCf中找不到Mex端点

[英]Mex endpoint not Found in WCf

I am using a example to do my first wcf service.. I am using is this example 我用一个例子做我的第一个WCF服务。我现在用的就是这个例子

giving me error mex endpoint not found. 给我错误找不到端点。

i have included appconfig file in console host and included following code 我在控制台主机中包含了appconfig文件,并包含了以下代码

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.serviceModel>
        <behaviors>
            <serviceBehaviors>
                <behavior>
                    <serviceMetadata httpGetEnabled="True"/>
                </behavior>
            </serviceBehaviors>
        </behaviors>
    </system.serviceModel>
</configuration>

can anyone please help me ht iam not able to run console host... 任何人都可以帮助我,因为我无法运行控制台主机...

Did you actually configure a mex endpoint for your service? 您是否实际上为服务配置了mex端点?

That would look something like this: 看起来像这样:

<service name="MyService" ...>
    <!-- actual service endpoints here -->
    <endpoint address="/mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>

I am using visual studio 2008 and framework 3.5 我正在使用Visual Studio 2008和Framework 3.5

And that is the whole problem. 这就是整个问题。 The example you are referring is for WCF 4 which uses something called default endpoints or simplified configuration. 您引用的示例是针对WCF 4的,该示例使用了称为默认端点或简化配置的名称。 Nothing like this exists in WCF 3.5. WCF 3.5中没有类似的东西。 You must manually configure your service and all its endpoints! 您必须手动配置服务及其所有端点!

<system.serviceModel>
  <services>
    <service name="EmailService.EmailValidator" behaviorConfiguration="Metadata"> 
      <host>
        <baseAddresses>
          <add baseAddress="http://localhost:8080/" />
        </baseAddresses>
      </host>
      <endpoint address="" binding="basicHttpBinding" contract="EmailService.IEmailValidator" />
      <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
    </service>
  </services>
  <behaviors>
    <serviceBehaviors>
      <behavior name="Metadata">
        <serviceMetadata httpGetEnabled="true" />
      </behavior>
    </serviceBehaviors>
  </behaviors>
</system.serviceModel>

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

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