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
Hi,

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
service.

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!
John
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 asp.net client scenario there
also.

Also, based on my local test when use the

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

the DefaultCredentials will represent the asp.net'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;

ms.Execute("dfdsfds");
=====================

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

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Nov 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.