0
我正在嘗試使用SOAP UI來調用WCF服務並獲取以下錯誤;不知道什麼是錯的。
錯誤:安全處理器無法在消息中找到安全標頭。這可能是因爲該消息是不安全的錯誤,或者是因爲通信方之間存在綁定不匹配。如果服務配置了安全性並且客戶端沒有使用安全性,則會發生這種情況。WCF - 錯誤安全處理器無法在郵件中找到安全標頭
web.config
<system.serviceModel>
<diagnostics performanceCounters="All">
<messageLogging logMalformedMessages="true" logMessagesAtTransportLevel="true"/>
<endToEndTracing propagateActivity="true" messageFlowTracing="true"/>
</diagnostics>
<behaviors>
<serviceBehaviors>
<behavior name="DefaultBehavior">
<!--<serviceThrottling maxConcurrentCalls="100" maxConcurrentInstances="200" maxConcurrentSessions="100"/>-->
<serviceAuthorization principalPermissionMode="Always"/>
<serviceCredentials useIdentityConfiguration="true">
<serviceCertificate findValue="localhost" storeLocation="LocalMachine" storeName="My" x509FindType="FindBySubjectName"/>
<issuedTokenAuthentication audienceUriMode="BearerKeyOnly" certificateValidationMode="PeerOrChainTrust" revocationMode="NoCheck"
trustedStoreLocation="LocalMachine" allowUntrustedRsaIssuers="false"></issuedTokenAuthentication>
</serviceCredentials>
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="false"/>
<bindings>
<ws2007FederationHttpBinding>
<binding name="wsFedBinding" receiveTimeout="00:10:00" sendTimeout="00:10:00" openTimeout="00:10:00" closeTimeout="00:10:00"
maxReceivedMessageSize="262144" maxBufferPoolSize="262144">
<readerQuotas maxArrayLength="16384" maxDepth="32" maxStringContentLength="262144" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
<security mode="TransportWithMessageCredential">
<message issuedKeyType="BearerKey" issuedTokenType="http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0"
negotiateServiceCredential="false" establishSecurityContext="false"/>
</security>
<security mode="None">
<!--<message negotiateServiceCredential="true"></message>-->
</security>
</binding>
</ws2007FederationHttpBinding>
<wsHttpBinding>
<binding name="wsHttpClientServiceBinding" receiveTimeout="00:10:00" sendTimeout="00:10:00" openTimeout="00:10:00" closeTimeout="00:10:00"
maxReceivedMessageSize="262144" maxBufferPoolSize="262144">
<readerQuotas maxArrayLength="16384" maxDepth="32" maxStringContentLength="262144" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
<security mode="Transport">
<transport clientCredentialType="None"></transport>
</security>
</binding>
</wsHttpBinding>
</bindings>
<services>
<service name="XXX.Service" behaviorConfiguration="DefaultBehavior">
<host>
<baseAddresses>
<add baseAddress="https://ws40022517..intranet/XXXX.Service/" />
</baseAddresses>
</host>
<endpoint address="" binding="ws2007FederationHttpBinding" bindingConfiguration="wsFedBinding"
contract="XXX.Contract.Vault.ServiceContract.IVaultService"/>
</service>
</services>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<directoryBrowse enabled="false"/>
<httpProtocol>
<customHeaders>
<add name="X-Content-Type-Options" value="nosniff"/>
</customHeaders>
</httpProtocol>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="NHibernate" publicKeyToken="aa95f207798dfdb4" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-3.3.1.4000" newVersion="3.3.1.4000"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.identityModel>
<identityConfiguration saveBootstrapContext="true">
<issuerNameRegistry type="System.IdentityModel.Tokens.ConfigurationBasedIssuerNameRegistry, System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<trustedIssuers>
<add thumbprint="XXXXC" name="SignCertificate"/>
</trustedIssuers>
</issuerNameRegistry>
<securityTokenHandlers>
<remove type="System.IdentityModel.Tokens.Saml2SecurityTokenHandler, System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
<add type="XXXX.OcdSaml2SecurityTokenHandler, XXX.WCFExtension"/>
</securityTokenHandlers>
<claimsAuthenticationManager type="XXXX.Security.SoapClaimsAuthenticationManager, XXXX"/>
</identityConfiguration>
</system.identityModel>
If I comment the TranportwithMessagesecurity and add just transport and none then it shows that channel endpoint not found.
本應在其下部分被添加? – user3264937
system.webserver – Vinoth
它不能在system.webserver下工作;標籤沒有被識別。配置錯誤 – user3264937