473,406 Members | 2,710 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

When must set Credentials with webservice?

ad
When we new a web Service, the default in IIS is Allow Anonymous and
Integrated Windows Authentication , we just use :
WebService.webClass myWC= new WebService.webClass();
and then we can access the WebService thought myWC

But I find some time it will fail with Access denid, and I must
must use:
WebService.webClass myWC= new WebService.webClass();
myWC.PreAuthenticate = true;
myWC.Credentials = System.Net.CredentialCache.DefaultCredentials;

I can't find when we must set Credentials, when we need not.

Could some one tell me?
Mar 18 '06 #1
1 4357
Greetings,

There are (at least) two circumstances when you must provide default
credentials when issuing web service requests:

- When the website/virtual directory hosting the web services only
allows Windows Authentication; and

- If the web service requests pass through an authenticating proxy
server.

You should be able to tell from the access denied error message whether
a proxy is generating the error in your environment.

Cheers,
Matt

ad wrote:
When we new a web Service, the default in IIS is Allow Anonymous and
Integrated Windows Authentication , we just use :
WebService.webClass myWC= new WebService.webClass();
and then we can access the WebService thought myWC

But I find some time it will fail with Access denid, and I must
must use:
WebService.webClass myWC= new WebService.webClass();
myWC.PreAuthenticate = true;
myWC.Credentials = System.Net.CredentialCache.DefaultCredentials;

I can't find when we must set Credentials, when we need not.

Could some one tell me?


Mar 18 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: POnfri | last post by:
Hi, I have a problem in a peace of code were i'm doing a file copy using File.Copy. The Source is local and the target is a remote machine. Example: File.Copy(C:\temp\hi.txt,...
4
by: Grind Boy | last post by:
Hi, I'm writing this off the top of my head as I don't have the exact information to hand. We are attempting to set up a secure internet site using ASP.NET on IIS5. We are having some...
0
by: Marko | last post by:
Hello. We have anonymous access disabled on the webservice and are passing the default credentials from client to the webservice with proxy.Credentials =...
0
by: Michael Höhne | last post by:
Hi, we're developing some web services and use the local development server of Visual Studio 2005 to create, run and debug the project. The web service methods connect to a database hosted on a...
2
by: Jay Balapa | last post by:
Hello, Win Forms app is able to connect to my webservice passing credentials as follows- myService.Credentials=System.Net.CredentialsCache.DefaultCredentials; Compact Framework does not...
0
by: Richard Purchas | last post by:
The webservice I'm trying to create a VS.Net 2005 reference for is behind a proxy server. When I select "Add Web Reference", enter the URL of the webservice, click "go" etc. the dialog then...
0
by: francovincent | last post by:
I am creatting webservice proxy in C++ dll to consume a webservice. But i am not able to pass credentials to that . Can anyone help me on this? I am setting the url of the webservice with...
0
by: JeremyPollack | last post by:
Here's the situation : I have the same ASP.NET 2.0 web application running on both Machine A and Machine B. On both machines, I have Integrated Windows Authentication turned on, and Anonymous...
10
by: Anton | last post by:
Hi, when accessing a secured 3rd party webservice i'm getting a 401 HTTP Statuscode (unauthorized). When entering the url in a browser and entering the username and password manually, the wsdl is...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.