Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .net SQL Server Reporting Services 401 Error

Reply
Thread Tools

ASP .net SQL Server Reporting Services 401 Error

 
 
RSH
Guest
Posts: n/a
 
      06-29-2007
Hi,

I am trying to access a reporting services report using the HTTPWebRequest
object but I am getting an error:
The remote server returned an error: (401) Unauthorized.
We can't seem to figure this out...the link works fine if I enter it
directly in a browser, just not when I try to hit through the HTTPWebRequest
object.

Thanks for any possible solutions!
Ron


Private Sub ReportSaveTest()

Dim strLink As String =
"http://svr/ReportServer$svr?/WebServiceTest&rs:Command=Render&rs:format=HTML4.0 "

Dim myCred As New Net.NetworkCredential

myCred = New System.Net.NetworkCredential("user", "pass", "dimain")

Dim ox As System.Net.HttpWebRequest

ox = System.Net.HttpWebRequest.Create(strLink)

ox.PreAuthenticate = True

ox.Credentials = myCred

Dim oy As System.Net.HttpWebResponse = ox.GetResponse() <<<<<<<<<<<<<<
ERRORS OUT HERE

Dim raw As System.IO.FileStream = New
System.IO.FileStream(Request.PhysicalApplicationPa th & "TesFile.pdf",
IO.FileMode.Create)



Dim buffer(1024) As Byte

Dim rs As System.IO.Stream = oy.GetResponseStream()

Dim read As Integer = rs.Read(Buffer, 0, Buffer.Length)

While (read > 0)

raw.Write(buffer, 0, read)

read = rs.Read(buffer, 0, buffer.Length)

End While

oy.Close()

raw.Close()

rs.Close()

oy = Nothing

ox = Nothing

raw = Nothing

rs = Nothing

End Sub


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sql Server Reporting Services Error: rsAccessDenied csharper ASP .Net 0 08-05-2010 04:47 AM
ASP.Net Web Mobile Applications and SQL Server Reporting Services 2005... SP ASP .Net Mobile 0 05-02-2006 09:22 PM
Integrating SQL Server Reporting Services With ASP.NET? Patrick.O.Ige ASP .Net 3 10-31-2005 02:57 AM
Intergrating SQL Server Reporting Services into an ASP.NET app Brendan Reynolds ASP .Net 8 08-18-2005 12:43 PM
SQL Server Reporting Services with ASP.NET Mark ASP .Net 1 11-25-2003 06:23 AM



Advertisments