web services - Calling webservice in C# using SSL - '(401) Unauthorized' -


I am calling a method on a web service from behind the proxy server using the following code:

  myWebService.TestWebService webservice = New myWebService.TestWebService (); Webservice.Url = "http://test.com/webservice?wsdl"; WebProxy Proxy = New WebProxy ("1.2.3.4", 8080); Proxy Credential = new network credentials ("username", "password"); Webservice.Proxy = Proxy; String response = webservice.TestWebMethod ();  

It works fine when using HTTP, I'm expected in the 'response' string. However - I get the (401) unauthorized response if I change the URL to HTTPS .

If I work properly by using my browser this HTTP or HTPS

I have added the code to handle SSL certificate verification by creating a System.Net.ServicePointManager.ServerCertificateValidationClall repository but the code never comes away

any Also the help is really appreciated ...

You have to navigate to the SSL URL is required?
If this is the case, then you need to set up a web service credential set.

Did you try to add a web reference to Visual Studio using SSL URL?
If you can not add web references via Visual Studio, the code is not going to work either.

Can you make sure that the last thing you have is a proxy for the set (like setting proxy before changing the URL)?
There is a small chance of losing a proxy, this will be the last thing to try


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -