Good thinking but I'm still not winning. I put some exception trapping in and
here is the response:
System.Net.WebException: The remote server returned an error: (401)
Unauthorized. at System.Net.HttpWebRequest.CheckFinalStatus() at
System.Net.HttpWebRequest.EndGetResponse(IAsyncRes ult asyncResult) at
System.Net.HttpWebRequest.GetResponse() at
System.Xml.XmlDownloadManager.GetNonFileStream(Uri uri, ICredentials
credentials) at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials
credentials) at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String
role, Type ofObjectToReturn) at System.Xml.XmlTextReader.CreateScanner() at
System.Xml.XmlTextReader.Init() at System.Xml.XmlTextReader.Read() at
ASP.DocumentBuilder_aspx.Page_Load() in
D:\Inetpub\wwwroot\WorkSQE\scripts\DocumentBuilder .aspx:line 58
Ian
"Joe Kaplan (MVP - ADSI)" wrote:
> Ok,
>
> If the target file is on a SharePoint site, then it is almost certainly
> using Windows authentication, not Forms authentication. You should be able
> to tell by whether you are sent to a custom logon form when you first point
> your browser to it or whether the browser prompts you or logs you on
> automatically.
>
> If it is Windows authentication (which it should be), then you should be
> able to get the NetworkCredential approach to work. You might try adding a
> valid domain to your constructor:
>
> NetworkCredential oCred = new NetworkCredential("ianb", "******",
> "iansdomain");
>
> If that doesn't work, please provide more details and we'll see what we can
> do.
>
> Joe K.
> "Ianb" <> wrote in message
> news:64AAB084-2574-48C9-9876-...
> > Hi Joe
> >
> > To clarify, I am trying to access a Word XML format document in a
> > sharepoint
> > library from a custom ASPX file in an excluded directory under the same
> > sharepoint site.
> >
> > So I guess the sharepoint site is using the same web.config hense yes the
> > other site is using forms authentication.
> >
> > The site uses windows authentication so (from what you are saying) I am
> > heading the right way but I have some errors in my code.
> >
> > Ian
> >
>
>
>
|