2010-08-05 52 views
1

title元素「端點」來指定是從WCF服務客戶機時,我創建代理類的對象屬性「endpointConfiguration」不能對當屬性「種類」未指定

我有簡單WCF服務異常消息

<security mode="Transport"> and <transport clientCredentialType="Basic" /> 

這是客戶端

<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> 
的app.config中

有人能幫助我嗎?!

P.S.對不起,我的英語

+0

對於初學者,我看到了NoValidationBehavior和NoValidationBehavior2。你能清除那個嗎? – 2010-08-05 14:56:21

+0

它只是錯字 它應該是NoValidationBehavior和NoValidationBehavior 如果我把評論<! - kind =「webHttpEndpoint」 - >到端點標記,然後引發configurationErrorsException消息「標準端點/ webHttpEndpoint端點沒有配置端點名爲'NoValidationBehavior',這對endpointConfiguration來說是無效的。「 ????? – igor 2010-08-06 07:07:34

+0

也許它與WCF 4.0中的一些新功能有關! – igor 2010-08-06 07:34:16

回答

1

我想我們已經解決了它msdn forum。對於你的評論問題:endpointConfiguration和kind屬性確實與WCF 4.0有關。它涉及稱爲standardEndpoints的新功能,它允許定義「端點模板」。