title: The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Basic
body: <p>**When i try to call the Web service with username and password in authentication it gives me 401 (authentication error ) where as same is working with Soap UI.
  My sample code and web.config is for reference  is for reference In Soap UI i am passing password and username in properties . ** </p>
  
  <pre><code>ExternalTransferInRequest requestbody = new ExternalTransferInRequest();
      requestbody.referenceTxnId = 123456789101112131;
      requestbody.userName = "5F4aS7QIfS32A4qlCP0BlaEX4qi+lV0p";
      requestbody.password = "1kZ+ZKKNe6zRqot9Qels1g==";
      requestbody.deviceType = 9;
      requestbody.amount = "5000";
      requestbody.mobileAccountNumber = "33319015910";
      requestbody.bankName = "00–Ubank";
      requestbody.bankAccountNumber = "051000207960141";
      ExternalTransferInRequest1 request = new ExternalTransferInRequest1();
      ExternalTransferInResponse resposebody = new ExternalTransferInResponse();
      ExternalTransferInResponse1 response = new ExternalTransferInResponse1();
      //Customer_PortClient proxy = new Customer_PortClient();
      ThirdPartyServicesMiddleWareSoapPortClient c = new ThirdPartyServicesMiddleWareSoapPortClient();
      ThirdPartyServicesMiddleWareSoapPort ts = c;
      c.ClientCredentials.UserName.UserName = "*************";
      c.ClientCredentials.UserName.Password = "********";
      //c.ClientCredentials.UserName.UserName = "smw.tp_services_pibas";
      //c.ClientCredentials.UserName.Password = "Sybase@365";
  
      response = ts.ExternalTransferIn(request);
      resposebody = response.ExternalTransferInResponse; 
  </code></pre>
  
  <p>Web.config</p>
  
  <pre><code> &lt;system.serviceModel&gt;
  &lt;bindings&gt;
    &lt;basicHttpBinding&gt;
      &lt;binding name="ThirdPartyServicesMiddleWareSoapPortSoap11" closeTimeout="00:01:00"
        openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
        allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
        maxBufferPoolSize="524288" maxBufferSize="65536" maxReceivedMessageSize="65536"
        textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"
        messageEncoding="Text"&gt;
        &lt;readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
          maxBytesPerRead="4096" maxNameTableCharCount="16384" /&gt;
        &lt;security mode="None"&gt;
          &lt;transport clientCredentialType="Basic" /&gt;
          &lt;message clientCredentialType="UserName" algorithmSuite="Default" /&gt;
        &lt;/security&gt;
      &lt;/binding&gt;
    &lt;/basicHttpBinding&gt;
  &lt;/bindings&gt;
  &lt;client&gt;
    &lt;endpoint address="http://**********:8083/mobiliser/thirdpartymw"
      binding="basicHttpBinding" bindingConfiguration="ThirdPartyServicesMiddleWareSoapPortSoap11"
      contract="TransferInSAP.ThirdPartyServicesMiddleWareSoapPort"
      name="ThirdPartyServicesMiddleWareSoapPortSoap11" /&gt;
  &lt;/client&gt;
  </code></pre>
  
  <p></p>