an ASP.NET Open Source CMS & eCommerce platform
Search:
Skip Navigation LinksHome > DotShoppingCart Forums > Development > General Programming > EndPoint in Silverlight Chart Control
Last Post 3/27/2012 12:25:18 AM By TAhmad. 14 replies.
Page 1 of 2 (15 posts) << First < Prev 1 2 Next > Last >> 
2/16/2010 10:23:48 AM
Applied
Posts: 93
Joined: 9/18/2009
EndPoint in Silverlight Chart Control
I can get the 'localhost' site metrics silverlight control (incl graphs) to display ok.
 
It looks as if you set the endpoint dynamically and in debug mode this appears to be so.
 
But when using a 'proper' url I am getting a 'notfound' error regarding the service file. Do I need to amend the xap file (clientconfig file) as well, or should the charting just work dynamically no matter where the site is running?
 
 
2/16/2010 3:43:26 PM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: EndPoint in Silverlight Chart Control
It's done dynamically. No need to change anything.
DotShoppingCart Staff
4/19/2010 9:10:36 AM
Applied
Posts: 93
Joined: 9/18/2009
Re: EndPoint in Silverlight Chart Control
I am still having issues with this. On our deployed web server, the 'test' web site works ok (i.e. the 4 charts at the top of the home page in admin mode display properly), but the 'live' web site fails. Apart from web.config, everything is the same in both file locations.
 
Any thoughts?
 
4/19/2010 10:40:26 AM
Applied
Posts: 93
Joined: 9/18/2009
Re: EndPoint in Silverlight Chart Control
I can replicate the error locally by having a web page with the same silverlight object in it.
 
I get this:
 
{System.Net.WebException: The remote server returned an error: NotFound.
   at System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)}
 
 
4/19/2010 10:50:50 AM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: EndPoint in Silverlight Chart Control
Does this thread help?
DotShoppingCart Staff
4/19/2010 11:10:06 AM
Applied
Posts: 93
Joined: 9/18/2009
Re: EndPoint in Silverlight Chart Control
The web.config files in my live/test paths are both modified to use 'httpsGetEnabled' and 'transport' (certificate is installed).
 
The SiteMetrics.svc is in the \Admin\Service path on both live and test sites, and has the same contents.
 
The ClientBin folders both have the same ChartingReport.xap.
 
The App_Code folders both have the SiteMetrics.cs file.
 
But there must be something else, because locally (here on my dev machine) and on the remote web test site the charts work, just not on the live web (which is the same machine BTW).
 
 
 
4/19/2010 12:01:54 PM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: EndPoint in Silverlight Chart Control
Have you done Step 2 "Register WCF service on IIS" described in the online help about installation?
DotShoppingCart Staff
4/20/2010 12:11:18 AM
Applied
Posts: 93
Joined: 9/18/2009
Re: EndPoint in Silverlight Chart Control
Yes, please note that the same machine hosts the live AND test webs. If I debug the code remotely in Visual Studio I can see that the service url appears to be correct (e.g. https://whatever.com/admin/service/sitemetrics.svc), but that a 'result' is not returned (causing an exception) due to the 'not found' problem.
4/21/2010 5:42:47 PM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: EndPoint in Silverlight Chart Control
Does browsing to https://whatever.com/admin/service/sitemetrics.svc show anything?
DotShoppingCart Staff
4/22/2010 2:39:10 AM
Applied
Posts: 93
Joined: 9/18/2009
Re: EndPoint in Silverlight Chart Control
Finally got a meaningful error message back from the web site.
 
Navigating to the sitemetrics.svc on 'test' web is ok.
 
On the 'live' web I get this error detail (both web configs are the same in terms of SiteMetricsBehavior and SecureBasicHttpBinding):
 
System.ServiceModel.ServiceActivationException: The service '/Admin/service/sitemetrics.svc' cannot be activated due to an exception during compilation. The exception message is: This collection already contains an address with scheme http. There can be at most one address per scheme in this collection.
Parameter name: item. ---> System.ArgumentException: This collection already contains an address with scheme http. There can be at most one address per scheme in this collection. Parameter name: item at System.ServiceModel.UriSchemeKeyedCollection.InsertItem(Int32 index, Uri item) at System.Collections.Generic.SynchronizedCollection`1.Add(T item) at System.ServiceModel.UriSchemeKeyedCollection..ctor(Uri[] addresses) at System.ServiceModel.ServiceHost..ctor(Type serviceType, Uri[] baseAddresses) at System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(Type serviceType, Uri[] baseAddresses) at System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses) at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CreateService(String normalizedVirtualPath) at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(String normalizedVirtualPath) at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) --- End of inner exception stack trace --- at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result) at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication context, Boolean flowContext) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

 


 
 
 
4/22/2010 3:23:08 AM
Applied
Posts: 93
Joined: 9/18/2009
Re: EndPoint in Silverlight Chart Control
MORE INFORMATION
 
I found an article on the web that says to use a custom service factory (see http://alpascual.com/blog/silverlight-svc-web-service-problems-on-iis/)
 
So I amended SiteMetrics.scv to read like this:
 
<%@ ServiceHost Language="C#" Debug="true" Factory="CustomHostFactory" Service="SiteMetrics" CodeBehind="/App_Code/SiteMetrics.cs" %>
 
Then I amended App_Code/SiteMetrics.cs to add in this:
 
public class CustomHostFactory : ServiceHostFactory
    {
        protected override ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses)
        {
              CustomHost customServiceHost =
                new CustomHost(serviceType, baseAddresses[0]);
            return customServiceHost;
        }
    }
 public   class CustomHost : ServiceHost
    {
        public CustomHost(Type serviceType, params Uri[] baseAddresses)
            : base(serviceType, baseAddresses)
        { }
        protected override void ApplyConfiguration()
        {
            base.ApplyConfiguration();
        }
    }

 
Now I at least can get the Silverlight charts to work but only in http mode not https mode.
 
However I am still mystified as to why it all works on the same server/IIS on the test web app which is also https.
 
Page 1 of 2 (15 posts) << First < Prev 1 2 Next > Last >>