Gabe
Gabe

Reputation: 6097

rs.exe report scripting - Can't connect to server ReportService2005.asmx

I am calling this rs.exe script to run and export the report:

rs -i RunReport.rss -s http://localhost/reportserver -u myUsername -p myPassword -e Exec2005

The error I get is:

Could not connect to server: http://localhost/reportserver/ReportService2005.asmx

Currently all of our reports are set up to use 'Credentials supplied by the user'. If I go to the report and input the username and password, it runs just fine. It just doesn't work running the script.

When I change the report's datasource to use Windows Integrated Security, the script works.

Any ideas on how what I'm doing wrong? Or alternatively, is there a way to change the report's permissions to Windows Auth and then change it back?

SSRS 2012

My rss script is

Public Sub Main()
  rs.Credentials = System.Net.CredentialCache.DefaultCredentials

  Dim format as string = "EXCEL"
  Dim fileName as String = "C:\test.xls"
  Dim reportPath as String = "/MyDirectory/Report1"

  ' Prepare Render arguments
  Dim historyID as string = Nothing
  Dim deviceInfo as string = Nothing
  Dim extension as string = Nothing
  Dim encoding as string 
  Dim mimeType as string 
  Dim warnings() AS Warning = Nothing
  Dim streamIDs() as string = Nothing
  Dim results() as Byte

  rs.LoadReport(reportPath, historyID)

  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

Upvotes: 6

Views: 11429

Answers (5)

Pam
Pam

Reputation: 11

Came across the same issue. Addressed it by changing the Reporting Service Configuration Manager database credentials from Integrated Security to SQL server admin account.

Upvotes: 1

SherlockSpreadsheets
SherlockSpreadsheets

Reputation: 2370

I had the exact same problem as you. For me it was caused by a Windows Credentials was somehow created for that URL. I've seen this happen to users also, but at the time I did not know how to resolve the message. They just signed in and kept moving. For me, the issue I was having was not isolated to chrome. I could also not use the command line to execute a tool (RS.exe), the command line said 'Could not connect to the server'.

The gcod049/reports URL issue was resolved after I deleted the saved credentials in Windows Credentials Manager.


Fig1: Sign in issue

enter image description here

Fig2: RS.exe issue

enter image description here

Fig3: Credentials Mgr -- Control Panel\All Control Panel Items\Credential Manager -- remove from vault: "gcod049"

enter image description here

enter image description here

Fig4: RESOLVED -- browser sign in prompt gone -- RS.exe connects to the server

enter image description here

Upvotes: 0

Soundislate
Soundislate

Reputation: 126

I had the same error, it was due to a mistake in the configuration: the script was set to run against the Report Manager URL and not the Web Service URL (both can be found in the Reporting Services Configuration Manager). Switching to the Web Service URL solved it for me.

(I reckon you've found a workaround in the last 3 years, but I'll put this here if someone else is struggling with the same problem)

Upvotes: 9

K.A.D.
K.A.D.

Reputation: 3718

I had the same error message (Could not connect to server: http://localhost/reportserver/ReportService2010.asmx).

I was able to solve the issue by re-creating the report server database using Reporting Services Configuration Manager.

  1. Connect to SQL Server using SQL Server Management Studio
  2. Delete the report server database (called ReportServer or ReportServerSQLExpress)
  3. Start Reporting Services Configuration Manager (C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft SQL Server 2012\Configuration Tools\Reporting Services Configuration Manager )
  4. Choose Database
  5. Click Change Database and following the Wizard to create a new report server database

Upvotes: 0

april4181
april4181

Reputation: 596

I had a very similar problem. For me, getting rid of the default credentials fixed it. I asked our network guy to make a set of generic credentials (with a static password) and used that instead.

rs.Credentials = new System.Net.NetworkCredential("ACCOUNTNAME", "PASSWORD", "DOMAIN");

Let me know if you still have trouble with this. I spent a lot of time on errors related to this. You also might be able to check your SSRS log files for more information.

Upvotes: 0

Related Questions