Could not connect to server

  • I'm trying to use rs.exe to publish my reports and am getting this error:

    Could not connect to server: http://www.myserver.com/reportserver/ReportService.asmx

    For publishing purposes, I've lowered the security to see if it would help by changing the security level from 2 to 0 in the key <Add Key="SecureConnectionLevel" Value="0"> within the file C:\Program Files\Microsoft SQL Server\MSSQL\Reporting Services\ReportServer\RSReportServer.config

    Also for note, in the file C:\Program Files\Microsoft SQL Server\MSSQL\Reporting Services\ReportManager\RSWebApplication.config:

    <Configuration>

      <UI>

        <ReportServerUrl>http://www.myserver.com/reportserver</ReportServerUrl&gt;

    Any help would be appreciated.

  • This was removed by the editor as SPAM

  • Can you post the command line call you're making to rs.exe?

    Steve.

  • I tried both of these with and without https.

    rs -i PublishReports.rss -s http://machinename/reportserver

    rs -i PublishReports.rss -s http://www.mydomainname.com/reportserver

  • What happens if you try to just hit http://machinename.reportserver/reportservices.asmx directly yourself in a browser?

    You're not passing variables as well? Apparently there was (is?) a bug with passing >2 parms, one of which has a backslash in it (may have been fixed in SP2 cause I can't fault my install).

    Does the command window even get to trying to compile the script (ie comand window changes name to <rand_name>.exe?

    Steve.

  • I presume that was a typo and should read http://machinename/reportserver/reportservices.asmx there was a "." before and I put in "/"

    When I put that in a browser it prompts me for credentials and upon acceptance I'm presented with a listing of my folders that contain my reports (previously uploaded).

    Doing this, there is no command window that comes up.

  • Sorry for the typo

    Based on what youve just posted, and assuming your first post was to the letter accurate, then you probably need to add the -u and -p parms to the command line call.

    rs –i Script.rss -s http://servername/reportserver -u myusername -p mypassword

     

    Steve.

  • I added the parameters -u and -p. This time it seems to connect but...

    The request failed with HTTP status 401: Unauthorized.

    I receive that message for each report I'm trying, also receive it when using servername as well as http://www.mydomainname.com.

    I'm connecting as administrator to the machine and in the parameters.

    IIS and SQL Server are all on this same machine.

  • At least you're connecting now    What are the site settings and role settings within your RS catalog?  Are you able to post your rss file (PM it if you want)?  I have a pretty simple (and somewhat useless) script that reports to screen the security settings for the items in the catalog (ie it's read-only).  I can post this through if you'd like to test an alternate script.

    Steve.

  • Dim dropFolder = "C:\webReports"

    Dim databaseName = "mydb"

    Dim sqlServerName = "mydbserver"

    Dim sqlUserName = "myusername"

    Dim sqlPassword = "mypassword"

    Dim parentFolder AS String'folder to publish reports to.

    Dim definition As [Byte]() = Nothing

    Dim warnings As Warning() = Nothing

    Dim parentPath As String

    Dim filePath As String'temp folder of rdl files.

    Public Sub Main()

    rs.Credentials = System.Net.CredentialCache.DefaultCredentials

    Dim name As String

    '##################################

    'First, deal with the Summary Reports

    parentFolder = "Summary Reports"

    parentPath = "/" + parentFolder

    filePath = dropFolder + "\Summary Reports\"

    'Create the parent folder

    Try

    rs.CreateFolder(parentFolder, "/", Nothing)

    Console.WriteLine("Parent folder created: {0}", parentFolder)

    Catch e As Exception

    Console.WriteLine(e.Message)

    End Try

    'Create the shared data source

    CreateDataSource()

    'Publish the summary reports NOTE: remove file extension

    PublishReport("760.S01 - DODAAC Summary Inventory Report by Asset Type")

    '##################################

    'Second, deal with Detail Reports

    parentFolder = "Detail Reports"

    parentPath = "/" + parentFolder

    filePath = dropFolder + "\Detail Reports\"

    'Create the parent folder

    Try

    rs.CreateFolder(parentFolder, "/", Nothing)

    Console.WriteLine("Parent folder created: {0}", parentFolder)

    Catch e As Exception

    Console.WriteLine(e.Message)

    End Try

    'Create the shared data source

    CreateDataSource()

    'Publish the sample reports NOTE: remove file extension

    PublishReport("760.D01 - DODAAC Detail Inventory Report by Asset Type")

    '##################################

    'Third, deal with Transaction Reports

    parentFolder = "Transaction Reports"

    parentPath = "/" + parentFolder

    filePath = dropFolder + "\Transaction Reports\"

    'Create the parent folder

    Try

    rs.CreateFolder(parentFolder, "/", Nothing)

    Console.WriteLine("Parent folder created: {0}", parentFolder)

    Catch e As Exception

    Console.WriteLine(e.Message)

    End Try

    'Create the shared data source

    CreateDataSource()

    'Publish the sample reports NOTE: remove file extension

    PublishReport("760.T01 DODAAC Transaction - Assets Received into Inventory")

    End Sub

    '##################################

    '##################################

    Public Sub CreateDataSource()

    Dim name As String = "rsDataSource"

    Dim parent As String = "/" + parentFolder

    'Define the data source definition.

    Dim definition As New DataSourceDefinition()

    definition.CredentialRetrieval = CredentialRetrievalEnum.Integrated

    definition.CredentialRetrieval = CredentialRetrievalEnum.Store

    definition.ConnectString = "data source=" & sqlServerName & ";initial catalog=" & databaseName

    definition.Enabled = True

    definition.EnabledSpecified = True

    definition.Extension = "SQL"

    definition.ImpersonateUser = False

    definition.ImpersonateUserSpecified = True

    definition.WindowsCredentials = False

    definition.UserName = sqlUserName

    definition.Password = sqlPassword

    Try

    rs.CreateDataSource(name, parent, True, definition, Nothing)

    Catch e As Exception

    Console.WriteLine(e.Message)

    End Try

    End Sub

    '##################################

    '##################################

    Public Sub PublishReport(ByVal reportName As String)

    Try

    Dim stream As FileStream = File.OpenRead(filePath + reportName + ".rdl")

    definition = New [Byte](stream.Length) {}

    stream.Read(definition, 0, CInt(stream.Length))

    stream.Close()

    Catch e As IOException

    Console.WriteLine(e.Message)

    End Try

    Try

    warnings = rs.CreateReport(reportName, parentPath, False, definition, Nothing)

    If Not (warnings Is Nothing) Then

    Dim warning As Warning

    For Each warning In warnings

    Console.WriteLine(warning.Message)

    Next warning

    Else

    Console.WriteLine("Report: {0} published successfully with no warnings", reportName)

    End If

    Catch e As Exception

    Console.WriteLine(e.Message)

    End Try

    End Sub

    '##################################

  • Does it let you create the folders and errors just on the publishing of the report/s?

    Steve.

  • Won't let me create folders either.

  • very strange.  Your script worked perfectly on my local install (WinXP SP2, RS SP2) - apart from me not having the reports of course.

    What OS is the server?  If it's 2003, does it have MOM installed on there also?  And what SP is your RS installation on the server?

    Steve.

  • Windows 2003 SP1 (without MOM), RS SP2.

  • Was this problem ever resolved?

    I am having the exact same problem

Viewing 15 posts - 1 through 15 (of 15 total)

You must be logged in to reply to this topic. Login to reply