function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
esimplestesimplest 

ERROR: Could not establish trust relationship with remote server?

Hi,

I am receiving this error when trying to login?
"The underlying connection was closed: Could not establish trust relationship with remote server."

Here is my code!

Public sForce As New com.salesforce.na1.SforceService() 'create a instance of the connector proxy

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

'The returned value from the Login call will be an array of objects.
Dim loginresult

Try
loginresult = sForce.login("chandra@esimplest.com", "password")

Catch ex As System.Web.Services.Protocols.SoapHeaderException
'This is typical error handling for fault detection and reporting, the .Net Proxy client actually throws an
'error rather than return the fault SOAP Message.

Label1.Text = "The server returned the following fault information:"
Label1.Text = Label1.Text & "<br>Fault Code: " & CType(CType(ex, System.Web.Services.Protocols.SoapException).Code, System.Xml.XmlQualifiedName).Name()
Label1.Text = Label1.Text & "Fault string: " & ex.Message

Catch ex As Exception
Label1.Text = ex.Message
End Try

End Sub

DevAngelDevAngel

Hi esimplest,

This sounds like ssl certificate problems.  What url are you hitting?

esimplestesimplest

Is this what you mean the URL i am referring? This is in my reference.map file.
Please advice.

<?xml version="1.0" encoding="utf-8"?>
<DiscoveryClientResultsFile xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Results>
<DiscoveryClientResult referenceType="System.Web.Services.Discovery.ContractReference" url="https://na1.salesforce.com/soap/wsdl.jsp?type=*" filename="wsdl.wsdl" />
</Results>
</DiscoveryClientResultsFile>

DevAngelDevAngel

Hi esimplest,

Actually, in the proxy created by Visual Studio .Net, there is a class that is call webreference.vb or webreference.cs depending on the language you are using.  In the constructor method for that class there is a url that is set that defines the initial endpoint for the web service.  That url should read: https://www.salesforce.com/services/Soap/c/2.5 for the enterprise wsdl and https://www.salesforce.com/services/Soap/u/2.5 for the partner wsdl.  Your generated class should have this url.  If not you can either modify it or regenerate your wsdl and re-add(?) the web reference to that newly generated wsdl.

Cheers

esimplestesimplest

I am still receiving the same error, although i reconfirmed the URL and its the same as you mentioned in your last message.

Does this something to do if I access the internet using a proxy server?