473,695 Members | 1,926 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.webC lass myWC= new WebService.webC lass();
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.webC lass myWC= new WebService.webC lass();
myWC.PreAuthent icate = true;
myWC.Credential s = System.Net.Cred entialCache.Def aultCredentials ;

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

Could some one tell me?
Mar 18 '06 #1
1 4374
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.webC lass myWC= new WebService.webC lass();
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.webC lass myWC= new WebService.webC lass();
myWC.PreAuthent icate = true;
myWC.Credential s = System.Net.Cred entialCache.Def aultCredentials ;

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
3895
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, \\myremote\c$\temp\hi.txt, true); This API is run from a web service that exposes it. The problem is as follows: 1) I request a page (On the web service machine) from my web server (Note
4
2198
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 authentication problems early on in the project. The plan is to have 1 ASP.NET (IIS) forms application serving user requests and another ASP.NET (IIS) webservice interfacing to the database.
0
350
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 = System.Net.CredentialCache.DefaultCredentials. On the development server everything is ok but on the production server wich is also a domain controler everytime the webservice is called we get the 401 error. We have altered the code and create a network credential with the username,...
0
1704
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 dedicated server and the Microsoft CRM 3.0 server, also on a separate machine. As the CRM server installation makes changes to the Active Directory, they are located in a separate domain, while the development machines are member of the companies...
2
1577
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 have a CredentialsCache class. Is there an alternate way of passing default credentials?
0
1079
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 displays a "Discovery Credentials for Proxy Server" dialog. Issue #1: when I enter my proxy' server credentials the dialog times out with an "Unable to connect to the remote server" error. Issue #2 (and the most important): how do I tell VS.Net 2005...
0
1275
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 webReference.Seturl() method. I suppose there should be something similar to this for passing credentials also. Thnaks in advance
0
1686
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 Access turned off for the folder that contains the webservice .ASMX file. When I hit a certain page on Machine A, it will call the web service on Machine A, and then it will call the same web service on Machine B. Likewise, when I hit the same...
10
9769
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 returned. So the username and password should be ok. I'm using this code: Merchant myMerch = new Merchant(); myMerch.merchantIdentifier=merchantId;
0
8565
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8822
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7656
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6488
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5837
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4577
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2997
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2269
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1971
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.