473,385 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

consuming webservice trough proxy

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.

The same code used with another object ( WebClient ) works good!

System.Net.WebClient wc = new System.Net.WebClient();
System.Net.WebProxy proxyObject = new
System.Net.WebProxy("http://proxyhost:8080");
wc.Proxy = proxyObject;
string test = wc.DownloadString("http://www.mysite.com");

Someone can help me?
thank you very mutch.
Boni
Nov 20 '06 #1
4 5961
It is the server who decides what is required to use it's services.
Hence, your proxy should obey to what the server states.

If using IIS as host, set allow anonymous access and verify that everything
works.

If so - introduce security by using WSE and sign the SOAP message itself.
This is preferred over point-to-point authentication.
--
rgds.
/Claus Konrad
MCSD.NET (C#)
"Boni" wrote:
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.

The same code used with another object ( WebClient ) works good!

System.Net.WebClient wc = new System.Net.WebClient();
System.Net.WebProxy proxyObject = new
System.Net.WebProxy("http://proxyhost:8080");
wc.Proxy = proxyObject;
string test = wc.DownloadString("http://www.mysite.com");

Someone can help me?
thank you very mutch.
Boni
Nov 20 '06 #2
Thank you for your answer, but I don't understand.
I have to pass trough a proxy to have a internet connection. The webservice
I want cosume it's outside my net.
So if I use my app to consume the same webservice on a PC with direct access
to internet I don't have problem, but I can't set the proxy on my client app
to have the same result on a PC behind a proxy.

You would say that the webservice webserver (IIS) recongnize that the call
came from a app behind a proxy instead with a direct connection so its answer
is different? And I have to change the permissions on my webserver?

best regards
Boni

"Claus Konrad [MCSD]" wrote:
It is the server who decides what is required to use it's services.
Hence, your proxy should obey to what the server states.

If using IIS as host, set allow anonymous access and verify that everything
works.

If so - introduce security by using WSE and sign the SOAP message itself.
This is preferred over point-to-point authentication.
--
rgds.
/Claus Konrad
MCSD.NET (C#)
"Boni" wrote:
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.

The same code used with another object ( WebClient ) works good!

System.Net.WebClient wc = new System.Net.WebClient();
System.Net.WebProxy proxyObject = new
System.Net.WebProxy("http://proxyhost:8080");
wc.Proxy = proxyObject;
string test = wc.DownloadString("http://www.mysite.com");

Someone can help me?
thank you very mutch.
Boni
Nov 21 '06 #3
Boni,
What Claus is saying is that if you can change your webservice host
so that it allows anonymous access you can check that everything
is working. If you get the same error (407) with the webservice host
set to anonymous then it is not your webservice host that has the
problem. This is just for verification.

Cheers, Greg.

On Tue, 21 Nov 2006 00:27:01 -0800, Boni wrote:
Thank you for your answer, but I don't understand. I have to pass trough a
proxy to have a internet connection. The webservice I want cosume it's
outside my net.
So if I use my app to consume the same webservice on a PC with direct
access to internet I don't have problem, but I can't set the proxy on my
client app to have the same result on a PC behind a proxy.

You would say that the webservice webserver (IIS) recongnize that the call
came from a app behind a proxy instead with a direct connection so its
answer is different? And I have to change the permissions on my webserver?

best regards
Boni

"Claus Konrad [MCSD]" wrote:
>It is the server who decides what is required to use it's services.
Hence, your proxy should obey to what the server states.

If using IIS as host, set allow anonymous access and verify that
everything works.

If so - introduce security by using WSE and sign the SOAP message
itself. This is preferred over point-to-point authentication. --
rgds.
/Claus Konrad
MCSD.NET (C#)
"Boni" wrote:
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.

The same code used with another object ( WebClient ) works good!

System.Net.WebClient wc = new System.Net.WebClient();
System.Net.WebProxy proxyObject = new
System.Net.WebProxy("http://proxyhost:8080");
wc.Proxy = proxyObject;
string test = wc.DownloadString("http://www.mysite.com");

Someone can help me?
thank you very mutch.
Boni
Nov 30 '06 #4
The proxy object has properties:

NetworkCredential credential = new NetworkCredential("user", "password");
proxy.Proxy = new WebProxy(proxy.Url, true, null, credential);
proxy.Operation();
"Boni" <Bo**@discussions.microsoft.comwrote in message
news:CB**********************************@microsof t.com...
You have the right question!
Do you have a right answer?

"Burton Rodman" wrote:
>you guys are totally missing the point! the client is accessing the
internet
through a local HTTP proxy (i.e: ISA Server). the authentication he is
referring to has NOTHING to do with authentication of the Web Service
destination (i.e.: external IIS server). The Authentication is with the
local HTTP Proxy (ISA Server) to simply allow the request to be forwarded
to
the destination.

The question is: How do you tell the WS client to authenticate to the
local
HTTP proxy (ISA Server) before even thinking about actually having a
conversation with the destination server (external IIS server).

Dec 15 '06 #5

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

Similar topics

4
by: bob garbados | last post by:
I'm new to web services and I'm trying to interface with a payment gateway for an online store. I'm trying to do this without Visual Studio and I'm stuck... I created my proxy class from the...
3
by: Sunil | last post by:
Hi, How can we consume a webservice developed using Oracle JDeveloper from a asp.net client. The webservice provides a Proxy Jar and Proxy Source download. Please provide urls or articles that...
4
by: Bamse | last post by:
Hi all, The problem is as follows: I need to authorize a user: through a WS; if a setting is on, the webservice will look in the local "database", if the setting is off it will connect to the...
7
by: stephan querengaesser | last post by:
hi ng, i try to invoke a webservice-method with an filter-object, that contains value types. if i donīt want to filter the return value of the method, i have to pass a new instance of the...
3
by: Matt D | last post by:
I've got two web services that use the same data types and that clients will have to consume. I read the msdn article on sharing types...
2
by: Chinns Arumugam | last post by:
Hello folks I couldn't consume the webservice outside our firewall using DOT NET windows application, Since the above application has to go through a proxy server and connect to the internet Is...
0
by: kamig | last post by:
Hi! Scenario: Consuming my webService in a windows application give denied acces! Explanation: I have to say a moveTo fn. which move one file/dir from one drive to another, <authorization>
5
by: Preben Zacho | last post by:
Anyone that has a link or description that simply as possible shows how to add a web reference to a class library in C# and consuming it? TIA PZ
1
by: Thomas Mueller | last post by:
Hi, I'm currently working on C# code consuming a PHP-webservice (soapserver-class of PHP5). A PHP test-client worked fine and achieved the requested data from the service's server. Using the...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.