By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,092 Members | 1,546 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,092 IT Pros & Developers. It's quick & easy.

How to call a web service using NT Authentication from Web Service

P: n/a

I have two web services and they are setup as "Integrated Windows
Authentication" only and they are both assigned to application pool with
Domain Account.

I can use ws.Credentials = System.Net.CredentialCache.DefaultCredentials;
(ws is a web service proxy request instance) to call the web service BUT
this method does not work if I want to call another web service from one web

I guess the DefaultCredentials does not have anything because there is no
logon involved? So How could I call another web service from one web service
using NTLM?

Thanks a lot!
Nov 16 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a
Hi John,

Thanks for your posting. Regarding on this post, I've also found your
another thread in this group
"How to call a web service using NT Authentication"
which is focus on calling webservice from winform client and I've posted
my reply there. And I've also mentioned the client scenario there

Also, based on my local test when use the

PROXY.Credentials = System.Net.CredentialCache.DefaultCredentials;

the DefaultCredentials will represent the's process identity (if
not using the impersonate) and it works well. Not sure what's the problem
on your side, are you still recieving 401 access denied?

In addition, I've also mentioned how to programly create a NTLM
networkCredential and pass it to the webservice client proxy, here is the
code snippet:
MyService.MyService ms = new MyService.MyService();

System.Net.NetworkCredential nc = new
System.Net.NetworkCredential("username","password" ,"domainame");
System.Net.CredentialCache cc = new System.Net.CredentialCache();
cc.Add(new Uri(ms.Url),"NTLM",nc);
ms.Credentials = cc;


If there is any other questions, please feel free to post here or in that
thread. Thanks.


Steven Cheng
Microsoft Online Support

Get Secure!
(This posting is provided "AS IS", with no warranties, and confers no
Nov 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.