473,803 Members | 2,599 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Proxy Connection Web Services

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();
WebProxy proxy = new WebProxy(this.t xtProxyHost.Tex t,
int.Parse(this. txtPort.Text));
proxy.BypassPro xyOnLocal = true;
NetworkCredenti al cred = new NetworkCredenti al(this.txtUser Name.Text,
this.txtPasswor d.Text,
this.txtDomain. Text);
proxy.Credentia ls = cred;
service .Timeout = 20000;
service .Proxy = proxy;
WebRequest req = WebRequest.Crea te(service .Url);
req.Proxy = proxy;
*************** ***
Me again, the last two lines I am unsure about, but do I need to do
anything special when accessing the Web Method?
I saw something about Proxy-Authentication which may be an issue, but
again, not sure if applicable here.
Thank you in advance.!

Nov 21 '06 #1
1 1729
I am not sure what Proxy server is used, it is on the client end. I am
not sure if it is an ISA server or what, but I will indeed try that.
There isn't anything specifc I would need on the Web Services end,
correct? I wouldn't think so...

Thanks.

Vadym Stetsyak wrote:
Hello, dan!

What proxy server is used?
sometimes it works when you only specify user name and leave domain empty in
NetworkCredenti al.

Try different combinations:
- domain\user
- user

dkI am writing a c# application which connects to web services through
dka
dkProxy Server. I am running a local Proxy Host to simulate what the
dkuser is seeing, and his problem is he is getting a 407 error, Proxy
dkAuthenticatio n Required. I am applying the credentials and I
dkrealize I

dkam probably just missing something. Here is my code, do I need any
dkmodifications on the Web Service?
dkWebService service = new WebService();
dkWebProxy proxy = new WebProxy(this.t xtProxyHost.Tex t,
dkint.Parse(thi s.txtPort.Text) );
dkproxy.BypassP roxyOnLocal = true;
dkNetworkCreden tial cred = new
dkNetworkCreden tial(this.txtUs erName.Text,
dk this.txtPasswor d.Text,
dk this.txtDomain. Text);
dkproxy.Credent ials = cred;
dkservice .Timeout = 20000;
dkservice .Proxy = proxy;
dkWebRequest req = WebRequest.Crea te(service .Url);
dkreq.Proxy = proxy;
dk************* *****
dkMe again, the last two lines I am unsure about, but do I need to do
dkanything special when accessing the Web Method?
dkI saw something about Proxy-Authentication which may be an issue,
dkbut
dkagain, not sure if applicable here.
dkThank you in advance.!
--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
Nov 26 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
3222
by: MSDNAndi | last post by:
Hi, I have a set of simple webservices calls that worked fine using .NET Framework 1.0. I am calling a Java/Apache based webservices, the calling side is not able to supply a proper WSDL. What it does is to call a webservice with two parameters, one being a integer, the other one being a "String" which contains XML (not the best practice, however that is the target interface and we cannot change that).
1
9534
by: Tony Stephens | last post by:
Hi, I've created a small forms based application in c# to test a vendor's product and the web service interface that it exposes. We have deployed two instances of the vendor product one which has an unprotected (no authentication) interface and one that is protected using HTTP basic authentication. I can invoke methods on the unprotected instance and everything's fine. When I attempt to invoke methods on the protected instance the...
2
2902
by: Robin Haswell | last post by:
Hey there Soon we will have many squid proxies on many seperate connections for use by our services. I want to make them available to users via a single HTTP proxy - however, I want fine-grained control over how the squid proxies are selected for each connection. This is so I can collect statistics, control usage on each proxy, monitor what's going on - etc. However I don't want to implement the HTTP proxy protocol in Python, and would...
3
5406
by: Arpan | last post by:
Web Services make use of proxy classes whose methods & properties are accessed in exactly the same way as how a normal class' methods & properties are accessed. So what for does ASP.NET generate proxy classes (using WSDL) which consume more hard disk space & resources? For e.g. consider the following code which exists in a user-defined class file: Imports System Imports System.Data
5
12719
by: ayaz.usman | last post by:
Hi, I've built a web services proxy server, in C# using wsdl.exe, by importing wsdl. Howeever, when I go to : http://localhost/sample.asmx?wsdl, they wsdl there does not match the wsdl I fed into wsdl.exe. Why is this? Is there something I can do to make the input and output wsdl match?
4
5997
by: Boni | last post by:
I want consuming a webserivce trough a proxy. I use this code. myService s = new myService (); System.Net.WebProxy proxyObject = new System.Net.WebProxy("http://proxyhost:8080"); s.Proxy = proxyObject; It doesn't works, it returns a error HTTP 407: Proxy Authentication Required ( Access is denied. ). But my proxy don't need a user Authentication.
7
40980
by: chandru1782 | last post by:
Dear friends, I am trying to use CPAN for installing some perl modules. i am using a ubuntu system, which has internet connection through lan and authenticated proxy. when trying to install cpan.pm , it gives the following error, can any one help, You have no /root/.cpan/sources/MIRRORED.BY I'm trying to fetch one CPAN: LWP::UserAgent loaded ok Fetching with LWP:
2
2514
by: Peter | last post by:
Firstly let me be very clear about this, I do not want to create a web service proxy nor do I want to do anything with web services. Basically, I have a shrink wrapped desktop application which downloads data from a web site. Unfortunately the application has a fixed timeout and the web server regularly exceeds this, causing the application to shut the connection and subsequently not receive any data. The desktop application also uploads...
4
4470
by: Jon | last post by:
I wrote a VS 2005 C# express programme that accesses a web service. It works fine when there's a direct connection to the internet, but on two different PCs with internet access via a proxy, I get this exception: System.Net.WebException: The request failed with HTTP status 407: Proxy Authentication Required. at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream...
0
9699
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9562
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,...
0
10542
Oralloy
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...
0
10068
tracyyun
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...
0
9119
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7600
isladogs
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...
0
6840
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5496
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5625
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.