3

I am trying to communicate between a Windows Service on several PCs, and a WCF service hosted on my web server (different network).

When there is no proxy between the client and server, communication works fine.

However, when there is a proxy in place between client and server, I cannot figure out how to authenticate against it.

In the old .asmx days, I did something like this:

myService.Proxy = new WebProxy("internal.proxyserver.com", 8080)
{
    Credentials = new NetworkCredential("myusername", "mypassword" , "mydomain");
};

I couldn't find an equivalent way to do this in WCF.

I have tried changing the DefaultWebProxy of the WebRequest object, and assigning credentials that way, but this doesn't seem to work, and I am unable to connect to the web service.

ASMX made this very easy; can somebody explain the correct procedure for this in WCF?

EDIT: The relevance of mentioning that this is in a Windows Service is that the client runs without a user supplying credentials, they need to be hard coded/config filed into the application.

KingCronus
  • 4,509
  • 1
  • 24
  • 49
  • possible duplicate of [Is it possible to specify proxy credentials in your web.config?](http://stackoverflow.com/questions/186800/is-it-possible-to-specify-proxy-credentials-in-your-web-config) – CodeCaster Oct 07 '13 at 10:58

1 Answers1

1

The following links should help you sort out the issue:

[WCF]How to supply dedicated credentials for webproxy authentication in WCF client

How to use HTTP proxy authentication in WCF

Proxy server authentication for WCF service

Community
  • 1
  • 1
Seymour
  • 7,043
  • 12
  • 44
  • 51