I have to make a client for a WSDL. But I keep getting a "No Security header in message but required by policy."
Here is my code
USImportoerService service = new USImportoerService();
X509Certificate2 cert = new X509Certificate2(certPath, PASSWORD, X509KeyStorageFlags.MachineKeySet);
service.ClientCertificates.Add(cert);
var result = ser.getUSKoeretoej();
And heres the App.config
<configuration>
<system.serviceModel>
<bindings>
<customBinding>
<binding name="USImportoerService_Port">
<security authenticationMode="CertificateOverTransport" securityHeaderLayout="LaxTimestampLast" includeTimestamp="true"
enableUnsecuredResponse="true">
</security>
<textMessageEncoding messageVersion="Soap11" />
<httpsTransport />
</binding>
</customBinding>
</bindings>
<client>
<endpoint address="HTTPS TO WSDL"
binding="customBinding" bindingConfiguration="USImportoerService_Port"
contract="ServiceReferenceUSImportoer.USImportoerServiceType"
name="Port1" />
</client>
</system.serviceModel>
Hope someone can help