1

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.

Hedi Jl
  • 29
  • 7
  • Possible duplicate of [WS-Security using the ASMX file in ASP.NET 3.5](https://stackoverflow.com/questions/2527029/ws-security-using-the-asmx-file-in-asp-net-3-5) and unfortunately if it was Java, I'd be able to help :-) - hopefully the link helps get you going - let me know if it does! – JGlass Nov 15 '18 at 17:21

0 Answers0