title: An error occurred when verifying security for the message error when connection to SOAP service (.NET 4.7)
body: <p>I was given a configuration of SOAP service, the configuration contained user name (in <code>domain\username</code> format), service address and password. I used Visual Studio, option <code>Add -&gt; Service Reference</code> to add the service to my project. I have the following auto-generated configuration in the <code>App.config</code> file.</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;
  &lt;configuration&gt;
      &lt;startup&gt; 
          &lt;supportedRuntime version=&quot;v4.0&quot; sku=&quot;.NETFramework,Version=v4.7.2&quot; /&gt;
      &lt;/startup&gt;
      &lt;system.serviceModel&gt;
          &lt;bindings&gt;
              &lt;basicHttpBinding&gt;
                  &lt;binding name=&quot;DdpBinding&quot; /&gt;
              &lt;/basicHttpBinding&gt;
          &lt;/bindings&gt;
          &lt;client&gt;
              &lt;endpoint address=&quot;http://server_name:8080/Gordic/Ginis/Ws/test/HULT/DDP01/Ddp.svc&quot;
                  binding=&quot;basicHttpBinding&quot; bindingConfiguration=&quot;DdpBinding&quot;
                  contract=&quot;GINIS_DDP_Test.DdpPortType&quot; name=&quot;DdpPort&quot; /&gt;
          &lt;/client&gt;
      &lt;/system.serviceModel&gt;
  &lt;/configuration&gt;
  </code></pre>
  <p>I added the following call to test the service.</p>
  <pre><code>class Program
  {
      static void Main(string[] args)
      {
          string username = &quot;DOMAIN\\username&quot;;
          string password = &quot;password&quot;;
  
          WakeupRequest requestXml = new WakeupRequest();
  
          using (var client = new DdpPortTypeClient())
          {
              client.ClientCredentials.UserName.UserName = username;
              client.ClientCredentials.UserName.Password = password;
              client.Wakeup();
          }
      }
  }
  </code></pre>
  <p>However, the last line throws the following error.</p>
  <pre><code>System.ServiceModel.FaultException: 'An error occurred when verifying security for the message.'
  </code></pre>
  <p>The developer of the software declares to implement the WS-Security standard, but I have no more information.</p>
  <p>What should I update to make the system work?</p>