Solved

Proxy Authentication require error...

Posted on 2011-02-22
4
505 Views
Last Modified: 2012-05-11
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
Comment
Question by:ube100
  • 2
4 Comments
 
LVL 17

Assisted Solution

by:Sikhumbuzo Ntsada
Sikhumbuzo Ntsada earned 50 total points
ID: 34950368
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
 
LVL 17

Expert Comment

by:Sikhumbuzo Ntsada
ID: 34950391
Allow ssl-tunnel trough your proxy server. I checked it again my proxy.
0
 

Author Comment

by:ube100
ID: 34950437
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
 
LVL 7

Accepted Solution

by:
klakkas earned 200 total points
ID: 34951058
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

27 Experts available now in Live!

Get 1:1 Help Now