Consume Web service using C# RRS feed

  • Question

  • Hi All,

    I need to consume one web service in my C# application through Visual Studio.
    I have been provided one URL of web service and an Access Token for that.

    Kindly suggest me how do I consume in my App.


    Wednesday, August 29, 2018 10:11 AM

All replies

  • it is where you can post.

    Wednesday, August 29, 2018 10:15 AM
  • Expand your project -> Right Click on Reference -> select Add Service Reference

    On Add Service Reference dialog - Enter Service URL and Click Go. It will search for Service and return Services/Operations in your service. Provide meaningful name to your Service reference and Click OK

    Let us know if this is what you are looking for. OR share exact ask to help resolve your concern.

    Vivek Bansod
    Blog | MSDN | LinkedIn

    Wednesday, August 29, 2018 10:25 AM
  • Hi Vivek,

    Thanks for the suggestion.

    I did the same but getting an error while adding service reference.


    This web service I am getting from Magento 2.


    The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was ''.
    The remote server returned an error: (401) Unauthorized.
    If the service is defined in the current solution, try building the solution and adding the service reference again.


    Wednesday, August 29, 2018 11:16 AM
  • OK

    Service is in same solution or IIS hosted?

    Also take a look at this forum thread -

    Vivek Bansod
    Blog | MSDN | LinkedIn

    Wednesday, August 29, 2018 12:20 PM
  • So you're trying to host the web service yourself? That is a completely different question from trying to consume it. For questions related to hosting and running a web service please post in the ASP.NET forums.

    Michael Taylor

    Wednesday, August 29, 2018 1:56 PM
  • Please Verify all these steps.

    1) You must authorized to access the service.

    2) Your network allow you to access your/3rd party service.

    If still facing the Issue then let us know . Happy to help you.

    Thursday, August 30, 2018 5:43 AM