Connection to the WCF service, the unit Security. What's the problem?

Good day to all. Trying to connect to the WCF service uses the WS-Security standard. For signing requests, the certificate is used:
<clientcredentials>
 <clientcertificate x509findtype="FindBySubjectName" storelocation="CurrentUser" storename="My" findvalue="Test NBCH - 2016-07">
<servicecertificate>
 <authentication certificatevalidationmode="None">
</authentication></servicecertificate>
</clientcertificate></clientcredentials>

Here the mount point itself:
<endpoint address="https://ips.rosminzdrav.ru/5358bf30e7897" behaviorconfiguration="ipsErBeh" binding="wsHttpBinding" bindingconfiguration="newBinding" contract="ipsWorkMisService.misInterface" name="ipsWorkEndPoint"></endpoint>

And used binding:
<wshttpbinding>
 <binding name="newBinding" maxreceivedmessagesize="2147483647" messageencoding="Text">
 <security mode="TransportWithMessageCredential"> 
 <message clientcredentialtype="Certificate">
</message></security>
</binding>
</wshttpbinding>

Block Security zakidyvaya necessary:
ipsWorkMisService.misInterfaceClient ms = new misInterfaceClient("ipsWorkEndPoint");

if (security != null)
{
 X509SecurityTokenParameters tokenParameters = new X509SecurityTokenParameters();
 tokenParameters.InclusionMode = SecurityTokenInclusionMode.AlwaysToRecipient;
 tokenParameters.RequireDerivedKeys = false;
security.EndpointSupportingTokenParameters.SignedEncrypted.Add(tokenParameters);
 security.EndpointSupportingTokenParameters.SignedEncrypted.Add(new UserNameSecurityTokenParameters());
}
ms.Endpoint.Binding = new CustomBinding(elements.ToArray());

But when trying to connect, the server gives the error "Check security block not found header element\TransportHeader". Please tell what could be wrong? The header element in place, as I understand it. Thanks in advance for your answers!
June 14th 19 at 20:15
1 answer
June 14th 19 at 20:17
Try to change the configuration of the security element to:
<security mode="Transport"> 
 <transport clientcredentialtype="Certificate">
</transport></security>


See link: Transport Security with Certificate Authentication

Find more questions by tags .NETC#WCF