看看参数重载列表,,,, 如果你指定了 binding,address啥的那就是告诉wcf你要用编码方式进行配置 

解决方案 »

  1.   

    我就是去掉了binding,address 才不行的!
      

  2.   

    似乎明白了点。要运行WCF服务必须要定义endpoint
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"></endpoint>
    应该是用来对外发布元数据的。如果这样定义就可以<?xml version="1.0" encoding="utf-8" ?>
    <configuration>
      <system.serviceModel>
        <services>
          <service name="WcfServiceLibrary.BasicMath" behaviorConfiguration="basicBehaviors">
            <endpoint address="" binding="wsHttpBinding" contract="WcfServiceLibrary.IBasicMath"></endpoint>
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"></endpoint>
            <host>
              <baseAddresses>
                <add baseAddress="http://localhost:9099/mathServices"/>
              </baseAddresses>
            </host>
          </service>
        </services>
        <behaviors>
          <serviceBehaviors>
            <behavior name="basicBehaviors">
              <serviceMetadata httpGetEnabled="true"></serviceMetadata>
              <serviceDebug includeExceptionDetailInFaults="false"/>
            </behavior>
          </serviceBehaviors>
        </behaviors>
      </system.serviceModel>
    </configuration>
      

  3.   


    是不是发布了元数据后客户端就可以通过 http://localhost:9099/mathServices?wsdl 这种形式去调用呢? 但是我试了下好像只有定义了 
    <serviceMetadata httpGetEnabled="true"></serviceMetadata> 就可以通过 http://localhost:9099/mathServices?wsdl  去调用。不是很明白
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"></endpoint> 的作用。
      

  4.   

    楼主在4楼好像有把代码里的ABC配置到文件里去了吧
    是不是好了
      

  5.   

    楼主在4楼好像有把代码里的ABC配置到文件里去了吧
    是不是好了
      

  6.   

    有没有哪位高手帮忙指点下啊 !加 <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"></endpoint> 和没加它有什么区别呢。
    加了它在使用svcUtil.exe 生成时使用
    svcutil.exe http://localhost:9099/mathServices/mex /out:mexClient.cs /config:app.config
    没加它时使用
    svcutil.exe http://localhost:9099/mathServices /out:mexClient1.cs /config:app.config
    1
    生成的代码没啥区别啊。
    谁能告诉我 
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"></endpoint> 这个总结点有啥作用啊?
      

  7.   

    看看这个
    http://social.microsoft.com/Forums/zh-CN/wcfzhchs/thread/f54aede1-4ee3-4d2e-9e6e-109190eeb0a8
      

  8.   

    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
    这个就好像把你家的号码登记到114上去了 让人家可以查询是否有wcf服务可用及相关信息