This is a migrated thread and some comments may be shown as answers.

Silverlight reporting using both HTTP and HTTPS

5 Answers 336 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Russell Damske
Top achievements
Rank 1
Russell Damske asked on 22 Jun 2011, 10:18 PM
Hey there, 

I am working on a silverlight business application that can be accessed using both HTTP and HTTPS. Telerik reporting runs fine over HTTP and after I found this article (http://www.telerik.com/help/reporting/silverlight-enable-ssl-for-telerik-reporting-wcf-service.html) I added the bindingConfiguration to my web.config file and it now works on HTTPS, but it no longer works on HTTP. What can I do to allow it to run on both HTTP and HTTPS?

Thanks!

5 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 24 Jun 2011, 01:43 PM
Hello Russell,

You simply need to define two endpoints for each of the protocols e.g.:
Copy Code
                 binding="basicHttpBinding"
                 bindingConfiguration="SecuredBasicHttpBindingConfig"
                 contract="Telerik.Reporting.Service.IReportService">
         <identity>
           <dns value="localhost" />
         </identity>
       </endpoint>
        
                 binding="basicHttpBinding"
                 contract="Telerik.Reporting.Service.IReportService">
         <identity>
           <dns value="localhost" />
         </identity>
       </endpoint>


Best wishes,
Steve
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Brian
Top achievements
Rank 1
answered on 17 Oct 2011, 08:57 PM
Steve,
My problem is similar, but I would like to access the Telerik reporting service over http in development while still allowing https in production environments.  I was able to access the Telerik reporting service over http before I tried to set up the https configuration, but now I am getting an error.  Since I do not know the port number that the VS.Net web server will be running on until it is running, I can't set an endpoint address in the web.config.  When I try to access the Telerik reporting service over http now, I get this error:

Server Error in '/' Application.

Could not find a base address that matches scheme https for the endpoint with binding BasicHttpBinding. Registered base address schemes are [http].

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Could not find a base address that matches scheme https for the endpoint with binding BasicHttpBinding. Registered base address schemes are [http].

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[InvalidOperationException: Could not find a base address that matches scheme https for the endpoint with binding BasicHttpBinding. Registered base address schemes are [http].]
   System.ServiceModel.ServiceHostBase.MakeAbsoluteUri(Uri relativeOrAbsoluteUri, Binding binding, UriSchemeKeyedCollection baseAddresses) +12349612
   System.ServiceModel.Description.ConfigLoader.LoadServiceDescription(ServiceHostBase host, ServiceDescription description, ServiceElement serviceElement, Action`1 addBaseAddress) +12346965
   System.ServiceModel.ServiceHostBase.LoadConfigurationSectionInternal(ConfigLoader configLoader, ServiceDescription description, ServiceElement serviceSection) +67
   System.ServiceModel.ServiceHostBase.ApplyConfiguration() +108
   System.ServiceModel.ServiceHostBase.InitializeDescription(UriSchemeKeyedCollection baseAddresses) +192
   System.ServiceModel.ServiceHost.InitializeDescription(Type serviceType, UriSchemeKeyedCollection baseAddresses) +49
   System.ServiceModel.ServiceHost..ctor(Type serviceType, Uri[] baseAddresses) +151
   System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(Type serviceType, Uri[] baseAddresses) +30
   System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses) +422
   System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath) +1461
   System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +44
   System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +651

[ServiceActivationException: The service '/ReportService.svc' cannot be activated due to an exception during compilation.  The exception message is: Could not find a base address that matches scheme https for the endpoint with binding BasicHttpBinding. Registered base address schemes are [http]..]
   System.Runtime.AsyncResult.End(IAsyncResult result) +688590
   System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +190
   System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication context, String routeServiceVirtualPath, Boolean flowContext, Boolean ensureWFService) +234
   System.ServiceModel.Activation.HttpHandler.ProcessRequest(HttpContext context) +24
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +100
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

Here is the system.serviceModel section from my web.config:

<system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="BasicHttpsBindingConfig">
          <security mode="Transport"/>
        </binding>
      </basicHttpBinding>
      <webHttpBinding>
        <binding name="WebHttpBindingConfig">
          <security mode="Transport"/>
        </binding>
      </webHttpBinding>
    </bindings>
    <services>
      <service
              name="Telerik.Reporting.Service.ReportService"
              behaviorConfiguration="ReportServiceBehavior">
        <endpoint
               address=""
               binding="basicHttpBinding"
               contract="Telerik.Reporting.Service.IReportService">
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>
        <endpoint
               address=""
               binding="basicHttpBinding"
               bindingConfiguration="BasicHttpsBindingConfig"
               contract="Telerik.Reporting.Service.IReportService">
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>
        <endpoint
                address="resources"
                binding="webHttpBinding"
                bindingConfiguration="WebHttpBindingConfig"
                behaviorConfiguration="WebBehavior"
                contract="Telerik.Reporting.Service.IResourceService"/>
        <endpoint
                address="mex"
                binding="mexHttpsBinding"
                contract="IMetadataExchange" />
      </service>
    </services>
 
    <behaviors>
      <serviceBehaviors>
        <behavior name="">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
        <behavior name="ReportServiceBehavior">
          <serviceMetadata httpsGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
      <endpointBehaviors>
        <behavior name="WebBehavior">
          <webHttp />
        </behavior>
      </endpointBehaviors>
    </behaviors>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true"
      multipleSiteBindingsEnabled="true" />
  </system.serviceModel>

0
Chavdar
Telerik team
answered on 20 Oct 2011, 02:06 PM
Hi Brian,

You can instruct the VS Web Development Server to use always one and the same port every time through the settings of the Web Application project. Please, check the attached screenshot. In this way each time you start the application the port number will be the same.

Hope this helps.

Kind regards,
Chavdar
the Telerik team

Q2’11 SP1 of Telerik Reporting is available for download (see what's new). Get it today.

0
JULIO
Top achievements
Rank 1
answered on 20 Jan 2012, 06:57 PM
¿Cual es la definición dentro del webconfig para SecuredBasicHttpBindingConfig?
0
Steve
Telerik team
answered on 21 Jan 2012, 11:05 AM
Hello JULIO,

Please note that only English language is used for our support communication. We kindly ask you to use English for future posts.

As for your inquiry, you can find more information in the Enable SSL for Telerik Reporting WCF service help article.

All the best,
Steve
the Telerik team

Q3’11 of Telerik Reporting is available for download. Register for the What's New in Data Tools webinar to see what's new and get a chance to WIN A FREE LICENSE!

Tags
General Discussions
Asked by
Russell Damske
Top achievements
Rank 1
Answers by
Steve
Telerik team
Brian
Top achievements
Rank 1
Chavdar
Telerik team
JULIO
Top achievements
Rank 1
Share this question
or