How to use a web service (SOAP 1.1, WS-Security) from C # based on WSDL?

I have a WSDL for a web service ( https://facturaelectronica.dian.gov.co/habilitacion/B2BIntegrationEngine/FacturaElectronica/facturaElectronica.wsdl ) which indicates that it is SOAP 1.1 and should use WS-Security.

The resulting SOAP header should look like this:

<soapenv:Header>
  <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401wss-wssecurity-secext-1.0.xsd">
    <wsse:UsernameToken>
      <wsse:Username>8ac82326-3016-430f-8d69-9efc4bcefd8f</wsse:Username>
      <wsse:Password>6361b7b5322acb07ced00a35a85a4cc5183da3a42ede0b07f5780 67a18425a55</wsse:Password>
      <wsse:Nonce>FmbZRkx1jh2A+imgjD2fLQ==</wsse:Nonce>
      <wsu:Created>2015-07-31T16:34:33.762Z</wsu:Created>
    </wsse:UsernameToken>
  </wsse:Security>
</soapenv:Header>

Any suggestions on how to do this in C #? (Tried to use WSE3.0 and WCF, but did not work)

Thank.

Louis

+4
source share

Source: https://habr.com/ru/post/1650194/


All Articles