Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6832327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:50:44+00:00 2026-05-26T22:50:44+00:00

I am trying to consume a third party service like this: var context =

  • 0

I am trying to consume a third party service like this:

 var context = new DataSource(new Uri("http://api.olr.com/Service.svc"));

 context.Credentials = new NetworkCredential("username", "password", "http://api.olr.com/Service.svc");


 var agents = from a in context.Agents
                     select a;

 tbResponse.Text = agents.FirstOrDefault().ToString();

but getting reponse:

<div class="content-container"><fieldset>
 <h2>401 - Unauthorized: Access is denied due to invalid credentials.</h2>
 <h3>You do not have permission to view this directory or page using the credentials that you supplied.</h3>
</fieldset></div>
</div>

I tried to access the service using browser and it is working.

third parameter to following line is domain. what to put in domain ? the Service url as i did ?

context.Credentials = new NetworkCredential("username", "password", "http://api.olr.com/Service.svc");
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T22:50:44+00:00Added an answer on May 26, 2026 at 10:50 pm

    The NetworkCredential constructor is expecting username, password and domain but you are passing in the full Url instead of the domain.

    I would change that line to:

    context.Credentials = new NetworkCredential("username", "password", "olr.com");
    

    UPDATE – Solution that worked:

    context.Credentials = new NetworkCredential("username", "password");
    

    Was the solution.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use WCF to consume a web service provided by a third-party's
I am trying to consume a rest service which returns XMI data like this:
I'm trying to consume a third party web service with OracleAS web services. The
I am trying to consume my newly setup RESTful WCF service, located at [http://196.34.92.60/api/api/v1/public.svc/getoperators]
I am trying to use the Jersey client API to consume a third-party REST
I am trying to use RestSharp to consume a third-party REST web service and
I'm trying to consume and use a third party REST Json based API. I
I am trying consume a webservice hosted by http://www.webservicex.net/CurrencyConvertor.asmx?WSDL but eclipse showing The service
I am trying to consume a third party WSDL using the Weblogic 10.3 clientgen
I'm trying to consume some legacy XML with elements like this in JRuby: <x-doc

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.