January 17, 2024 at 1:31 pm
We have been using the ReportExecution2005.asmx endpoint in my C# web application to download SSRS reports. We are turning on https on our SQL servers and need to know how to convert the following in my web.config file to work with https. Obviously, the endpoint address will change to https. I just don't know how to change the binding and I can't find any good working examples.
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="ReportExecutionServiceSoap" closeTimeout="00:02:00" openTimeout="00:02:00" receiveTimeout="00:10:00" sendTimeout="00:02:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="50000000" maxBufferPoolSize="5000000" maxReceivedMessageSize="50000000" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Ntlm" proxyCredentialType="None" realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://servername/ReportServer/ReportExecution2005.asmx" binding="basicHttpBinding" bindingConfiguration="ReportExecutionServiceSoap" contract="ReportingServer2008.ReportExecutionServiceSoap" name="ReportExecutionServiceSoap" />
</client>
</system.serviceModel>
January 17, 2024 at 2:44 pm
Are you really using SSRS 2005 or 2008? If so, I would recommend upgrading to a supported platform.
But, I wouldn't recommend adjusting the files manually when there is a GUI for it. There is actually an article on here (SSC) about this:
https://www.sqlservercentral.com/articles/configure-ssrs-with-an-ssl-certificate
That link is for a self signed certificate, but I recommend getting a certificate from a CA your domain trusts. Otherwise end users will get notification that the certificate is not trusted.
I personally do NOT recommend editing the file manually as there are tools to do it for you and they will help prevent typos.
The above is all just my opinion on what you should do.
As with all advice you find on a random internet forum - you shouldn't blindly follow it. Always test on a test server to see if there is negative side effects before making changes to live!
I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.
January 17, 2024 at 3:34 pm
No, we are using SQL 2016 and 2019. The ReportExecution2005.asmx is the end point to call the SSRS web service as outlined at https://learn.microsoft.com/en-us/sql/reporting-services/report-server-web-service/methods/report-server-web-service-endpoints?view=sql-server-ver16.
We have a web application that is calling the web service using the class ReportExecutionServiceSoapClient in C#. When we switched it to https and called the report, the service is failing with the following error.
The provided URI scheme 'https' is invalid; expected 'http'.
I'm thinking changing the endpoint settings in our web.config might resolve the issue.
fyi... Our cert is working fine so I'm good there.
January 17, 2024 at 4:20 pm
To confirm, if you try to access SSRS via the web instead of your C# app, HTTPS is working correct? I would make sure that it is working from the web side of things before working on the app side of things. If it is working on the web browser side (chrome/edge/etc) without any warnings or errors with HTTPS.
Also, have you refreshed your WSDL in Visual Studio after changing the configuration over from HTTP to HTTPS? Offhand, I am not certain if the WSDL is specific to your instance or if it is generic, but I know working with WSDL's of other systems, I've needed to refresh them (or sometimes completely delete and readd them) when I've made changes to the back end system AND the WSDL is instance specific instead of generic.
The above is all just my opinion on what you should do.
As with all advice you find on a random internet forum - you shouldn't blindly follow it. Always test on a test server to see if there is negative side effects before making changes to live!
I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.
January 22, 2024 at 9:18 pm
We ended up changing our code to execute and download the report using HTTPClient method using the HTTPS URL of the report.
This link Microsoft explains how it works. Attached is some sample code.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply