Clicky

hi all,

i working with a project which need to call a web service thru https. When i try to add the web reference thru the Visual Studio 2010 by right click the solution, add service reference ... -> add web reference i got the error on below:

There was an error downloading 'https://abc.com:7443?wsdl'.
The request was aborted: Could not create SSL/TLS secure channel.
There was an error downloading 'https://abc.com:7443?wsdl/$metadata'.
The request was aborted: Could not create SSL/TLS secure channel.


After googled, i change the way to consume the web service by programmatically as code below:


   
 using (SmsInterfaceService service = new SmsInterfaceService())                     {                         service.Url = "https://abc.com:7443?wsdl";                         X509Certificate2 clientCert = new X509Certificate2(@"D:\Host\123456789.p12", "abc123", X509KeyStorageFlags.MachineKeySet);                         service.ClientCertificates.Add(clientCert);                                                  ServicePointManager.Expect100Continue = true;                         ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;                          RequestObject req = new RequestObject();                         ResponseObject resp = new ResponseObject();                         req.fi = "4179";                         req.sequenceNo = DateTime.Now.ToString("yyyyMMdd");                                                  resp = service.cardEnquiry(req);                          Console.WriteLine("Transaction Description:{0}\nResponse Code:{1}\nDate:{2}", resp.transactionDesc, resp.responseCode, resp.date);                         service.ClientCertificates.Remove(clientCert);                         service.Dispose();                                                                         }                             
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 

Select allOpen in new window





This code work fine in my first call to the web service but when i call the code above for second time, it will throw an exception as below when i reach resp = service.cardEnquiry(req);


The request was aborted: Could not create SSL/TLS secure channel.


The 123456789.p12 cert i already installed in my current user and Local Computer account.


Please help.

asked 08/23/2011 06:52

mkdev2009's gravatar image

mkdev2009 ♦♦


3 Answers:
Is the service requiring the cert yours or third party?
link

answered

gspiteri's gravatar image

gspiteri

is a 3rd party cert
link

answered 2011-08-24 at 13:43:48

mkdev2009's gravatar image

mkdev2009

link

answered 2011-08-25 at 07:35:29

srosebabu's gravatar image

srosebabu

Your answer
[hide preview]

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

×19
×18

Asked: 08/23/2011 06:52

Seen: 351 times

Last updated: 12/17/2011 06:02