473,546 Members | 2,289 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

consuming webservice trough proxy

I want consuming a webserivce trough a proxy. I use this code.
myService s = new myService ();

System.Net.WebP roxy proxyObject = new
System.Net.WebP roxy("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.WebC lient wc = new System.Net.WebC lient();
System.Net.WebP roxy proxyObject = new
System.Net.WebP roxy("http://proxyhost:8080" );
wc.Proxy = proxyObject;
string test = wc.DownloadStri ng("http://www.mysite.com" );

Someone can help me?
thank you very mutch.
Boni
Nov 20 '06 #1
4 5979
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.WebP roxy proxyObject = new
System.Net.WebP roxy("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.WebC lient wc = new System.Net.WebC lient();
System.Net.WebP roxy proxyObject = new
System.Net.WebP roxy("http://proxyhost:8080" );
wc.Proxy = proxyObject;
string test = wc.DownloadStri ng("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.WebP roxy proxyObject = new
System.Net.WebP roxy("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.WebC lient wc = new System.Net.WebC lient();
System.Net.WebP roxy proxyObject = new
System.Net.WebP roxy("http://proxyhost:8080" );
wc.Proxy = proxyObject;
string test = wc.DownloadStri ng("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.WebP roxy proxyObject = new
System.Net.WebP roxy("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.WebC lient wc = new System.Net.WebC lient();
System.Net.WebP roxy proxyObject = new
System.Net.WebP roxy("http://proxyhost:8080" );
wc.Proxy = proxyObject;
string test = wc.DownloadStri ng("http://www.mysite.com" );

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

NetworkCredenti al credential = new NetworkCredenti al("user", "password") ;
proxy.Proxy = new WebProxy(proxy. Url, true, null, credential);
proxy.Operation ();
"Boni" <Bo**@discussio ns.microsoft.co mwrote in message
news:CB******** *************** ***********@mic rosoft.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
2185
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 command line with the following statement: wsdl https://webservices.innovativegateway.com/igspaymentservice/igspaymentservice.asmx?WSDL /l:vb...
3
5300
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 can help. Appreciate your help in advance. S
4
2696
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 server ip that is set in the configuration and call the same WS to check the user in the remote "database". So far I don't know if I can call a...
7
5377
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 filter-object without setting any properties. but the value type-properties can´t be null and the filter is set to 0 (int) or false (bool). therefore i...
3
6480
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 (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnservice/html/service07162002.asp) but I don't want clients to have to add two web references and then manually have to edit the proxy classes....
2
1996
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 there any way we can pass proxy server, proxy port and proxy username information before invoking the web services by making use of proxy property,...
0
1226
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
17112
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
9087
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 wsdl-file of the webservice, wsdl.exe generated a C#-proxy class errorlessly. I then tried to instantiate the proxy class to access the service: ...
0
7504
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...
0
7694
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. ...
1
7461
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...
0
7792
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...
0
6026
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...
1
5360
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...
0
3470
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1921
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
0
747
bsmnconsultancy
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...

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.