Skip to main content
Solved

Webservice Error

  • September 28, 2020
  • 4 replies
  • 1000 views

Forum|alt.badge.img+2

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"'.

Best answer by pranay

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

4 replies

Mike.Hollifield
Hero (Partner)
Forum|alt.badge.img+8

Please can you give us some more information?

 

Your code would probably be helpful.

 

Please block out any credential/URL


dsj
Ultimate Hero (Partner)
Forum|alt.badge.img+22
  • Ultimate Hero (Partner)
  • September 30, 2020

Hi @pranay ,

Have you added  the Authorization header in the web request?

 

Auth header format in the http request

Authorization: Basic Base64Encode[USERNAME:PASSWORD]

/Damith


Forum|alt.badge.img+2
  • Author
  • Do Gooder
  • Answer
  • October 1, 2020

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


Forum|alt.badge.img+6
  • Sidekick
  • October 30, 2020

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