当未指定属性“kind”时,无法在元素“endpoint”上指定属性“endpointConfiguration”

时间:2010-08-05 14:26:42

标签: wcf

title是我创建代理类对象时来自wcf服务客户端的异常消息

我有

的简单wcf服务
<security mode="Transport"> and <transport clientCredentialType="Basic" />

这是客户端的app.config

<system.serviceModel>
    <behaviors>
      <endpointBehaviors>
        <behavior name="NoValidationBehavior">
          <clientCredentials>
            <serviceCertificate>
              <authentication certificateValidationMode="None"/>
            </serviceCertificate>
          </clientCredentials>
        </behavior>
      </endpointBehaviors>
     </behaviors>
    <bindings>
      <wsHttpBinding>
        <binding name="WSHttpBinding_IService1" closeTimeout="00:01:00"
            openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
            bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
            maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
            messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
            allowCookies="false">
          <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
              maxBytesPerRead="4096" maxNameTableCharCount="16384" />
          <reliableSession ordered="true" inactivityTimeout="00:10:00"
              enabled="false" />
          <security mode="Transport">
            <transport clientCredentialType="Basic" proxyCredentialType="None"
                realm="" />
            <message clientCredentialType="Windows" negotiateServiceCredential="true" />
          </security>
        </binding>
      </wsHttpBinding>
    </bindings>
    <client>
      <!--kind="webHttpEndpoint"-->
      <endpoint address="https://localhost:1111/Service1.svc" binding="wsHttpBinding"
          bindingConfiguration="WSHttpBinding_IService1" contract="ServiceReference1.IService1"
          name="WSHttpBinding_IService1" endpointConfiguration="NoValidationBehavior2"/>
    </client>

  </system.serviceModel>

有人能帮助我吗?!

P.S。对不起我的英文

1 个答案:

答案 0 :(得分:1)

我认为我们已在msdn forum上解决了这个问题。对于您的评论问题:endpointConfiguration和kind属性确实与WCF 4.0相关。它涉及名为standardEndpoints的新功能,它允许定义“端点模板”。