Skip to main content

Hi All,

I am trying to integrate the Web service using C#.Net and I am getting below error, Is anyone has a clue to solve this?

The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Basic realm="myrealm"'.

Please can you give us some more information?

 

Your code would probably be helpful.

 

Please block out any credential/URL


Hi @pranay ,

Have you added  the Authorization header in the web request?

 

Auth header format in the http request

Authorization: Basic Base64EncodeoUSERNAME:PASSWORD]

/Damith


Hi @dsj  and @Mike.Hollifield ,

 

thanks for the reply,  I did solve it, I was using the wrong link of the REST APIs. and also it had a permissions issue.

 

Thanks,

Pranay


Hi @pranay,

 

When you instantiate a service object you sould use  username and password for basic auth.

  var service = new YourService.YourServiceClient();

  service.ClientCredentials.UserName.UserName = username;
  service.ClientCredentials.UserName.Password = password;
 

Also check your bindings security in App.config file.

 

        <binding name="YourServicePortBinding" >
                    <security mode="Transport">
                        <transport clientCredentialType="Basic" />
                    </security>
         </binding>     

 

It should be like above.

 

ridvan

 

 

 

 

 


Reply