Two Web Services using same NetworkCredential?

W

wgo

Hi,

I've been trying to figure this out all day and thought someone here might
be able to help.

I have a Windows form app that's using windows basic authentication to
access two different web services. Each web service uses a different
username and password. When I access the first web service everything is
fine, but when I access the second web service it's using the username and
password from the first web service.

I'm making an instance of NetworkCredential, assigning the correct username
and password and then assigning it to the web service proxy before making
each call.

If I switch the order of the calls the first always works and the second
fails because it has the username and password of the first one.

I'm verifying the username received by the web service by using
User.Identity.Name() and Thread.CurrentPrincipal.Identity.Name in the web
service. Both web services are running on the same server.

Does anyone know what's going on here?

Thanks in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top