as I am sure u are aware there is a new Beta verion of WCF Ria services and the key word is WCF as this brings all the power but complexity to RIA. there are problems with the beta when one use IIS as this MS post http://forums.silverlight.net/forums/p/144989/323349.aspx but MS has provided some answers at http://forums.silverlight.net/forums/p/146135/325334.aspx they solution involves using this code to get around the DiscountASP site is configured with multiple host headers in IIS Problem 2: The website is configured to have multiple addresses/host headers. You can confirm this is what you're running into by navigating to your DomainService (see "problem 0" on how to do that). You should get something related to UriSchemeKeyedCollection and multiple addresses with the same scheme. We are working on a fix to this problem. In the meantime, you can get your service working with one address by plugging in a custom DomainServiceHostFactory. Note that you will have to do this for every DomainService in your project. 1. (One time only.) Add the following class to your project: public namespace System.Web.Ria { public class DomainServiceHostFactoryEx : DomainServiceHostFactory { protected override ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses) { return new DomainServiceHost(serviceType, FilterAddresses(baseAddresses)); } private static Uri[] FilterAddresses(Uri[] baseAddresses) { return baseAddresses.GroupBy(uri => uri.Scheme).SelectMany(uri => uri).ToArray(); } } } 2. Plug-in the factory to every DomainService. Create an .svc file (using the naming convention as described in "problem 0") and put it in the ~/Services directory of your application. In each .svc file, put: <%@ ServiceHost Service="<DomainService full type name>" Factory="System.Web.Ria.DomainServiceHostFactoryEx" %> Now these instructions come right of the MS blog by Wilco as they are trying hard to solve the issue. I implemented the code as instructed but I still get a 404 error running my Silverlight 3 app. Now I am stuck as the real error is masked under the 404 and I cannot run a WCFTrace (unless there is a trick) now i was pointer to this article on your site http://community.discountasp.net/showthread.php?t=4162&highlight=WCF+HTTP+Activation and changed the code to: protected override ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses) { Uri webServiceAddress = new Uri("http://www.sandkeysoftware.com/WizardRIA.web/Services/WizardRIA-Web-GreenDomainService.svc"); MyServiceHost webServiceHost = new MyServiceHost(serviceType, webServiceAddress); return webServiceHost; (baseAddresses)); } and no joy as i still get the 404!
Instead of creating a custom host factory, try just adding this to your app's web.config. Code: <system.serviceModel> <serviceHostingEnvironment> <baseAddressPrefixFilters> <add prefix="http://www.sandkeysoftware.com" /> </baseAddressPrefixFilters> </serviceHostingEnvironment> </system.serviceModel>
I tried that and i still get the 404 error, it makes it hard to solve the problem when one cannot run WCF Trace.
Based on the URL you provided, I'm assuming that the application is at http://www.sandkeysoftware.com/WizardRIA.web. Pulling up that URL gives a configuration error. "Theme 'Basic' cannot be found...' Did you upload the theme files? If the application is giving a configuration error, the service will never work.
I must be missing the point but my web app is a silverlight 3 app so it is started thru wizardRIA.web/WizardRIATestPage.html and my web.config file looks like: <?xml version="1.0"?> <configuration> <configSections> <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/> <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/> <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/> <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/> <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/> </sectionGroup> </sectionGroup> </sectionGroup> </configSections> <appSettings/> <connectionStrings> <add name="GreenConnectionString" connectionString="Server=tcp:st9m7czndl.database.windows.net;Database=Green;User ID=jmcfet;Password=2729deacon!;Trusted_Connection=False;" providerName="System.Data.SqlClient"/> </connectionStrings> <system.web> <!-- Set compilation debug="true" to insert debugging symbols into the compiled page. Because this affects performance, set this value to true only during development. --> <compilation debug="true"> <assemblies> <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> </assemblies> </compilation> <!-- The <authentication> section enables configuration of the security authentication mode used by ASP.NET to identify an incoming user. --> <authentication mode="Windows"/> <!-- The <customErrors> section enables configuration of what to do if/when an unhandled error occurs during the execution of a request. Specifically, it enables developers to configure html error pages to be displayed in place of a error stack trace. <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm"> <error statusCode="403" redirect="NoAccess.htm" /> <error statusCode="404" redirect="FileNotFound.htm" /> </customErrors> --> <pages> <controls> <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> </controls> </pages> <httpHandlers> <add path="*.asmx" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/> <add path="*_AppService.axd" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/> <add path="ScriptResource.axd" verb="GET,HEAD" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/> </httpHandlers> <httpModules> <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> <add name="DomainServiceModule" type="System.Web.Ria.Services.DomainServiceHttpModule, System.Web.Ria, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> </httpModules> </system.web> <system.codedom> <compilers> <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <providerOption name="CompilerVersion" value="v3.5"/> <providerOption name="WarnAsError" value="false"/> </compiler> </compilers> </system.codedom> <!-- The system.webServer section is required for running ASP.NET AJAX under Internet Information Services 7.0. It is not necessary for previous version of IIS. --> <system.webServer> <validation validateIntegratedModeConfiguration="false" /> <modules> <remove name="ScriptModule" /> <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> <add name="DomainServiceModule" preCondition="managedHandler" type="System.Web.Ria.Services.DomainServiceHttpModule, System.Web.Ria, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> </modules> <handlers> <remove name="WebServiceHandlerFactory-Integrated" /> <remove name="ScriptHandlerFactory" /> <remove name="ScriptHandlerFactoryAppServices" /> <remove name="ScriptResource" /> <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> </handlers> </system.webServer> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/> <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/> <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/> </dependentAssembly> </assemblyBinding> </runtime> <system.serviceModel> <serviceHostingEnvironment aspNetCompatibilityEnabled="true"> <baseAddressPrefixFilters> <add prefix="http://www.sandkeysoftware.com" /> </baseAddressPrefixFilters> </serviceHostingEnvironment> </system.serviceModel> </configuration> there is no reference to a theme
a little more info I moved my factory into the code behind for the svc file and on my localsystem (IIS 7) I have a folder called Services it contains my WizardRIA-Web-GreenDomainService.svc and WizardRIA-Web-GreenDomainService.svc.cs file. the latter contains: namespace System.Web.Ria { public class DomainServiceHostFactoryEx : DomainServiceHostFactory { protected override ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses) { //Uri webServiceAddress = new Uri("http://localhost/WizardRIA.web/Services/WizardRIA-Web-GreenDomainService.svc"); //MyServiceHost webServiceHost = new MyServiceHost(serviceType, webServiceAddress); //return webServiceHost; // return new DomainServiceHost(serviceType, new Uri("http://www.sandkeysoftware.com/WizardRIA.web/Services/WizardRIA-Web-GreenDomainService.svc")); return new DomainServiceHost(serviceType, baseAddresses[0]); // return new DomainServiceHost(serviceType, FilterAddresses(baseAddresses)); } the commented code shows my various attempts: Now on my local system if ( type in http://localhost/WizardRIA.web/Services/WizardRIA-Web-GreenDomainService.svc I see the standard response for a WCF service: <----- output GreenDomainService Service You have created a service. To test this service, you will need to create a client and use it to call the service. You can do this using the svcutil.exe tool from the command line with the following syntax: svcutil.exe http://johnlaptop/WizardRIA.Web/Services/WizardRIA-Web-GreenDomainService.svc?wsdl -- end output on your server I see: IIS specified authentication schemes 'Basic, Anonymous', but the binding only supports specification of exactly one authentication scheme. Valid authentication schemes are Digest, Negotiate, NTLM, Basic, or Anonymous. Change the IIS settings so that only a single authentication scheme is used.
If your server is IIS7, you can disable IIS Authentication - Basic Authentication using the IIS Manager. To connect to your site using IIS Manager, see https://support.discountasp.net/KB/a400/how-to-connect-to-windows-2008iis-7-using-microsoft.aspx. If your server is IIS6, then you'll have to create a support ticket to have an admin disable Basic Authentication.