WCF How to add windows credentials to a SOAP header

JElster
JElster used Ask the Experts™
on
Hi.
I need to authenticae using windows how can I add the user/pass to the soap header to authenticate automatically?
thx
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Rose BabuSenior Team Manager
Commented:
Try like this

Service1 client = new Service1();

client.Credentials = new System.Net.NetworkCredential("username", "password", "domainname");

Open in new window

Commented:
I get 'Client' does not contain a def for Credentials... just ClientCredentials
Rose BabuSenior Team Manager
Commented:
both WCF and ASMX services client will have the Credentials property. check once...
Become a Microsoft Certified Solutions Expert

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

Commented:
When I add my service via the IDE and I only see
ClientCredentials

I have tried that too and get unauthorized
Vel EousResearch & Development Manager
Commented:
What binding are you using and have you configured it correctly to use Windows authentication?
Commented:
nothing has worked

Author

Commented:
Not resolved.. but I need to ask some more questions and it will not let me

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial