Basic Authentication, WebService

Discussion in 'ASP .Net Web Services' started by oliver.wulff@zurich.ch, Jul 11, 2003.

  1. Guest

    I did the following to add http basic authentication for calling a
    webservice:

    chz11086.HelloAuthTestService service = new
    chz11086.HelloAuthTestService();
    service.Credentials = new System.Net.NetworkCredential("oliver",
    "oli");


    service.Url="http://chz11086:10001/xmlbus/HelloAuthTest/HelloAuthTestService/HelloAuthTestPort/";
    String retValue = service.hello("Oli from .NET");

    But it fails. I've added an interceptor which dumps the whole soap request
    and http headers. I'm missing the http header Authorization: BASIC: ......

    What am I doing wrong?
    Can I add an http header manually?
    , Jul 11, 2003
    #1
    1. Advertising

  2. Guest

    Antwort: Re: Basic Authentication, WebService

    Hi
    my webservice is not running in IIS. To check if the authorization http
    header has been added, the message is sent to a tcp monitor which
    delegates the request to my webservice. Unfortunately, this header hasn't
    been added by my .NET client. I've done the following:
    String url = "http://chz11086:10001/xmlbus/berechtigung/Berechtigung_1_0Service/Berechtigung_1_0Porthttp://localhost:53205/xmlbus/berechtigung/Berechtigung_1_0Service/Berechtigung_1_0Port/";
    chz110861.Berechtigung_1_0Service service = new
    chz110861.Berechtigung_1_0Service();

    service.PreAuthenticate = true;
    NetworkCredential myCred = new NetworkCredential("cha3629","oli");

    CredentialCache myCache = new CredentialCache();
    myCache.Add(new Uri(service.Url), "Basic", myCred);
    service.Credentials = myCache;

    service.Url = url;
    service.ping();
    MessageBox.Show("Succeeded");
    , Jul 12, 2003
    #2
    1. Advertising

  3. Guest

    Antwort: Re: Basic Authentication, WebService

    No further ideas?
    I've found similar requests in other newsgroups about this issue but there
    was no reply. They used the same code as I do.
    Is there a bug?
    , Jul 16, 2003
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brett Porter
    Replies:
    2
    Views:
    736
    Andrea D'Onofrio [MSFT]
    Jan 20, 2004
  2. Mark
    Replies:
    0
    Views:
    663
  3. Brett Porter
    Replies:
    5
    Views:
    566
    Brett Porter
    Feb 3, 2004
  4. Dom
    Replies:
    0
    Views:
    439
  5. Dom
    Replies:
    0
    Views:
    479
Loading...

Share This Page