Question Why do I get 403.16 errror on http request?


Well-known member
Nov 13, 2006
Programming Experience
I have a legacy system that is not capable of making the HTTP request over SSL so we wrote an intermediate web service to receive the original HTTP request and then the new webservice makes an HTTP request with the certificate to the other end. I receive the legacy string which is a soap packet and I make the HTTP request to the final and point and I get a success reply text response and then after a couple of seconds I am supposed to get a full text message reply with some useful information. I do get the success but never get the information reply. The other end ( the end we send the http request to) states they are getting a 403 error seen here:

AcknowledgmentStatus = RETRY Text = The HTTP request was forbidden with client authentication scheme 'Anonymous'.
Exception: The HTTP request was forbidden with client authentication scheme 'Anonymous'.
Inner Exception: The remote server returned an error: (403) Forbidden.

In our iis log we do have this message:

2015-12-04 21:28:10 POST /GarResponseService.svc - 443 - - - 403 16 2148204809 349

this is the only code we have the controller that receives the legacy request and make the final http request to the other side.

       Dim loopctr As Integer = 0
        While loopctr < 3
                Dim webRequest As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create(_url)
                webRequest.Method = "POST"
                webRequest.ContentType = "text/xml; charset=utf-8"
                webRequest.ContentLength = content.Length
                webRequest.ClientCertificates.Add(New X509Certificate2(_certificatePath, _certificatePassword, X509KeyStorageFlags.MachineKeySet))
                webRequest.Timeout = 5000
                webRequest.Headers.Add("SOAPAction", "")

                Using sw As New StreamWriter(webRequest.GetRequestStream())
                End Using

                Using sr As New System.IO.StreamReader(webRequest.GetResponse().GetResponseStream)
                    Dim data = sr.ReadToEnd
                    Return New ContentResult() With {.Content = data, .ContentType = "text/plain"}
                End Using
            Catch ex As Exception
                loopctr += 1
                If loopctr = 3 Then Throw 
            End Try
        End While
        Return New ContentResult() With {.Content = "error thrown", .ContentType = "text/plain"}
Last edited:
Top Bottom