You can do this in a simpler way with just the following line.
my_proxy.Credentials = Net.CredentialCache.DefaultCredentials
The credentials property of the proxy allow you to set this directly.
Hope this helps;
-Ed Smith
Microsoft VB.net team
--------------------
[quoted text, click to view] >Thread-Topic: Access web services from ASP.NET
>thread-index: AcOcp73/6me75RrvQwivobVTWXDm0w==
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.security
>From: "=?Utf-8?B?VGFyYXMgT3ZlcmNodWs=?="
<anonymous@discussions.microsoft.com>
>References: <651DCAB1-06BB-4D1D-8689-C54FB279028D@microsoft.com>
>Subject: RE: Access web services from ASP.NET
>Date: Mon, 27 Oct 2003 08:31:15 -0800
>Lines: 8
>Message-ID: <6F859FFB-3AC1-4130-966E-8E13E66F499E@microsoft.com>
>MIME-Version: 1.0
>Content-Type: text/plain;
> charset="Utf-8"
>Content-Transfer-Encoding: 7bit
>X-Newsreader: Microsoft CDO for Windows 2000
>Content-Class: urn:content-classes:message
>Importance: normal
>Priority: normal
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
>Newsgroups: microsoft.public.dotnet.framework.aspnet.security
>NNTP-Posting-Host: TK2MSFTCMTY1 10.40.1.180
>Path: cpmsftngxa06.phx.gbl!cpmsftngxa10.phx.gbl
>Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.aspnet.security:7314
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.security
>
>I've decided my own problem by next code:
my_proxy.PreAuthenticate = true;
my_proxy.Credentials = CredentialCache.DefaultCredentials;
(Look
ms-help://MS.VSCC.2003/MS.MSDNQTR.2003JUL.1033/dnnetsec/html/SecNetch10.htm#
secnetch10_webservicesecmodel)
But it's anyway interesting, why previous sample don't work.
[quoted text, click to view] >
--------------------------------------------------------------------
This reply is provided AS IS, without warranty (express or implied).