Last post Apr 05, 2018 02:18 PM by bruce (sqlwork.com)
Nov 08, 2017 03:01 PM|Sebastien R|LINK
I'm using Visual Studio 2017
I have noticed that it was not possible to connect to a SOAP service from a .Net Core 2.0 when being behind a proxy (when connected directly to the internet it's working and when connecting through the proxy from a .Net Core 1.1 app it's working too).
I have created a little test program (Console app) that calls a public SOAP service (http://www.webservicex.net/globalweather.asmx).
By changing the target of this program (.Net Core 1.1 / .Net Core 2.0) I can reproduce the problem.
I have done a network capture (with Wireshark) and when this problem happens I can see no HTTP request coming out from my computer.
Does anybody know what is going wrong ? Maybe I am not calling this service the right way.
Thanks in advance
Nov 09, 2017 05:02 AM|Edward Z|LINK
>> By changing the target of this program (.Net Core 1.1 / .Net Core 2.0) I can reproduce the problem.
Could you share us detail steps to reproduce your issue from setting up proxy to creating test program? How did you set proxy, by IE proxy or behind load balance?
>> I have done a network capture (with Wireshark) and when this problem happens I can see no HTTP request coming out from my computer.
Where do you use Wireshark? Is it on your computer? It is strange that proxy will forbid Core app send request.
>> Maybe I am not calling this service the right way.
Do you use Connected Services to generate client code and send request?
Nov 09, 2017 06:33 AM|Sebastien R|LINK
Thanks for your answer.
This is the sample code (to call the web service) that I have put in a .Net Core console app:
binding = new
address = new
client = new
response = client.GetCitiesByCountryAsync("France").Result;
I have created the classes for connecting to the web service with VS 2017's Connected Services component.
On my computer, the connexion parameters are set to "Detect automatically"; I have not set up our proxy : it's based on a WPAD script.
I have done the Wireshark captures on my computer (when in .Net Core 1.1 or connected directly to internet with .Net Core 2.0 I can see the connection from my computer to the web service (but not when using .Net Core 2.0 behind the proxy)).
Nov 09, 2017 06:59 AM|Edward Z|LINK
>> On my computer, the connexion parameters are set to "Detect automatically"; I have not set up our proxy : it's based on a WPAD script.
I am not familiar with WPAD script, could you share us detail steps to configure it?
I am trying to reproduce this issue at my side.
Nov 09, 2017 07:15 AM|Sebastien R|LINK
Unfortunately I'm not familiar too with the proxy configuration and WPAD script (it has been configured this way by our infra team); but this could be replaced by a manual configuration of the proxy (configuration of the proxy's address and the credentials
for connecting to it (because we have these problems on our dev computers we can afford to have to set those parameters during the dev phase)).
During my tests I also tried to configure the proxy by hand (address and credentials) but to no avail.
Nov 10, 2017 05:36 AM|Edward Z|LINK
>> During my tests I also tried to configure the proxy by hand (address and credentials) but to no avail.
Do you use specific proxy server?
I make a test with Fiddler by Tools->Options->Gateway->Automatically Detect Proxy using WPAD, it works correctly. In my option, it will use proxy when you enable Fiddler, am I right?
Nov 10, 2017 06:49 AM|Sebastien R|LINK
Again, I don't know if our proxy is specific or if it is configured in a special way.
I did the same test than you : with Fiddler started and the Gateway option set to "Automatically Detect Proxy using WPAD" I have the same result : it's working with .Net Core 1.1 but not with .Net Core 2.0. The result is also the same when Fiddler's Gateway
option is set to "Use System Proxy".
Do you know how I can configure the proxy server and the proxy credentials by hand when connecting to a SOAP web service ? I tried to set property ProxyAddress of object BasicHttpBinding to the uri of my proxy server but this didn't work either.
Nov 10, 2017 07:32 AM|Edward Z|LINK
First, I would suggest you install the latest
Core SDK 2.0.2.
For proxy for WCF Client, I suggest you check below links.
# How to set proxy credentials to specific wcf client?
# [WCF]How to supply dedicated credentials for webproxy authentication in WCF client
Apr 04, 2018 03:49 PM|Looooooka|LINK
Apr 05, 2018 02:18 PM|bruce (sqlwork.com)|LINK