In general, how can I use WSE2.0 through a proxy/firewall?
I am unable to run the SecureConv example in WSE 2sp1 with an HTTP proxy
between the service and client. I set the proxy property in the following way:
serviceProxy.Proxy = new System.Net.WebProxy( "http://localhost:8110" ,
false, null);
but it does not take any effect, and I don't know how to access the
SecurityContextTokenService through a proxy. I can't even find any place to
put the information of the proxy server.
Thanks
Rory Plaire - 18 Oct 2004 20:27 GMT
Hi,
I've been having the same problem as Ziyang. I downloaded the
proxyTrace tool and added a proxy to the generated proxy's "Proxy"
property (say _that_ 10 times), and the generated WSE proxy never
seems to use the firewall proxy settings. I can even close the
proxyTrace tool, and the messages are still passed...
e.g. This code works regardless if there is a proxy sitting on port
8888...
_proxy.Proxy = new System.Net.WebProxy("http://localhost:8888",
false);
Does this property just have no effect, which is what appears to be we
both observe here?
thanks,
-rory
> In general, how can I use WSE2.0 through a proxy/firewall?
>
[quoted text clipped - 3 lines]
> false, null);
> but it does not take any effect,
Hervey Wilson [MSFT] - 20 Oct 2004 18:14 GMT
> Hi,
>
[quoted text clipped - 23 lines]
>>false, null);
>>but it does not take any effect,
Right now, I can't say whether this is a bug or not. I'll have it
investigated for WSE2 SP2.

Signature
This posting is provided "AS IS", with no warranties, and confers no rights.
Kirill Gavrylyuk [MSFT] - 21 Oct 2004 03:22 GMT
Rory,
Where does your target url point to? Does it point to a localhost?
The Framework's HttpWebClientProtocol/HttpWebRequest will not use provided
proxy if the host in the target url is loopback (localhost). Both
Microsoft.Web.Services2.WebServicesClientProtocol and SoapClient
(SoapHttpOutputChannel) reflect this behavior.
this is the behavior of the HttpWebRequest. If your
> > Hi,
> >
[quoted text clipped - 26 lines]
> Right now, I can't say whether this is a bug or not. I'll have it
> investigated for WSE2 SP2.
Rory Plaire - 21 Oct 2004 18:26 GMT
> Rory,
> Where does your target url point to? Does it point to a localhost?
[quoted text clipped - 5 lines]
>
> this is the behavior of the HttpWebRequest. If your
Yes, the endpoint is on localhost. It looks like your reply was cut
short. Perhaps you were going to point to a work around (hope)?
-r
Sebastien Andrivet - 23 Dec 2004 11:01 GMT
Hi,
I don't know if you have already found a solution to this problem but in
case not, I found one:
The problem is that SecurityContextTokenServiceClient (indirectly using
SoapHttpTransport) is building its own HttpWebRequest. So even if you
properly set Proxy settings on your web service instance, it will not work
for this HttpWebRequest. Hopefully, before sending the request, WSE set
parameters from an instance of SoapHttpChannelOptions and this class has a
"Proxy" member.
The only way I found to get access to this SoapHttpChannelOptions is to
downcast (hum...) SecurityContextTokenServiceClient.Channels.
So for example, you can use code such as this (url is the URL of your web
service):
SecurityContextTokenServiceClient client = new
SecurityContextTokenServiceClient(url);
SoapHttpOutputChannel channel = client.Channel as SoapHttpOutputChannel;
if(channel != null)
{
System.Net.WebProxy proxy = System.Net.WebProxy.GetDefaultProxy();
proxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
channel.Options.Proxy = proxy;
}
This will use your default credentials and the proxy settings as defined in
IE.
Sebastien
> In general, how can I use WSE2.0 through a proxy/firewall?
>
[quoted text clipped - 7 lines]
>
> Thanks