Endpoint not found WCF - json

I have WCF library that I hosted , the login function work well, but the second function ReturnCounter
the interface is :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using System.ServiceModel.Web;
namespace PMAService
{
[ServiceContract]
public interface IPMA
{
[OperationContract]
string Login(string username, string password);
[OperationContract]
List<usp_ReturnEncounter_Result> ReturnEncounter();
}
}
and the code is
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel.Web;
using System.Security.Cryptography;
using System.Web.Security;
namespace PMAService
{
public class PMA : IPMA
{
[WebInvoke(Method = "GET",
ResponseFormat = WebMessageFormat.Json,
UriTemplate = "LogIn/{username}/{password}")]
public string Login(string username, string password)
{
if (Membership.ValidateUser(username, password))
return "true";
else
return "false";
}
// Method to retrieve the Counter
[WebInvoke(Method = "GET",
ResponseFormat = WebMessageFormat.Json,
UriTemplate = "ReturnEncounter")]
public List<usp_ReturnEncounter_Result> ReturnEncounter()
{
using (PMAEntities context = new PMAEntities())
{
return context.usp_ReturnEncounter().ToList();
}
}
}
}
where I connect to Entity framework
the web.config look like
<?xml version="1.0"?>
<configuration>
<appSettings/>
<connectionStrings>
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.0"/>
<roleManager enabled="true" />
<membership>
<providers>
<remove name="AspNetSqlMembershipProvider"/>
<add name="AspNetSqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="Login"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="false"
applicationName="/"
requiresUniqueEmail="false"
passwordFormat="Hashed"
maxInvalidPasswordAttempts="5"
minRequiredPasswordLength="1"
minRequiredNonalphanumericCharacters="0"
passwordAttemptWindow="10"
passwordStrengthRegularExpression="" />
</providers>
</membership>
<authentication mode="Windows"/>
<customErrors mode="On"/>
</system.web>
<system.serviceModel>
<services>
<service name="PMAService.PMA">
<endpoint binding="webHttpBinding" contract="PMAService.IPMA" behaviorConfiguration="web">
</endpoint>
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior name="web">
<webHttp />
</behavior>
</endpointBehaviors>
</behaviors>
</system.serviceModel>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>
the login/x/y work well, while ReturnCounter give the error endpoint not found
any idea to fix that please

First of all enable Tracing on your Service and see what is the cause for exception.
Also you would consider increasing ReaderQuotas on your server and client side so that larger data is passed without any problem. Sample shown below:
<system.serviceModel>
<bindings>
<webHttpBinding>
<binding maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
<security mode="None" />
</binding>
</webHttpBinding>
</bindings>
</system.serviceModel>  
 
Also i see in your code that you are passing the object fetched by entity framework directly. There are situations where the entity framework objects dont get deserialzed and might cause exception. Create a simple POCO and then populate the fetched data and return the POCO.

Why WebInvoke?
For use of a Get operation you need to use WebGet for this Method.
WebInvoke is for just Executing Insert Update Delete uperations.
We use POST, PUT and DELETE method names for them.(Orderly)
When you need to get some data you should do something like that,
[WebGet(UriTemplate = "ReturnEncounter",
RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
As you notice there is a request format this may be XML or JSON enumed on WebMessageFormat.
For post ops. you may use WebRequest object.
Hope helps.

Related

WCF service Post error on IIS 6

I have developed a REST service that used to run localy on my PC and had no issues!!I have hosted my wcf on a windows server 2008-r2 IIS 7.5, in order to call my service from an IP. I am using the get method with a JSON and all works fine, but when i try the post( with chrome plugin) i get 405 error and 500 error. I checked the MIME-TYPES and added json for IIS. Any solution or suggestiong how to resolve this error would be very useful.
I will post my webconfig and ISERVICE files as well.
My webConfig file is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.web>
<compilation targetFramework="4.0" />
</system.web>
<system.serviceModel>
<services>
<service name="RestService.RestServiceImpl" behaviorConfiguration="ServiceBehaviour">
<!-- Service Endpoints -->
<!-- Unless fully qualified, address is relative to base address supplied above -->
<endpoint address="" binding="webHttpBinding" contract="RestService.IRestServiceImpl" behaviorConfiguration="Services.webHttpBehavior">
<!--
Upon deployment, the following identity element should be removed or replaced to reflect the
identity under which the deployed service runs. If removed, WCF will infer an appropriate identity
automatically.
-->
</endpoint>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehaviour">
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true" />
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="web">
<webHttp/>
</behavior>
<behavior name="Services.webHttpBehavior">
<webHttp defaultOutgoingResponseFormat="Json" />
</behavior>
</endpointBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
<diagnostics>
<messageLogging logEntireMessage="true" logMalformedMessages="true" logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" />
</diagnostics>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
<!-- <staticContent>
<mimeMap fileExtension=".json" mimeType="application/json"/>
</staticContent>-->
</system.webServer>
<system.diagnostics>
<sources>
<source name="System.ServiceModel" switchValue="Information, ActivityTracing" propagateActivity="true">
<listeners>
<add name="traceListener" type="System.Diagnostics.XmlWriterTraceListener" initializeData="C:\wcflog3.txt" />
</listeners>
</source>
</sources>
</system.diagnostics>
</configuration>
My Service Implementtion is as followes:
[OperationContract]
[WebInvoke(Method = "GET",
ResponseFormat = WebMessageFormat.Xml,
BodyStyle = WebMessageBodyStyle.Wrapped,
UriTemplate = "xml/{str}")]
string XMLData(string str);
[OperationContract]
[WebInvoke(Method = "POST",
ResponseFormat = WebMessageFormat.Json,
BodyStyle = WebMessageBodyStyle.Bare,
RequestFormat = WebMessageFormat.Json,
UriTemplate = "jsoncheckifexists")]
bool CheckIfExists(RestService.RestServiceImpl.UrlObject data);
The GET is working just fine, I try the POST calling the function CheckIfExists:
public bool CheckIfExists(UrlObject urlObject)
{
string link= urlObject.url;
//Standard logon to CRM procedure(Framework)
if abc=true
return true;
else false;
}

Testing POST request w/ Parameters to WCF Service

I've created a WCF web service which is hosted locally through IIS. I've used the WCF test client to confirm that the service is working properly, and I am now wanting to test through a manual REST call. I'm using RESTClient 3.1 to send the REST calls. I'm able to retrieve results from methods, but my attempts to send JSON in as parameters always results in null parameters. What am I doing wrong? The return body from my request is "FAIL :(" Thanks in advance! I've spent over a day on this problem so far.
Service Contract:
[OperationContract]
[WebInvoke(
Method = "POST",
ResponseFormat = WebMessageFormat.Json,
BodyStyle = WebMessageBodyStyle.Bare)]
public string Route2(Position start)
{
if (start == null)
{
return "FAIL :(";
}
else
{
return "SUCCESS :)";
}
}
** web.config: **
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0"/>
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
<add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</modules>
<handlers>
<add name="UrlRoutingHandler" preCondition="integratedMode" verb="*" path="UrlRouting.axd"/>
</handlers>
<defaultDocument>
<files>
<add value="help" />
</files>
</defaultDocument>
</system.webServer>
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
<services>
<service name="Primordial.GroundGuidance.Service.GroundGuidanceService">
<endpoint address="soap" binding="basicHttpBinding" contract="Primordial.GroundGuidance.Service.GroundGuidanceService" />
<endpoint address="" binding="webHttpBinding" bindingConfiguration=""
name="web" contract="Primordial.GroundGuidance.Service.GroundGuidanceService"
kind="webHttpEndpoint" endpointConfiguration="webEndpointWithHelp" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<standardEndpoints>
<webHttpEndpoint>
<standardEndpoint name="webEndpointWithHelp" helpEnabled="true"/>
</webHttpEndpoint>
</standardEndpoints>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
Because I'm using RESTClient the call isn't just a string/file, but for header value pairs I have:
Accept: application/json
contentType: application/json
The body type is set to "application/json; charset=UTF-8"
body:
{
"elevation": 0,
"latitude": 35.31,
"longitude": -116.41
}
After digging at my problem for another day, it ended up being my JSON, not my use of WCF. I needed to specify the method parameter names in my JSON. For my method
[WebInvoke(
Method = "POST",
ResponseFormat = WebMessageFormat.Json,
BodyStyle = WebMessageBodyStyle.WrappedRequest)]
public string Route2(Position start, Position end)
the appropriate JSON was:
{
"start": {
"elevation": 1,
"latitude": 35.3,
"longitude": -116.4
},
"end": {
"elevation": 1,
"latitude": 35.3,
"longitude": -116.4
}
}

WCF Json GET Service: Check that the sender and receiver's EndpointAddresses agree

I've been working in .NET for a while now, but I'm new to WCF. I'm trying to create my very first WCF service using JSON. I thought I would start really, really simple and then build from there. But I have somehow managed to screw up even the most simple of services. Here's what I've got so far.
Web.Config:
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<services>
<service name="MarathonInfo.MarathonInfoService">
<endpoint address="http://localhost:10298/MarathonInfoService.svc" binding="webHttpBinding" contract="MarathonInfo.IMarathonInfo" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="false" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
Then, in the service file:
namespace MarathonInfo
{
public class MarathonInfoService : IMarathonInfo
{
public String GetData()
{
return "Hello World";
}
}
}
And in the interface:
namespace MarathonInfo
{
[ServiceContract]
public interface IMarathonInfo
{
[OperationContract]
[WebInvoke(Method = "GET", UriTemplate = "/GetData", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
String GetData();
}
}
So, when I go to this url:
http://localhost:10298/MarathonInfoService.svc/GetData
I get this error:
The message with To
'http://localhost:10298/MarathonInfoService.svc/GetData' cannot be
processed at the receiver, due to an AddressFilter mismatch at the
EndpointDispatcher. Check that the sender and receiver's
EndpointAddresses agree.
I am able to execute the service just fine through Visual Studio in debug mode. But in the browser, I only get that error.
What am I doing wrong?
Thanks!
Casey
If you want to create a WCF WebHTTP Endpoint (i.e., one which returns JSON, and uses the [WebGet] / [WebInvoke] attributes), the endpoint needs to have the <webHttp/> behavior associated with it.
<system.serviceModel>
<services>
<service name="MarathonInfo.MarathonInfoService">
<endpoint address="http://localhost:10298/MarathonInfoService.svc"
binding="webHttpBinding"
contract="MarathonInfo.IMarathonInfo"
behaviorConfiguration="Web"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="Web">
<webHttp/>
</behavior>
</endpointBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="false" />
</system.serviceModel>

WCF JSON implementation

I'm trying to implement a very simple WCF service that returns JSON. I'm trying for 6 hours now and it still doesn't work. I hope you can help me out with this.
Person
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
namespace Tcf.AtX.Services
{
[DataContract]
public class Person
{
[DataMember]
public string Name { get; set; }
}
}
Service Contract
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using System.ServiceModel.Web;
namespace Tcf.AtX.Services
{
[ServiceContract]
public interface IBroadcastService
{
/// <summary>
/// Broadcasts the specified message.
/// </summary>
/// <param name="message">The message.</param>
/// <returns></returns>
[OperationContract]
[WebInvoke(Method="GET", ResponseFormat= WebMessageFormat.Json)]
Person Broadcast(string message);
}
}
Service Implementation
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Tcf.AtX.Broadcasting;
namespace Tcf.AtX.Services
{
public class BroadcastService : IBroadcastService
{
/// <summary>
/// Broadcasts the specified message.
/// </summary>
/// <param name="message">The message.</param>
/// <returns></returns>
public Person Broadcast(string message)
{
return new Person() { Name = message };
}
}
}
Configuration
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true"/>
</system.web>
<system.serviceModel>
<services>
<service name="Tcf.AtX.Services.BroadcastService">
<endpoint address="" binding="webHttpBinding" contract="Tcf.AtX.Services.IBroadcastService" behaviorConfiguration="json"/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8732/Design_Time_Addresses/Tcf.AtX.Services/BroadcastService/" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior name="json">
<webHttp />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
The problem is that i don't see the service inside the test client, so i can't test my method.
I also wrote a test client myself, but i can't create an instance of my service when i reference it to my project.
Can someone please explain to me what i'm doing wrong?
Best regards,
Rob
The test client doesn't work for non-SOAP endpoints (i.e., the one you have, which uses the WebHttpBinding). Try simply creating a program that tries to call the operation you have, something like the code below
WebClient c = new WebClient();
Console.WriteLine(
c.DownloadString(
"http://localhost:8732/Design_Time_Addresses/Tcf.AtX.Services/Broadcast?message=MyMessage"));
One more thing, you'll need to change the [WebInvoke(Method="GET")] attribute to [WebGet].

Windsor IHandlerSelector in RIA Services Visual Studio 2010 Beta2

I want to implement multi tenancy using Windsor and i don't know how to handle this situation:
i succesfully used this technique in plain ASP.NET MVC projects and thought incorporating in a RIA Services project would be similar.
So i used IHandlerSelector, registered some components and wrote an ASP.NET MVC view to verify it works in a plain ASP.NET MVC environment. And it did!
Next step was to create a DomainService which got an IRepository injected in the constructor. This service is hosted in the ASP.NET MVC application. And it actually ... works:i can get data out of it to a Silverlight application.
Sample snippet:
public OrganizationDomainService(IRepository<Culture> cultureRepository)
{
this.cultureRepository = cultureRepository;
}
Last step is to see if it works multi-tenant-like: it does not! The weird thing is this:
using some line of code and writing debug messages in a log file i verified that the correct handler is selected! BUT this handler seems not to be injected in the DomainService. I ALWAYS get the first handler (that's the logic in my SelectHandler)
Can anybody verify this behavior? Is injection not working in RIA Services? Or am i missing something basic??
Development environment: Visual Studio 2010 Beta2
Thanks in advance
So it seems i did a very weird thing in my OrganizationDomainServiceFactory.
The code which did NOT work is this:
public DomainService CreateDomainService(Type domainServiceType, DomainServiceContext context )
{
WindsorContainer container = new WindsorContainer(new XmlInterpreter(new ConfigResource("castle")));
IRepository<Culture> cultureRepository = container.Resolve<IRepository<Culture>>();
IRepository<Currency> currencyRepository = container.Resolve<IRepository<Currency>>();
DomainService ds = (DomainService)Activator.CreateInstance(domainServiceType, new object[] { cultureRepository,currencyRepository });
ds.Initialize(context);
return ds;
}
This is apparently not working, because of the creation of a new Container (which should not take place).
OK! So i thought i try to use ServiceLocator to get a reference to the Windsor Container (used in the WindsorControllerFactory - that's how i call it ... in the boot up of the ASP.NET MVC application), and changed the code to this:
public DomainService CreateDomainService(Type domainServiceType, DomainServiceContext context )
{
IRepository<Culture> cultureRepository = ServiceLocator.Current.GetInstance<IRepository<Culture>>();
IRepository<Currency> currencyRepository = ServiceLocator.Current.GetInstance<IRepository<Currency>>();
DomainService ds = (DomainService)Activator.CreateInstance(domainServiceType, new object[] { cultureRepository,currencyRepository });
ds.Initialize(context);
return ds;
}
and guess what: it works(!!!) multi-tenancy as it should be!
The only thing i don't know is: is there another way to "inject" the container (constructor injection seems not to work here , the compiler complains)
BTW: moved the project from VS2010Beta2 to VS2010RC (with RIA Services support), but this should not affect the outcome!
Yes i have seen this thread and i already have implemented this.
Firstly have in mind that i have used this line in Global.asax.cs to get the RIA services properly behave (hosted in an ASP.NET MVC view)
routes.IgnoreRoute("{*allsvc}", new { allsvc = #".*\.svc(/.*)?" });
Here is some code:
public class HostBasedComponentSelector : IHandlerSelector
{
private readonly Type[] selectableTypes;
public HostBasedComponentSelector(params Type[] selectableTypes)
{
this.selectableTypes = selectableTypes;
}
public bool HasOpinionAbout(string key, Type service)
{
foreach (var type in selectableTypes)
{
if (service == type) return true;
}
return false;
}
public IHandler SelectHandler(string key, Type service, IHandler[] handlers)
{
//only for debug
StreamWriter sw = new StreamWriter(#"c:\temp\Debug.log",true);
sw.WriteLine(DateTime.Now + " " + service.Name + " " + GetHostname() );
sw.WriteLine("Available handlers");
foreach(IHandler h in handlers )
{
sw.WriteLine ("Handler "+h.ComponentModel.Name);
}
var id = string.Format("{0}:{1}", service.Name, GetHostname());
var selectedHandler = handlers.Where(h => h.ComponentModel.Name == id).FirstOrDefault() ??
GetDefaultHandler(service, handlers);
sw.WriteLine("Selected handler " + selectedHandler.ComponentModel.Name);
sw.WriteLine("----------- END ----------");
sw.Flush();
sw.Close();
return selectedHandler;
}
private IHandler GetDefaultHandler(Type service, IHandler[] handlers)
{
if (handlers.Length == 0)
{
throw new ApplicationException("No components registered for service {0} With service.Name" + service.Name);
}
return handlers[0];
}
protected string GetHostname()
{
return HttpContext.Current.Request.ServerVariables["SERVER_NAME"];
}
}
Here is the complete web.config. Notice registering the OrganizationDomainServiceFactory (it is the implementation of the article you mentioned)
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=152368
-->
<configuration>
<configSections>
<section name="castle" type="Castle.Windsor.Configuration.AppDomain.CastleSectionHandler,Castle.Windsor"/>
</configSections>
<connectionStrings>
<add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/>
</connectionStrings>
<castle>
<properties>
<sqlConnStr>
<!--metadata=res://*/WebShop.csdl|res://*/WebShop.ssdl|res://*/WebShop.msl;provider=System.Data.SqlClient;provider connection string="Data Source=.\SQLEXPRESS;Initial Catalog=iWebShop;User ID=sa;Password=xxx;MultipleActiveResultSets=True"-->
</sqlConnStr>
</properties>
<components>
<component id="CommonObjectContext" service="TestRIA1.Abstract.IObjectContext, TestRIA1" type="TestRIA1.Concrete.ObjectContextAdapter, TestRIA1" lifestyle="PerWebRequest">
</component>
<component id="IConnectionStringProvider:test.gammasys.gr" service="TestRIA1.Abstract.IConnectionStringProvider, TestRIA1" type="TestRIA1.Concrete.ConnectionStringProvider, TestRIA1" lifestyle="transient">
<parameters>
<ConnectionString>
metadata=res://*/WebShop.csdl|res://*/WebShop.ssdl|res://*/WebShop.msl;provider=System.Data.SqlClient;provider connection string="Data Source=.\SQLEXPRESS;Initial Catalog=iWebShop;User ID=sa;Password=xxx;MultipleActiveResultSets=True"
</ConnectionString>
</parameters>
</component>
<component id="IConnectionStringProvider:test.deltasys.gr" service="TestRIA1.Abstract.IConnectionStringProvider, TestRIA1" type="TestRIA1.Concrete.ConnectionStringProvider, TestRIA1" lifestyle="transient">
<parameters>
<ConnectionString>
metadata=res://*/WebShop.csdl|res://*/WebShop.ssdl|res://*/WebShop.msl;provider=System.Data.SqlClient;provider connection string="Data Source=.\SQLEXPRESS;Initial Catalog=iWebShop2;User ID=sa;Password=xxx;MultipleActiveResultSets=True"
</ConnectionString>
</parameters>
</component>
<component id="Commonrepository" service="TestRIA1.Abstract.IRepository`1, TestRIA1" type="TestRIA1.Concrete.Repository`1, TestRIA1" lifestyle="PerWebRequest"/>
<component id="urlbased.handlerselector" service="Castle.MicroKernel.IHandlerSelector, Castle.MicroKernel" type="TestRIA1.HostBasedComponentSelector, TestRIA1" lifestyle="transient">
<parameters>
<selectableTypes>
<array>
<item>TestRIA1.Abstract.IConnectionStringProvider, TestRIA1</item>
</array>
</selectableTypes>
</parameters>
</component>
</components>
</castle>
<system.web>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</assemblies>
</compilation>
<authentication mode="Forms">
<forms loginUrl="~/Account/LogOn" timeout="2880"/>
</authentication>
<membership>
<providers>
<clear/>
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/"/>
</providers>
</membership>
<profile>
<providers>
<clear/>
<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/>
</providers>
</profile>
<roleManager enabled="false">
<providers>
<clear/>
<add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/"/>
<add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/"/>
</providers>
</roleManager>
<pages>
<namespaces>
<add namespace="System.Web.Mvc"/>
<add namespace="System.Web.Mvc.Ajax"/>
<add namespace="System.Web.Mvc.Html"/>
<add namespace="System.Web.Routing"/>
</namespaces>
</pages>
<httpHandlers>
<add verb="*" path="*.mvc" validate="false" type="System.Web.Mvc.MvcHttpHandler"/>
</httpHandlers>
<httpModules>
<add name="PerRequestLifestyle" type="Castle.MicroKernel.Lifestyle.PerWebRequestLifestyleModule,Castle.MicroKernel " />
<add name="DomainServiceModule" type="System.Web.Ria.Services.DomainServiceHttpModule, System.Web.Ria, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</httpModules>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true">
<add name="DomainServiceModule" preCondition="managedHandler"
type="System.Web.Ria.Services.DomainServiceHttpModule, System.Web.Ria, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<remove name="PerRequestLifestyle"/>
<add name="PerRequestLifestyle" preCondition="managedHandler" type="Castle.MicroKernel.Lifestyle.PerWebRequestLifestyleModule,Castle.MicroKernel" />
<!--to get IoC initialization of DomainService -->
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="OrganizationDomainServiceFactory" type="TestRIA1.OrganizationDomainServiceFactory"/>
<!-- End of IoC initial..... -->
</modules>
<handlers>
<remove name="MvcHttpHandler" />
<add name="MvcHttpHandler" preCondition="integratedMode" verb="*"
path="*.mvc" type="System.Web.Mvc.MvcHttpHandler" />
</handlers>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
</system.serviceModel>
</configuration>
Hope this is enough. In case you would like to have the complete project i can send you a copy (this is a pre-production test project).
Thank you very much for the time you spend!