Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.net 为什么WCF让我在客户端的servicePrincipalName有一个空值?_.net_Wcf - Fatal编程技术网

.net 为什么WCF让我在客户端的servicePrincipalName有一个空值?

.net 为什么WCF让我在客户端的servicePrincipalName有一个空值?,.net,wcf,.net,Wcf,我正在尝试正确配置WCF客户端的标识。目前,我将客户端的标识设置为,但实际上没有为指定值 我的问题是,这是如何有效配置的?我能够成功地使用客户端,但我不明白为什么WCF允许我设置一个空的 客户端上的端点如下所示: <endpoint address="http://w30-7wfjwh1/KDMSPartService/PartService.svc" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_LargeD

我正在尝试正确配置WCF客户端的标识。目前,我将客户端的标识设置为
,但实际上没有为
指定值

我的问题是,这是如何有效配置的?我能够成功地使用客户端,但我不明白为什么WCF允许我设置一个空的

客户端上的端点如下所示:

   <endpoint address="http://w30-7wfjwh1/KDMSPartService/PartService.svc" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_LargeData"                
              contract="PartService.ICustomer" name="WSHttpBinding_ICustomer">
    <identity>
      <servicePrincipalName/>
    </identity>
  </endpoint>
  <wsHttpBinding>
    <binding name="WSHttpBinding_LargeData" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="99999999" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
      <readerQuotas maxDepth="128" maxStringContentLength="8192" maxArrayLength="163840000" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
      <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false"/>
      <security mode="Message">
        <transport clientCredentialType="Windows" proxyCredentialType="None" realm=""/>
        <message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" establishSecurityContext="true"/>
      </security>
    </binding>
<wsdl:port name="WSHttpBinding_ICustomer" binding="tns:WSHttpBinding_ICustomer">
  <soap12:address location="http://w30-7wfjwh1.internal.com/KDMSPartService/PartService.svc" />
  <wsa10:EndpointReference>
    <wsa10:Address>http://w30-7wfjwh1.internal.com/KDMSPartService/PartService.svc</wsa10:Address>
    <Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity">
      <Upn>kdmsdev@internal.com</Upn>
    </Identity>
  </wsa10:EndpointReference>
</wsdl:port>

客户端上的“WSHttpBinding_LargeData”配置如下所示:

   <endpoint address="http://w30-7wfjwh1/KDMSPartService/PartService.svc" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_LargeData"                
              contract="PartService.ICustomer" name="WSHttpBinding_ICustomer">
    <identity>
      <servicePrincipalName/>
    </identity>
  </endpoint>
  <wsHttpBinding>
    <binding name="WSHttpBinding_LargeData" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="99999999" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
      <readerQuotas maxDepth="128" maxStringContentLength="8192" maxArrayLength="163840000" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
      <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false"/>
      <security mode="Message">
        <transport clientCredentialType="Windows" proxyCredentialType="None" realm=""/>
        <message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" establishSecurityContext="true"/>
      </security>
    </binding>
<wsdl:port name="WSHttpBinding_ICustomer" binding="tns:WSHttpBinding_ICustomer">
  <soap12:address location="http://w30-7wfjwh1.internal.com/KDMSPartService/PartService.svc" />
  <wsa10:EndpointReference>
    <wsa10:Address>http://w30-7wfjwh1.internal.com/KDMSPartService/PartService.svc</wsa10:Address>
    <Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity">
      <Upn>kdmsdev@internal.com</Upn>
    </Identity>
  </wsa10:EndpointReference>
</wsdl:port>

该服务在名为“kdmsdev”的域用户下运行。从服务导出的WSDL如下所示:

   <endpoint address="http://w30-7wfjwh1/KDMSPartService/PartService.svc" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_LargeData"                
              contract="PartService.ICustomer" name="WSHttpBinding_ICustomer">
    <identity>
      <servicePrincipalName/>
    </identity>
  </endpoint>
  <wsHttpBinding>
    <binding name="WSHttpBinding_LargeData" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="99999999" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
      <readerQuotas maxDepth="128" maxStringContentLength="8192" maxArrayLength="163840000" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
      <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false"/>
      <security mode="Message">
        <transport clientCredentialType="Windows" proxyCredentialType="None" realm=""/>
        <message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" establishSecurityContext="true"/>
      </security>
    </binding>
<wsdl:port name="WSHttpBinding_ICustomer" binding="tns:WSHttpBinding_ICustomer">
  <soap12:address location="http://w30-7wfjwh1.internal.com/KDMSPartService/PartService.svc" />
  <wsa10:EndpointReference>
    <wsa10:Address>http://w30-7wfjwh1.internal.com/KDMSPartService/PartService.svc</wsa10:Address>
    <Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity">
      <Upn>kdmsdev@internal.com</Upn>
    </Identity>
  </wsa10:EndpointReference>
</wsdl:port>

http://w30-7wfjwh1.internal.com/KDMSPartService/PartService.svc
kdmsdev@internal.com
如能帮助您更好地了解WCF如何在客户端使用
,我们将不胜感激


谢谢。

我认为WCF将您的配置理解为“我不在乎对方是谁,只要他们在域中”。在使用Kerberos时完全省略元素实际上没有什么不同


如果您提供的值不匹配,我相信它将失败。

我找不到任何官方文档说明这一点,但我会接受您的回复。谢谢。是的,我也找不到任何支持它的东西,但我观察到了这种行为。