M
mdo12
Guest
Hello,
I'm trying to use C # and VS Community 2017 to connect to webservers (Converter Web Service) 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 69.40.221.191 ...
* TCP_NODELAY set
* Connected to currencyconverter.kowabunga.net (69.40.221.191) 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 = "XML Schema" xmlns = "http: // tempuri .org / ">
<String> AUD </ string>
<String> BGN </ string>
<String> BRL </ string>
<String> CAD </ string>
e.t.c.
Curl does not need any authentication.
What am I doing wrong in C#?
Regards,
Mariusz
Continue reading...
I'm trying to use C # and VS Community 2017 to connect to webservers (Converter Web Service) 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 69.40.221.191 ...
* TCP_NODELAY set
* Connected to currencyconverter.kowabunga.net (69.40.221.191) 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 = "XML Schema" xmlns = "http: // tempuri .org / ">
<String> AUD </ string>
<String> BGN </ string>
<String> BRL </ string>
<String> CAD </ string>
e.t.c.
Curl does not need any authentication.
What am I doing wrong in C#?
Regards,
Mariusz
Continue reading...