views:

106

answers:

1

We have an implemented a WCF service for sync framework communication with the guidance of http://wcfguidanceformobile.codeplex.com/ . The client in created by NetCFSvcUtil.

We have run into a problem when web proxy support is needed. How can you enable credentials with it?

On the HttpTransportBindingElement we can set the proxyadress, but since our proyx requires login this won't do it.

When trying to set UseDefaultWebProxy to true it still won't use any credentials. It connects to the proxy but gets

Error 407: Proxy authentication required

Can't find any information about it on SO or msdn. Anyone got a clue where to look?

+1  A: 

In Compact Framework, use the static GlobalProxySelect.Select property to set the global proxy used by all HttpWebRequests, including WCF service calls.

GlobalProxySelect.Select = new WebProxy(...);

For this to work in WCF, the HttpTransportBindingElement properties must be

  • ProxyAddress = null (default)
  • UseDefaultWebProxy = true (default)

The GlobalProxySelect class is deprecated in the full framework, so you should use WebRequest.DefaultWebProxy instead.

Jason Morse
Thanks for you answer. I'm not currently working on this project but I'll pass the information to some who still are, guess this could be helpful for them.I have a faith memory that we never got the credentials to work when using UseDefaultWebProxy. I'll mark this answer as a correct one when I've had it verified.
nj