none
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.

    Thanks
    Gautam

    Wednesday, August 29, 2018 10:11 AM

All replies

  • it is where you can post.

    https://forums.asp.net/28.aspx/1?WCF+ASMX+and+other+Web+Services

    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.


    Thanks,
    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.

    URL:-
    http://localhost:81/magento2-2.2.5/soap/default?wsdl&services=customerCustomerMetadataV1

    This web service I am getting from Magento 2.

    Error:-

    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.

    Thanks
    Gautam


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

    Service is in same solution or IIS hosted?

    Also take a look at this forum thread - 

    https://forums.asp.net/t/1302832.aspx?The+authentication+header+received+from+the+server+was+Negotiate+NTLM


    Thanks,
    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 http://www.michaeltaylorp3.net

    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