Problem with connect to webserwice (currencyconverter.kowabunga.net) RRS feed

  • Question

  • Hello,

    I'm trying to use C # and VS Community 2017 to connect to webservers (http://currencyconverter.kowabunga.net/converter.asmx) and get a list of currencies (GetCurrencies).

    private void button1_Click (object sender, EventArgs e)
                TestWebserwice.ServiceReference1.ConverterSoapClient client = new TestWebserwice.ServiceReference1.ConverterSoapClient ("ConverterSoap12");

                var response1 = client.GetCurrencies ();

                var result2 = MessageBox.Show (response1.ToString ());

    In response (
    var response1 = client.GetCurrencies ();), I get the error:

    System.ServiceModel.Security.MessageSecurityException: 'The HTTP request was forbidden with client authentication scheme' Anonymous '.'

    WebException: The remote server returned an error: (403) Forbidden.

    There are no errors when trying to download data with the curl.

    curl --verbose -GET currencyconverter.kowabunga.net/converter.asmx/GetCurr
    * Trying ...
    * TCP_NODELAY set
    * Connected to currencyconverter.kowabunga.net ( port 80 (# 0)
    > GET /converter.asmx/GetCurrencies? HTTP / 1.1
    > Host: currencyconverter.kowabunga.net
    > User-Agent: curl / 7.58.0
    > Accept: * / *
    <HTTP / 1.1 200 OK
    <Cache-Control: private, max-age = 0
    <Content-Type: text / xml; charset = utf-8
    <Server: Microsoft-IIS / 7.5
    <X-AspNet-Version: 2.0.50727
    <X-Powered-By: ASP.NET
    <P3P: CP = "NID DSP COR"
    <Date: Tue, 01 Jan 2019 19:42:07 GMT
    <Connection: close
    <Content-Length: 1160
    <? xml version = "1.0" encoding = "utf-8"?>
    <ArrayOfString xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xmlns: xsd = "http://www.w3.org/2001/XMLSchema" xmlns = "http: // tempuri .org / ">
      <String> AUD </ string>
      <String> BGN </ string>
      <String> BRL </ string>
      <String> CAD </ string>


    Curl does not need any authentication.

    What am I doing wrong in C#?


    Tuesday, January 1, 2019 9:07 PM

All replies

  • Please check whether you've bypass authentication on OPTION call on your webservice side.


    For web request across different origin, the browser will issue an "OPTION" request to the server first to acquire CORS settings (known as "preflight"). Unfortunately OPTION request will not carry the authentication related headers, so you have to add override on global.asax to bypass authentication for this verb.

    Wednesday, January 2, 2019 2:20 AM
  • Hi mdo12,

    Thank you for posting here.

    Since your question is more related to web service, you could post a new thread in web service forum for suitable support.


    The Visual C# forum discuss and ask questions about the C# programming language, IDE, libraries, samples, and tools.

    Best Regards,


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, January 2, 2019 5:58 AM