• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 516
  • Last Modified:

Proxy Authentication require error...

Hi when I run this routine:

 private void VoicepayCCProcess(string sRecordline, string sRequeststring)
        {
            try
            {
                string result;

                HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://secure.voice-pay.com/gateway/remote_auth");
                request.ContentType = "application/x-www-form-urlencoded";
                request.Method = "POST";

                using (StreamWriter writer = new StreamWriter(request.GetRequestStream()))
                {
                    writer.Write(sRequeststring);
                }
               
                HttpWebResponse response = (HttpWebResponse)request.GetResponse();
                using (StreamReader reader = new StreamReader(response.GetResponseStream()))
                {
                    result = reader.ReadToEnd();
                }

                // Once we get response back from the voicepay we can construct the output file line by line.
                WriteToFile(sRecordline, result);
            }
            catch (WebException ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

On this line:  using (StreamWriter writer = new StreamWriter(request.GetRequestStream()))

I'm getting this error:
the remote server returned an error 407 proxy authentication required

Can you  help me please.
0
ube100
Asked:
ube100
  • 2
2 Solutions
 
Sikhumbuzo NtsadaSenior IT TechnicianCommented:
If you are behind an ISA server then you need to allow https traffic through if it is already allowed then you need to monitor and see what other traffic is being sent and received.
0
 
Sikhumbuzo NtsadaSenior IT TechnicianCommented:
Allow ssl-tunnel trough your proxy server. I checked it again my proxy.
0
 
ube100Author Commented:
what is ISA server. I'm just working at my work place and I don't know anything about these settings.
If you just tell me how please.
0
 
klakkasCommented:
This was such a weird error to handle when I came across it a few weeks ago...

Add this into your app.config file:
system.net>
  <defaultProxy
    useDefaultCredentials="true" >
  </defaultProxy>
</system.net>

And all should work fine...
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now