Gi guys
Hi all, This is my problem: I try to create the Msxml 4.0 object in an vb.net class in an asp.net project and it return the following error message: System.UnauthorizedAccessException: Access is denied. at MSXML2.ServerXMLHTTP40Class.send(Object varBody) I've already tried to low the security setting of the internet explorer on the server, but nothing
I am using a Client Security Certificate for accesing a secure web site
Here is my Code
Private Function SendBatch(ByVal strBatchFilePath As String, Optional ByVal intTransportID As Integer = 0) As String
Dim objRead As New StreamReader(strBatchFilePath)
Dim sLines As String
Dim i As Integer
'intTransportID=0 S0AP
'1=HTTP Transport
If intTransportID = 0 Then
For i = 0 To 13
sLines = objRead.ReadLine() 'Skipping first 14 lines
Next
End If
sLines = objRead.ReadToEnd()
'Dim msgDoc As CDO.Message = LoadMIME(strBatchFilePath)
Dim xmlHTTP As New MSXML2.ServerXMLHTTP40
'Load message doc
xmlHTTP.open("POST", sBatchServletURL, False)
xmlHTTP.setOption(MSXML2.SERVERXMLHTTP_OPTION.SXH_OPTION_SELECT_CLIENT_SSL_CERT, sCertName)
If intTransportID = 0 Then
'SOAP Transport
xmlHTTP.setRequestHeader("SOAPAction", " Else 'HTTP Transport
''HTTPS Transport
xmlHTTP.setRequestHeader("Content-Type", "application/x- xmlHTTP.setRequestHeader("Content-Length", Len(sLines))
End If
xmlHTTP.send(sLines) 'msgDoc.GetStream.ReadText
SendBatch = xmlHTTP.responseText
End Function
Nouman Zaheer
Software Engineer
MSR
Hi all, This is my problem: I try to create the Msxml 4.0 object in an vb.net class in an asp.net project and it return the following error message: System.UnauthorizedAccessException: Access is denied. at MSXML2.ServerXMLHTTP40Class.send(Object varBody) I've already tried to low the security setting of the internet explorer on the server, but nothing
I am using a Client Security Certificate for accesing a secure web site
Here is my Code
Private Function SendBatch(ByVal strBatchFilePath As String, Optional ByVal intTransportID As Integer = 0) As String
Dim objRead As New StreamReader(strBatchFilePath)
Dim sLines As String
Dim i As Integer
'intTransportID=0 S0AP
'1=HTTP Transport
If intTransportID = 0 Then
For i = 0 To 13
sLines = objRead.ReadLine() 'Skipping first 14 lines
Next
End If
sLines = objRead.ReadToEnd()
'Dim msgDoc As CDO.Message = LoadMIME(strBatchFilePath)
Dim xmlHTTP As New MSXML2.ServerXMLHTTP40
'Load message doc
xmlHTTP.open("POST", sBatchServletURL, False)
xmlHTTP.setOption(MSXML2.SERVERXMLHTTP_OPTION.SXH_OPTION_SELECT_CLIENT_SSL_CERT, sCertName)
If intTransportID = 0 Then
'SOAP Transport
xmlHTTP.setRequestHeader("SOAPAction", " Else 'HTTP Transport
''HTTPS Transport
xmlHTTP.setRequestHeader("Content-Type", "application/x- xmlHTTP.setRequestHeader("Content-Length", Len(sLines))
End If
xmlHTTP.send(sLines) 'msgDoc.GetStream.ReadText
SendBatch = xmlHTTP.responseText
End Function
Nouman Zaheer
Software Engineer
MSR