zoukankan      html  css  js  c++  java
  • A very simple question but it makes me very frustrated

    In .Net4, the <service/> element is optional, it will add the default endpoint.

    A custom said that he always encounter an error "Can't find endpoint"

      <system.serviceModel>
        <services>
          <service name="WcfService1.Service1" behaviorConfiguration="WcfService1.Service1Behavior">
            <!-- Service Endpoints -->
            
            <endpoint address="" binding="webHttpBinding" contract="WcfService1.IService1">
              <!-- 
                  Upon deployment, the following identity element should be removed or replaced to reflect the 
                  identity under which the deployed service runs.  If removed, WCF will infer an appropriate identity 
                  automatically.
              -->
              <identity>
                <dns value="localhost"/>
              </identity>
            </endpoint>
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
          </service>
        </services>
        <behaviors>
          <serviceBehaviors>
            <behavior name="WcfService1.Service1Behavior">
              <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
              <serviceMetadata httpGetEnabled="true"/>
              <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
              <serviceDebug includeExceptionDetailInFaults="false"/>
            </behavior>
          </serviceBehaviors>
        </behaviors>
      </system.serviceModel>

    The problem here is that he use a "webHttpBinding",  when I test the service by suing WCFClientTest tool. the reslult is always empty. Because of this, I suspect the service name don't work here, makes me very unhappy.

  • 相关阅读:
    C#进阶之路——10.C# 接口
    C#进阶之路——9.C# 抽象类
    C#进阶之路——8.C# 继承
    C#进阶之路——7.ASP.NET常用控件
    C#进阶之路——6.C#字符与字符串
    C#进阶之路——5.C#数组与集合
    C#进阶之路——4.C#类属性和方法
    C#进阶之路——3.C#应用程序编译与执行
    mongodb
    Mycat配置文件详解
  • 原文地址:https://www.cnblogs.com/LeoTang/p/2605104.html
Copyright © 2011-2022 走看看