Solved

Reportingservices 401 and 404

Posted on 2013-01-15
10
483 Views
Last Modified: 2013-03-04
Please help before my hair turns grey!
Environment server2008R2 IIS 7.5 SQLexpress2005
Application runs in classic mode

Services run under the network service account.

Reports run as the should in browser, but when running rs.exe from command line all I'm getting is HTTP401 and 404
0
Comment
Question by:Everlas
  • 5
  • 4
10 Comments
 
LVL 37

Expert Comment

by:ValentinoV
ID: 38778085
How are you running rs.exe?  Does the account with which you're logged in have admin rights on the report server?  Also, did you open the command prompt "as administrator"?
0
 

Author Comment

by:Everlas
ID: 38778316
I'm starting the command prompt as administrator - the same user as logged in at the server.
I think the administrator has almost any rights.

My command looks like this:

C:\Users\Administrator>

rs -i C:\Rapport\CreatePDF.rss -s http://Localhost/ReportServer$SQLExpress -e Exec2005 -v FileName=""C:\Rapport\test.pdf"" -v reportPath=""/test""
0
 
LVL 37

Expert Comment

by:ValentinoV
ID: 38778416
Using that same user, are you able to do it manually? (through Report Manager)

With run "as administrator" I didn't only mean to log with an admin account but also to open the command prompt with elevated permissions.  That's done by right-clicking the shortcut and selecting "Run as administrator".  On some OSes, such as Windows Server 2008 R2, this is needed even with an admin account.

Also, are you sure that the endpoint (Exec2005) is the right one to use here? (without seeing the CreatePDF.rss file I can't really judge this)
It just seems more logical to use one of the management endpoints in this context.
0
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 

Author Comment

by:Everlas
ID: 38778521
What do you mean by report manager?

Yes, elevated permissions.

The rrs file looks like this with very little information as the parameter are given in the command.

    'Dim format as string = "Excel"
    Dim format As String = "PDF"

    Public Sub Main()

        ' Prepare Render arguments
        Dim historyID As String = Nothing
        Dim deviceInfo As String = Nothing
        Dim showHide As String = Nothing
        Dim results() As Byte
        Dim encoding As String = Nothing
        'Dim mimeType as string = "ms-excel"
        'Dim extension as string = "xls"
        Dim mimeType As String = "application/pdf"
        Dim extension As String = "pdf"
        Dim warnings() As Warning = Nothing
        Dim reportHistoryParameters() As ParameterValue = Nothing
        Dim streamIDs() As String = Nothing
        Dim rs As New ReportExecutionService
        rs.Credentials = System.Net.CredentialCache.DefaultCredentials

        Dim parameters(0) As ParameterValue
        parameters(0) = New ParameterValue()
         'parameters(0).Name = "Area"
         'parameters(0).Value = AreaPara
        'parameters(1) = New ParameterValue()
        'parameters(1).Name = "StopDate"
        'parameters(1).Value = StopDatePara
        'parameters(2) = New ParameterValue()
        'parameters(2).Name = "ReportName"
        'parameters(2).Value = FileNamePara
        Dim execHeader As New ExecutionHeader()
        Dim rpt As New ExecutionInfo
        rpt = rs.LoadReport(reportPath, Nothing)
        rs.SetExecutionParameters(parameters, "da-dk")
        rs.ExecutionHeaderValue = execHeader
        rs.ExecutionHeaderValue.ExecutionID = rpt.ExecutionID
        results = rs.Render(format, deviceInfo, extension, mimeType, encoding, warnings, streamIDs)

        ' Open a file stream and write out the report
        Dim stream As FileStream = File.OpenWrite(fileName)
        stream.Write(results, 0, results.Length)
        stream.Close()

    End Sub
0
 
LVL 37

Expert Comment

by:ValentinoV
ID: 38778621
Ow okay, you're rendering to PDF!  In that case it's indeed the right endpoint to use.  (I was under the impression you were uploading a PDF to the server.)

Report Manager is the management interface (website) that ships with reporting services.  In your case you can probably access it through the following URL: http://localhost/reports_SQLExpress

BTW: is the URL to your report server working fine? (the one you've mentioned in your first comment: http://Localhost/ReportServer$SQLExpress)
You can test that by using Internet Explorer to open it.  With sufficient privileges you should be able to render the existing reports.
0
 

Author Comment

by:Everlas
ID: 38778633
It works perfectly in the browser.
0
 
LVL 10

Expert Comment

by:Monica P
ID: 38813274
Check once the URL assigned in your code in webservice URL

 ' Assign the URL of the Web service and not ReportManager URL
        rs.Url = "https://www.tttt.com/reports/ReportService.asmx"
0
 

Accepted Solution

by:
Everlas earned 0 total points
ID: 38875471
The following line in the rss file had to be removed:
Dim rs As New ReportExecutionService
0
 
LVL 37

Assisted Solution

by:ValentinoV
ValentinoV earned 500 total points
ID: 38881507
Wow yeah, I surely missed that line!  As you've discovered, it's not a good idea to re-instantiate the RS object.  It gets created automatically by the RS Utility.

The script environment automatically connects to the report server, creates the Web proxy class, and generates a reference variable (rs) to the Web service proxy object.
(ref. Format a Reporting Services Script File)
0
 

Author Closing Comment

by:Everlas
ID: 38949228
Plain answer
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to increase the row limit in Jasper Server.
Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question