Re: How to CHANGE the Credentials for a web service proxy when using CredentialCache ?

From: Jan Tielens (jan_at_no.spam.please.leadit.be)
Date: 01/21/04

  • Next message: Chris V: "COM Interop Problem - [CDO - [MAPI_E_UNCONFIGURED(8004011C)]]"
    Date: Wed, 21 Jan 2004 09:39:04 +0100
    
    

    Please look for follow-ups on this thread in the framework.webservices
    newsgroup...

    --
    Greetz
    Jan Tielens
    ________________________________
    Read my weblog: http://weblogs.asp.net/jan
    "Liviu Olaru" <liviu.olaru@softwaresolutions.ro> wrote in message
    news:#CKyXX$3DHA.2616@TK2MSFTNGP09.phx.gbl...
    >
    > I have multiple URLs the client can authenticate to and I do not want to
    ask
    > user for credentials again.
    >
    > Sorry, Jan, that I replied private.
    >
    > "Jan Tielens" <jan@no.spam.please.leadit.be> wrote in message
    > news:efsogP$3DHA.3436@tk2msftngp13.phx.gbl...
    > > Try this:
    > >
    > >     NetworkCredential networkCred = new NetworkCredential("USERNAME",
    > > "PASSWORD");
    > >
    > >     // the web service proxy
    > >     WSProxy wsProxy = new WSProxy();
    > >     wsProxy.Credentials = networkCred;
    > >    // do stuff
    > >
    > >     WSProxy wsProxy2 = new WSProxy();
    > >    // do stuff
    > >
    > > --
    > > Greetz
    > >
    > > Jan Tielens
    > > ________________________________
    > > Read my weblog: http://weblogs.asp.net/jan
    > >
    > >
    > > "Liviu Olaru" <liviu.olaru@softwaresolutions.ro> wrote in message
    > > news:#kf5eK$3DHA.2380@TK2MSFTNGP10.phx.gbl...
    > > > Hi
    > > >
    > > >     I'm trying to invoke a Web Service which is using BASIC
    > > authentication.
    > > >     Code for invoking:
    > > >
    > > >     CredentialCache cc = new CredentialCache();
    > > >     //the network credential used to authenticate client
    > > >     NetworkCredential networkCred = new NetworkCredential("USERNAME",
    > > > "PASSWORD");
    > > >     // the web service proxy
    > > >     WSProxy wsProxy = new WSProxy();
    > > >
    > > >     //Add the network credential to the cache
    > > >     cc.Add(new Uri(wsProxy.Url), "Basic", networkCred);
    > > >     //Set the proxy credentials
    > > >     wsProxy.Credentials = cc;
    > > >
    > > >     //call a method on proxy
    > > >     wsProxy.HellloWorld();
    > > >
    > > >     I WANT TO USE THE SAME URL WITH DIFFERENT CREDENTIALS.( OR WITH NO
    > > > CREDENTIAL )
    > > >
    > > >     //so, now I try to remove the credential from cache
    > > >     cc.Remove(new Uri(wsProxy.Url), "Basic")
    > > >
    > > >     If I remove the credential from CredentialCache, the subsequent
    > calls
    > > to
    > > > the web service will use the same credentials as for the first call,
    > even
    > > > the CredentialCache is empty !
    > > >
    > > >     so, when I call
    > > >
    > > >     WSProxy wsProxy2 = new WSProxy();
    > > >     wsProxy.Credentials = cc; // THIS LINE HAS NO EFFECT ! CAN BE
    > > COMMENTED
    > > > OUT !
    > > >      wsProxy2.HelloWorld();
    > > >
    > > >     the client is autenticated with the old credentials. (I wanted to
    > get
    > > > AccesDenied)
    > > >
    > > >      It seems that, for the first call, the
    > SoapHttpClientProtocol.Invoke
    > > > method, in the case of a successful request, copies the credentials
    from
    > > > CredentialCache and store them, per URL basis, in a internal store
    that
    > is
    > > > used for subsequent calls, even the new proxys have been setted
    > different
    > > > credentials.
    > > >
    > > > Thanks
    > > >
    > > >
    > > >
    > > >
    > > >
    > > >
    > > >
    > > >
    > > >
    > > >
    > > >
    > >
    > >
    >
    >
    

  • Next message: Chris V: "COM Interop Problem - [CDO - [MAPI_E_UNCONFIGURED(8004011C)]]"

    Relevant Pages

    • Re: Windows authentication for web service client??
      ... If you are posting to WEBDAV it is my understanding that you cannot use Integrated authentication since you HAVE to pass it the username and the password in the network credentials. ... I must put together a sample example, but for some reason the users credentials are lost when making the WebDAV request. ... web service is running ASPNET account. ...
      (microsoft.public.dotnet.framework.aspnet.webservices)
    • Re: Calling Web Service that calls other Web Service with Windows Authentication
      ... You are passing credentials (by ... services - then you do not need to pass token remotely and windows can ... Given a windows application client that's calling a web service (using ...
      (microsoft.public.dotnet.framework.aspnet.webservices)
    • Passing credentials from ASP.NET website to webservice
      ... I have a problem with passing the default credentials from an ASP.NET web ... The EMM web applications access the MSCRM ... Web services which is part of the MS CRM server setup. ... since both the EMM web application and the web service reside on the same IIS ...
      (microsoft.public.inetserver.iis.security)
    • Re: Server Time Out
      ... could be not passing user credentials to the web service from the client. ... calling a remote server from a web server due to not being able to forward ...
      (microsoft.public.dotnet.framework.aspnet.webservices)
    • RE: Failure to set credentials
      ... As for the INFO PATH form setting credentials for webservice proxy problem, ... | I've written a web service that returns some user-specific information. ...
      (microsoft.public.dotnet.framework.aspnet.security)