473,888 Members | 1,407 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

The Remote server returned an error :(407) Proxy Authentication Required

1 New Member
Hi, My name is krishna. I am using asp.net 2.0 with C#. I amusing Windows XP professional as OS. When I post some data to an external web server I get the error as "The Remote server returned an error :(407) Proxy Authentication Required ".

Here is the code I am using, Please help me out at the earliest.

Expand|Select|Wrap|Line Numbers
  1. public void JACCS_Response(string date,string jaccs_id,string irn,string company_id,string xmlid)
  2.        {
  4.            string responseString = string.Empty;
  6. // I am passing the following 4 parameters to the site.
  7.  string REQ_STR = "SEND_DATETIME=" + date + "&KAMEITEN_BANGO=" + company_id + "&JACCS_DENPYO_BANGO=" + jaccs_id + "&DENPYO_BANGO=" + irn;
  9.            try
  10.            {
  11.                HttpWebRequest webreq = (HttpWebRequest)WebRequest.Create(ConfigurationManager.AppSettings["someurl"].ToString());
  13. //The app.config file contains the URL to which I post the data
  15.                webreq.Method = "POST";
  16.                //WebProxy myProxy = new WebProxy(ConfigurationManager.AppSettings["proxy"].ToString(), 80);
  17.                WebProxy myProxy = new WebProxy("someproxy");
  19. //The proxy is specified in the app.config
  21.                //required only for local development
  22.                myProxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
  24.                //myProxy.Credentials = new NetworkCredential(ConfigurationManager.AppSettings["ProxyUID"].ToString(), ConfigurationManager.AppSettings["ProxyPwd"].ToString(), ConfigurationManager.AppSettings["ProxyDomain"].ToString());
  26.                webreq.Proxy = myProxy;
  29. //I specify the userid, password and the domain needed to access the external site
  30.  webreq.Credentials = new NetworkCredential(ConfigurationManager.AppSettings["userid"].ToString(), ConfigurationManager.AppSettings["pwd"].ToString(), ConfigurationManager.AppSettings["domain"].ToString());
  33.  byte[] byteArray = Encoding.GetEncoding("shift-jis").GetBytes(REQ_STR);
  35.                webreq.ContentLength = byteArray.Length;
  36.                webreq.ContentType = "application/x-www-form-urlencoded";
  38.                webreq.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; GoogleT5; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.2; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022)";
  40.                using (Stream myStream = webreq.GetRequestStream())
  41.                {
  42.                    try
  43.                    {
  44.                        myStream.Write(byteArray, 0, byteArray.Length);
  45.                        myStream.Flush();
  46.                    }
  47.                    catch (Exception e)
  48.                    {
  49.                        throw e;
  50.                    }
  51.                }
  53.                // Get the response.
  54.                HttpWebResponse response = (HttpWebResponse)webreq.GetResponse();
  56.                StreamReader ResponseStream = new StreamReader(response.GetResponseStream(), Encoding.GetEncoding("shift-jis"));
  57.                responseString = ResponseStream.ReadToEnd();
  58.                ResponseStream.Close();
  59.                response.Close();
  60.            }
  62.            catch (Exception ex)
  63.            {
  64.                 throw ex;
  65.            }
  66.            }
But when I do the above, I get the error as ""The Remote server returned an error :(407) Proxy Authentication Required ".

Kindly help me out.

casukhela krishna
Nov 3 '08 #1
2 5428
8,127 Recognized Expert Expert
Question moved to .NET forum.
Nov 3 '08 #2
Curtis Rutland
3,256 Recognized Expert Specialist
Please enclose your posted code in [CODE] [/CODE] tags (See How to Ask a Question).

This makes it easier for our Experts to read and understand it. Failing to do so creates extra work for the moderators, thus wasting resources, otherwise available to answer the members' questions.

Please use [CODE] [/CODE] tags in future.

Nov 3 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

by: JezB | last post by:
I'm getting the above error thrown somewhere in the code: XPathDocument xPathDocument = new XPathDocument(FileLocation); XPathNavigator xPathNavigator = xPathDocument.CreateNavigator(); XPathNodeIterator nodeIterator = xPathNavigator.Select("/plist/dict"); nodeIterator.MoveNext(); nodeIterator = nodeIterator.Current.SelectChildren(XPathNodeType.All); where FileLocation contains the full path of a local XML file. Why is this trying to...
by: Paul | last post by:
Hi, This is driving me crazy. I have a solution that works great on one site, but doesn't on another site. Same exact code on two different windows environments. Here is the code: Private Sub DoStuff() Dim sURL As String Dim XMLnews As XmlDocument = New XmlDocument Dim XMLroot As System.Xml.XmlElement
by: Wild Wind | last post by:
Hello all, I apologise in advance for the long windedness of this post, but I feel that if I am going to get any solution to this problem, it is important that I present as much information that will be useful in diagnosing the problem. I have an application which calls a method of a web service that we host remotely. I have deployed the application to a
by: John Bown | last post by:
This query is similar to some others on this discussion group, but none of them were resolved! Can anybody help: The issue is related to integrated authentication. First I'll describe a simple scenario not involving ISA server, which works as expected: The web service is hosted on a server in the same domain as my workstation with anonymous access denied, and integrated authentication enabled. If I access the web service using the...
by: Malathi | last post by:
Hello, I am trying to build a Proxy class using WSDL.exe and i get this error "The request failed with HTTP status 407:Proxy authentication required" Can someone let me know what do for this? Regards Malathi
by: dan kisting | last post by:
Hello, I am writing a c# application which connects to web services through a Proxy Server. I am running a local Proxy Host to simulate what the user is seeing, and his problem is he is getting a 407 error, Proxy Authentication Required. I am applying the credentials and I realize I am probably just missing something. Here is my code, do I need any modifications on the Web Service? WebService service = new WebService();
by: Learning.Net | last post by:
Hi All, I have an windows application created in C# &it is running fine on several of our customer. It does a httpWebrequest in the background. Everything was working fine but some customer are facing "The Remote server returned an error :(407) Proxy Authentication Required " Please help me on this proxy issue!! Code Snippet Below:::
by: Learning.Net | last post by:
Hi All, I have an windows application created in C# &it is running fine on several of our customer. It does a httpWebrequest in the background. Everything was working fine but some customer are facing "The Remote server returned an error :(407) Proxy Authentication Required " {
by: =?Utf-8?B?UmljaGFyZEBub3NwYW0ubm9zcGFt?= | last post by:
My webcam app runs OK on XP but not on Vista. Here's my code snippet that has been working up until now: System.Net.WebRequest request; System.Net.WebResponse response; request = System.Net.FileWebRequest.Create( "http://store.bearvalley.com/live/camimage_00001.jpg"); response = request.GetResponse(); When it tries to execute the request.GetResponse() call I get the following
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.