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
WCF从.Net 3.5迁移到4.0_Wcf - Fatal编程技术网

WCF从.Net 3.5迁移到4.0

WCF从.Net 3.5迁移到4.0,wcf,Wcf,刚刚迁移,现在我收到以下错误消息 带行动的信息'http://schemas.xmlsoap.org/ws/2005/02/trust/RST/SCT由于EndpointDispatcher上的ContractFilter不匹配,无法在接收器上处理。这可能是因为合同不匹配(发送方和接收方之间的操作不匹配)或发送方和接收方之间的绑定/安全不匹配。检查发送方和接收方是否具有相同的合同和相同的绑定(包括安全要求,例如消息、传输、无) 与3.5版本相比,其他方面几乎没有什么变化,但它仍然有效。我正在使用

刚刚迁移,现在我收到以下错误消息

带行动的信息'http://schemas.xmlsoap.org/ws/2005/02/trust/RST/SCT由于EndpointDispatcher上的ContractFilter不匹配,无法在接收器上处理。这可能是因为合同不匹配(发送方和接收方之间的操作不匹配)或发送方和接收方之间的绑定/安全不匹配。检查发送方和接收方是否具有相同的合同和相同的绑定(包括安全要求,例如消息、传输、无)

与3.5版本相比,其他方面几乎没有什么变化,但它仍然有效。我正在使用SSL、TransportWithMessageCredential和client Credentials=“UserName”
服务器端配置如下:

<system.serviceModel>
  <services>
   <service name="BPA.SCA.CFI.CFIWcfService" 
behaviorConfiguration="defaultSecure">

    <host>
      <baseAddresses>
    <add baseAddress="https://rdSlice.dev.local/SCACFI/"/>
        <!-- <add baseAddress="https://rdSlice.dev.local/SCACFI/"/> -->
      </baseAddresses>
    </host>

    <!-- Service Endpoints -->
    <!-- Unless fully qualified, address is relative to base address supplied above -->
    <endpoint address="" binding="wsHttpBinding" 
    bindingNamespace="https://rdSlice.bpa.gov"
    bindingConfiguration="SecureTransport"
            contract="BPA.SCA.CFIService.IManageSCACFI" >
      <identity>
        <dns value="localhost"/>
      </identity>
    </endpoint>

    <endpoint address="mex" 
    binding="mexHttpsBinding" 
    contract="IMetadataExchange"/>
  </service>
</services>

<behaviors>
  <serviceBehaviors>
    <behavior name="defaultSecure">
      <!-- To avoid disclosing metadata information, 
      set the value below to false and remove the metadata endpoint above before deployment -->
      <serviceMetadata httpGetEnabled="false" httpsGetEnabled="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="True"/>
  <dataContractSerializer maxItemsInObjectGraph="2147483646"/>
  <serviceCredentials>
        <userNameAuthentication
          userNamePasswordValidationMode="MembershipProvider"
          membershipProviderName="SCASqlMembershipProvider" />
      </serviceCredentials>

    </behavior>
  </serviceBehaviors>
</behaviors>

<bindings>
  <wsHttpBinding>
     <binding name="SecureTransport" 
            maxReceivedMessageSize="2147483647">
        <readerQuotas maxDepth="2147483647" 
    maxStringContentLength="2147483647"
            maxArrayLength="2147483647" 
    maxBytesPerRead="2147483647"
            maxNameTableCharCount="2147483647" />

        <security mode="TransportWithMessageCredential">
           <transport clientCredentialType="None" />
           <message establishSecurityContext="false" 
        clientCredentialType="UserName" />
        </security>

       </binding>
    </wsHttpBinding>
  </bindings>

</system.serviceModel>


您将您的基址显示为
https://rdSlice.dev,本地/SCACFI/
-是否应为
https://rdSlice.dev.local/SCACFI/
?(注意从逗号到句号的变化)

是的,这只是我问题中的一个输入错误。。。服务器上不是这样。谢谢,修好了。。