I'm trying to consume a Soap Ws that uses wsse security for authentication. The connection with SoapUI is Okay but when i try to implement it in my asmx project, an exception occures saying that "System.InvalidOperationException: Le nom d'utilisateur n'est pas fourni." Username is not furnished. A screendshot from SoapUI : enter image description here
And here is my web.config, actually, i set the security header statically from web.config
<binding name="ConsultInfoAboBTEndpointServiceSoapBinding">
<security mode="TransportWithMessageCredential">
<message clientCredentialType="UserName"/>
</security>
and
<endpoint address="https://10.3.8.95:8443/services/consultInfoAboBT"
binding="basicHttpBinding" bindingConfiguration="ConsultInfoAboBTEndpointServiceSoapBinding"
contract="WS_STEG_ConsultInfoRef.ConsultInfoAboBTEndpoint" name="ConsultInfoAboBTEndpointPort" >
<headers>
<wsse:UsernameToken xmlns:wsse='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd' >
<wsse:Username>website</wsse:Username>
<wsse:Password Type='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText'>
website_password
</wsse:Password>
</wsse:UsernameToken>
Thank you in advance for your help.