CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> .NET

 Connect to Secure webservice

Print topic Send  topic

Author Message
eatkin

Posts: 3
Posted: 04/07/2009, 3:24 PM

I have an .net vb site that needs to connect to a secure web service to retrieve XML data.

In the CCS record beforeshow event we use an XMLReader to prefill some fields. This works fine from a local xml file, but I need to retrieve it from a URL of a third party using a certificate. I am fairly new to vb and don't know where to start to code the usage of the client certificate to allow the page to retrieve the required info.

The error i get is "System.Net.WebException: The request was aborted: Could not create SSL/TLS secure channel", which I assume is the requirement for the client cert.

Any guidance anyone can provide aroudn using a client certificate within a webpage to retrieve XML data from a secure site would be appreciated.

We are using .net 2.0, CCS 4.2

Thanks

Eric
View profile  Send private message
Vasiliy

Posts: 378
Posted: 04/09/2009, 11:13 AM

Code example:
________________________
' Ignore "Invalid SSL Certificate" issue
ServicePointManager.ServerCertificateValidationCallback = New RemoteCertificateValidationCallback(AddressOf ValidateCertificate)

' Call your web-service
Dim webservice As New DataExportProxy.DataExport()
webservice.BeginExecute(DataExportID, CustomFunctions.DatabaseSettings.GetClientVDir, Session("UserLogin"), UserPassword.ToString, Nothing, Nothing)
________________________

' DataExport Issue (Invalid SSL Certificate Issue)
Private Function ValidateCertificate(ByVal sender As Object, ByVal certificate As X509Certificate, ByVal chain As X509Chain, ByVal sslPolicyErrors As SslPolicyErrors) As Boolean
'Return True to force the certificate to be accepted.
Return True
End Function
________________________


_________________
Vasiliy
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.