473,793 Members | 2,865 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 4377
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
3897
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
2208
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
1710
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
1585
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
1084
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
1280
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
1692
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
9781
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
10433
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10212
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10000
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
9035
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
7538
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
6777
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
5436
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5560
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2919
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.