Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > The underlying connection as closed: Could not establish secure channel for SSL/TLS

Reply
Thread Tools

The underlying connection as closed: Could not establish secure channel for SSL/TLS

 
 
Ghislain Tanguay
Guest
Posts: n/a
 
      07-28-2004
Ok, I try to communicate with a web service who receive xml message under a
https using SSL.

I have a directory with 240 XML files on my desktop. I loop into it to send
each file one by one.

Abritrary, after 10, 15, 56, 79.... files, (sometimes I can pass all of
them??? ) I receive this error :

The underlying connection as closed: Could not establish secure channel for
SSL/TLS

I tried to connectiong to the webservice once for all the files, then i
tried to open a connection for
every file, same result.

Anyone have an idea of what's going on? Is it my code or the webservice?

Tks

Here is my code.

//////////////////////////////////// MessagerieService class generate by
WSDL ////////////////////////////////////////////////

Public Sub New(ByVal _Url As String, ByVal _UserName As String, ByVal
_PassWord As String)
MyBase.New()
Me.Url = _Url
Me.Credentials = New NetworkCredential(_UserName, _PassWord)
strNomUtil = _UserName
strMotPs = _PassWord
End Sub


<System.Web.Services.Protocols.SoapRpcMethodAttrib ute("",
RequestNamespace:="urn:Messagerie", ResponseNamespace:="urn:Messagerie")> _
Public Function SendindMessage(ByVal nomFile As String, _
ByVal msg As String) _
As
<System.Xml.Serialization.SoapElementAttribute("re sult")> String

Dim results() As Object = Me.Invoke("SendindMessage", New Object()
{nomFile, msg})
Return CType(results(0), String)

End Function

////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////


This is my class who encapsulate the proxy class

////////////////////////////////////////////////////// ServiceWeb Class
//////////////////////////////////////////////////////////

Public Sub New(ByVal _Url As String, _
ByVal _NomUtil As String, _
ByVal _MotPs As String)

strUrl = _Url
strUtil = _NomUtil
strMotPs = _MotPs
End Sub


Public Function SendindMessage(ByVal _nomFile As String, ByVal _msg As
String) As String

msg = New MessagerieService(strUrl, strUtil, strMotPs)
Return msg.SendindMessage(_nomFile, _msg)

End Function

////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
///////


/////////////////////////////////////////////// My form who call my
ServiceWeb ////////////////////////////////////////////////////////

Private Sub SendindMessage(ByVal _Fichier() As String)
Dim intFile As Integer = _Fichier.Length
Dim intCtr As Integer
Dim strTest As String

For intCtr = 0 To intFile - 1
Try
Dim sr As New StreamReader(File.OpenRead(_Fichier(intCtr)))
Dim msg As New ServiceWeb(txtUrl.Text,
txtNomUtilisateur.Text, txtMotPasse.Text)
txtIdMessage.Text = msg.SendindMessage(txtNomDeFile.Text,
sr.ReadToEnd)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
Next
MessageBox.Show("Success")
End Sub

////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////


 
Reply With Quote
 
 
 
 
Feroze [msft]
Guest
Posts: n/a
 
      07-28-2004
What is the webserver which is hosting the webservice ?

feroze
======================
This posting is provided as-is. It offers no warranties and confers no
rights.


"Ghislain Tanguay" <(E-Mail Removed)> wrote in
message news:(E-Mail Removed)...
> Ok, I try to communicate with a web service who receive xml message under

a
> https using SSL.
>
> I have a directory with 240 XML files on my desktop. I loop into it to

send
> each file one by one.
>
> Abritrary, after 10, 15, 56, 79.... files, (sometimes I can pass all of
> them??? ) I receive this error :
>
> The underlying connection as closed: Could not establish secure channel

for
> SSL/TLS
>
> I tried to connectiong to the webservice once for all the files, then i
> tried to open a connection for
> every file, same result.
>
> Anyone have an idea of what's going on? Is it my code or the webservice?
>
> Tks
>
> Here is my code.
>
> //////////////////////////////////// MessagerieService class generate by
> WSDL ////////////////////////////////////////////////
>
> Public Sub New(ByVal _Url As String, ByVal _UserName As String, ByVal
> _PassWord As String)
> MyBase.New()
> Me.Url = _Url
> Me.Credentials = New NetworkCredential(_UserName, _PassWord)
> strNomUtil = _UserName
> strMotPs = _PassWord
> End Sub
>
>
> <System.Web.Services.Protocols.SoapRpcMethodAttrib ute("",
> RequestNamespace:="urn:Messagerie", ResponseNamespace:="urn:Messagerie")>

_
> Public Function SendindMessage(ByVal nomFile As String, _
> ByVal msg As String) _
> As
> <System.Xml.Serialization.SoapElementAttribute("re sult")> String
>
> Dim results() As Object = Me.Invoke("SendindMessage", New Object()
> {nomFile, msg})
> Return CType(results(0), String)
>
> End Function
>
>

////////////////////////////////////////////////////////////////////////////
> ///////////////////////////////////////////////////////////////////////
>
>
> This is my class who encapsulate the proxy class
>
> ////////////////////////////////////////////////////// ServiceWeb Class
> //////////////////////////////////////////////////////////
>
> Public Sub New(ByVal _Url As String, _
> ByVal _NomUtil As String, _
> ByVal _MotPs As String)
>
> strUrl = _Url
> strUtil = _NomUtil
> strMotPs = _MotPs
> End Sub
>
>
> Public Function SendindMessage(ByVal _nomFile As String, ByVal _msg As
> String) As String
>
> msg = New MessagerieService(strUrl, strUtil, strMotPs)
> Return msg.SendindMessage(_nomFile, _msg)
>
> End Function
>
>

////////////////////////////////////////////////////////////////////////////
>

////////////////////////////////////////////////////////////////////////////
> ///////
>
>
> /////////////////////////////////////////////// My form who call my
> ServiceWeb ////////////////////////////////////////////////////////
>
> Private Sub SendindMessage(ByVal _Fichier() As String)
> Dim intFile As Integer = _Fichier.Length
> Dim intCtr As Integer
> Dim strTest As String
>
> For intCtr = 0 To intFile - 1
> Try
> Dim sr As New

StreamReader(File.OpenRead(_Fichier(intCtr)))
> Dim msg As New ServiceWeb(txtUrl.Text,
> txtNomUtilisateur.Text, txtMotPasse.Text)
> txtIdMessage.Text = msg.SendindMessage(txtNomDeFile.Text,
> sr.ReadToEnd)
> Catch ex As Exception
> MessageBox.Show(ex.Message)
> End Try
> Next
> MessageBox.Show("Success")
> End Sub
>
>

////////////////////////////////////////////////////////////////////////////
>

////////////////////////////////////////////////////////////////////////////
> ////////
>
>



 
Reply With Quote
 
 
 
 
Ghislain Tanguay
Guest
Posts: n/a
 
      07-29-2004
The web server is as Java web server

https://wsa.sei.pes.qc/sei/servlet/rpcrouter





"Ghislain Tanguay" <(E-Mail Removed)> a écrit dans
le message de news:(E-Mail Removed)...
> Ok, I try to communicate with a web service who receive xml message under

a
> https using SSL.
>
> I have a directory with 240 XML files on my desktop. I loop into it to

send
> each file one by one.
>
> Abritrary, after 10, 15, 56, 79.... files, (sometimes I can pass all of
> them??? ) I receive this error :
>
> The underlying connection as closed: Could not establish secure channel

for
> SSL/TLS
>
> I tried to connectiong to the webservice once for all the files, then i
> tried to open a connection for
> every file, same result.
>
> Anyone have an idea of what's going on? Is it my code or the webservice?
>
> Tks
>
> Here is my code.
>
> //////////////////////////////////// MessagerieService class generate by
> WSDL ////////////////////////////////////////////////
>
> Public Sub New(ByVal _Url As String, ByVal _UserName As String, ByVal
> _PassWord As String)
> MyBase.New()
> Me.Url = _Url
> Me.Credentials = New NetworkCredential(_UserName, _PassWord)
> strNomUtil = _UserName
> strMotPs = _PassWord
> End Sub
>
>
> <System.Web.Services.Protocols.SoapRpcMethodAttrib ute("",
> RequestNamespace:="urn:Messagerie", ResponseNamespace:="urn:Messagerie")>

_
> Public Function SendindMessage(ByVal nomFile As String, _
> ByVal msg As String) _
> As
> <System.Xml.Serialization.SoapElementAttribute("re sult")> String
>
> Dim results() As Object = Me.Invoke("SendindMessage", New Object()
> {nomFile, msg})
> Return CType(results(0), String)
>
> End Function
>
>

////////////////////////////////////////////////////////////////////////////
> ///////////////////////////////////////////////////////////////////////
>
>
> This is my class who encapsulate the proxy class
>
> ////////////////////////////////////////////////////// ServiceWeb Class
> //////////////////////////////////////////////////////////
>
> Public Sub New(ByVal _Url As String, _
> ByVal _NomUtil As String, _
> ByVal _MotPs As String)
>
> strUrl = _Url
> strUtil = _NomUtil
> strMotPs = _MotPs
> End Sub
>
>
> Public Function SendindMessage(ByVal _nomFile As String, ByVal _msg As
> String) As String
>
> msg = New MessagerieService(strUrl, strUtil, strMotPs)
> Return msg.SendindMessage(_nomFile, _msg)
>
> End Function
>
>

////////////////////////////////////////////////////////////////////////////
>

////////////////////////////////////////////////////////////////////////////
> ///////
>
>
> /////////////////////////////////////////////// My form who call my
> ServiceWeb ////////////////////////////////////////////////////////
>
> Private Sub SendindMessage(ByVal _Fichier() As String)
> Dim intFile As Integer = _Fichier.Length
> Dim intCtr As Integer
> Dim strTest As String
>
> For intCtr = 0 To intFile - 1
> Try
> Dim sr As New

StreamReader(File.OpenRead(_Fichier(intCtr)))
> Dim msg As New ServiceWeb(txtUrl.Text,
> txtNomUtilisateur.Text, txtMotPasse.Text)
> txtIdMessage.Text = msg.SendindMessage(txtNomDeFile.Text,
> sr.ReadToEnd)
> Catch ex As Exception
> MessageBox.Show(ex.Message)
> End Try
> Next
> MessageBox.Show("Success")
> End Sub
>
>

////////////////////////////////////////////////////////////////////////////
>

////////////////////////////////////////////////////////////////////////////
> ////////
>
>



 
Reply With Quote
 
suresh g
Guest
Posts: n/a
 
      09-03-2004
I have the same problem. Any suggestions are welcome.

Thanks
Suresh

"Ghislain Tanguay" wrote:

> The web server is as Java web server
>
> https://wsa.sei.pes.qc/sei/servlet/rpcrouter
>
>
>
>
>
> "Ghislain Tanguay" <(E-Mail Removed)> a écrit dans
> le message de news:(E-Mail Removed)...
> > Ok, I try to communicate with a web service who receive xml message under

> a
> > https using SSL.
> >
> > I have a directory with 240 XML files on my desktop. I loop into it to

> send
> > each file one by one.
> >
> > Abritrary, after 10, 15, 56, 79.... files, (sometimes I can pass all of
> > them??? ) I receive this error :
> >
> > The underlying connection as closed: Could not establish secure channel

> for
> > SSL/TLS
> >
> > I tried to connectiong to the webservice once for all the files, then i
> > tried to open a connection for
> > every file, same result.
> >
> > Anyone have an idea of what's going on? Is it my code or the webservice?
> >
> > Tks
> >
> > Here is my code.
> >
> > //////////////////////////////////// MessagerieService class generate by
> > WSDL ////////////////////////////////////////////////
> >
> > Public Sub New(ByVal _Url As String, ByVal _UserName As String, ByVal
> > _PassWord As String)
> > MyBase.New()
> > Me.Url = _Url
> > Me.Credentials = New NetworkCredential(_UserName, _PassWord)
> > strNomUtil = _UserName
> > strMotPs = _PassWord
> > End Sub
> >
> >
> > <System.Web.Services.Protocols.SoapRpcMethodAttrib ute("",
> > RequestNamespace:="urn:Messagerie", ResponseNamespace:="urn:Messagerie")>

> _
> > Public Function SendindMessage(ByVal nomFile As String, _
> > ByVal msg As String) _
> > As
> > <System.Xml.Serialization.SoapElementAttribute("re sult")> String
> >
> > Dim results() As Object = Me.Invoke("SendindMessage", New Object()
> > {nomFile, msg})
> > Return CType(results(0), String)
> >
> > End Function
> >
> >

> ////////////////////////////////////////////////////////////////////////////
> > ///////////////////////////////////////////////////////////////////////
> >
> >
> > This is my class who encapsulate the proxy class
> >
> > ////////////////////////////////////////////////////// ServiceWeb Class
> > //////////////////////////////////////////////////////////
> >
> > Public Sub New(ByVal _Url As String, _
> > ByVal _NomUtil As String, _
> > ByVal _MotPs As String)
> >
> > strUrl = _Url
> > strUtil = _NomUtil
> > strMotPs = _MotPs
> > End Sub
> >
> >
> > Public Function SendindMessage(ByVal _nomFile As String, ByVal _msg As
> > String) As String
> >
> > msg = New MessagerieService(strUrl, strUtil, strMotPs)
> > Return msg.SendindMessage(_nomFile, _msg)
> >
> > End Function
> >
> >

> ////////////////////////////////////////////////////////////////////////////
> >

> ////////////////////////////////////////////////////////////////////////////
> > ///////
> >
> >
> > /////////////////////////////////////////////// My form who call my
> > ServiceWeb ////////////////////////////////////////////////////////
> >
> > Private Sub SendindMessage(ByVal _Fichier() As String)
> > Dim intFile As Integer = _Fichier.Length
> > Dim intCtr As Integer
> > Dim strTest As String
> >
> > For intCtr = 0 To intFile - 1
> > Try
> > Dim sr As New

> StreamReader(File.OpenRead(_Fichier(intCtr)))
> > Dim msg As New ServiceWeb(txtUrl.Text,
> > txtNomUtilisateur.Text, txtMotPasse.Text)
> > txtIdMessage.Text = msg.SendindMessage(txtNomDeFile.Text,
> > sr.ReadToEnd)
> > Catch ex As Exception
> > MessageBox.Show(ex.Message)
> > End Try
> > Next
> > MessageBox.Show("Success")
> > End Sub
> >
> >

> ////////////////////////////////////////////////////////////////////////////
> >

> ////////////////////////////////////////////////////////////////////////////
> > ////////
> >
> >

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. Joel Barsotti ASP .Net 4 04-19-2007 11:12 PM
The underlying connection was closed: Could not establish secure channel for SSL/TLS. Jim Butler ASP .Net 7 07-12-2006 01:37 AM
Again: The underlying connection was closed: Could not establish secure channel for SSL/TLS jsanjosem@gmail.com ASP .Net Web Services 2 12-07-2005 10:11 AM
The underlying connection was closed: Could not establish secure channel for SSL/TLS C.W. ASP .Net Web Services 1 08-15-2005 04:23 AM
The underlying connection was closed: Could not establish secure channel for SSL/TLS C.W. ASP .Net 1 08-15-2005 04:23 AM



Advertisments