473,406 Members | 2,451 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.

App using WS gives 401 error from one box and not another.

I have the following situation:
An ASP.NET 2.0 app calls a web service, running on TestBoxB. When I run the
app (as a virtual directory) from DevBoxA, everything is fine. When I
create a new website on TextBoxB to host my app, and it calls the web
service on a different site also on TestBoxB, I get nothing but "The Request
Failed with HTTP 401: Unauthorized" messages back.

One thing we noticed is that if you bring up IE and type in the URL of the
ASMX file for the web service, it works fine if you do it from a box OTHER
than TestBoxB. However, if you log in to TestBoxB and perform the same
test, it asks for login credentials and wont accept any tried so far (keeps
asking for credentials over and over).

The settings for the website on TestBoxB are the same as the virtual
directory on DevBoxA: No Anonymous access and Integrated Windows
Authentication. We have tested both with Anonyous access ON and OFF with no
change in behavior.

On both boxes, the IIS application pool that runs the application has an
identity of Network Service.

All of the following code snippets have been tried with the same results:
svc.PreAuthenticate = false;
svc.Credentials = System.Net.CredentialCache.DefaultCredentials;
svc.CallSomeMethod("foo");
//----------------------------------------------
svc.PreAuthenticate = true;
svc.Credentials = System.Net.CredentialCache.DefaultCredentials;
svc.CallSomeMethod("foo");
//----------------------------------------------
System.Net.CredentialCache cache = new System.Net.CredentialCache();
cache.Add(new Uri(svc.Url), "Negotiate", new
System.Net.NetworkCredential("myAccount", "MyPassword", "MyDomain"));
svc.Credentials = cache;
svc.CallSomeMethod("foo");
//----------------------------------------------
Does anyone have any ideas?

Thanks,
Eric
Oct 19 '06 #1
0 821

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

Similar topics

0
by: TF | last post by:
I am developing a VB.net Windows Application in. I have a class 'A' defined in a class library 'CL_A' and another class 'B' in a different class library 'CL_B'. Class 'B' has a Public Shared member...
1
by: TF | last post by:
I am developing a Windows Application in VB.NET that is using two class libraries CL_A (contains class A) & CL_B (contains class B). Also CL_A is used in CL_B. Now in my application when i try...
0
by: antsays | last post by:
I am trying to serialize a collection to disk using the code provided. This works just fine but when I try do copy and past the xml file to another location or sometimes even just click on the...
12
by: bj7lewis | last post by:
I am working on a project I want to add a few files as resource to access(copy them to FS and use) at runtime. So far in VS.NET IDE, I Add Files to the project and set its Build Action to...
10
by: George G. | last post by:
Hi there, I am busy writing a new asp.net application and I am reusing some of my existing asp functions and methods in a user control. I need access to session, request and response in some of...
4
by: Alan Silver | last post by:
Hello, I'm trying to use an ArrayList to do data binding, but am getting an error I don't understand. I posted this in another thread, but that was all confused with various other problems,...
21
by: hemant.singh | last post by:
Hello all, I am try'g to send window.location.href to the server script who will generate dynamic javascript according to the referral name comg in as param Now bcz <script language="javascript"...
3
by: amitsoni.1984 | last post by:
Hi, I have to write a code in python to read a matrix from a text file and for that i am using following code. But it gives an error saying "NameError: name 'split' is not defined". Can anyone...
0
by: screenbert | last post by:
Managing DHCP Servers using C# They said it was impossible. It couldn't be done. But you can in fact manage DHCP servers using C#. This includes creating and deleting Scopes, SuperScopes,...
1
by: xcelmind | last post by:
Hello Dev. Guru, I want to at this time introduce myself. I am Stanley Ojadovwa by name. I’m a freelance and a newbie in web application development. I’m currently using ASP as my application...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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
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,...
0
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...
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
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,...
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.