?
Solved

Reportingservices 401 and 404

Posted on 2013-01-15
10
Medium Priority
?
509 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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 1500 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

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

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

We were having a lot of "Heartbeat Alerts" in our SCOM environment, now "Heartbeat" in a SCOM environment for those of you who might not be familiar with SCOM is a packet of data sent from the agent to the management server on a regular basis, basic…
Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
Viewers will learn the different options available in the Backstage view in Excel 2013.
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …

752 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