Quantcast
Channel: CSLA .NET
Viewing all articles
Browse latest Browse all 764

using WCF service in mvc with csla

$
0
0

I have a WCF service Provided by csla. I want to consume this service in my MVC Project.I have create a object of service like below:

ServiceReference2.WcfPortalClient obj =newServiceReference2.WcfPortalClient();
ApplicationApp=newApplication();
varAppType=App.GetType();
ApplicationCriteriaCriteria=newApplicationCriteria{ApplicationName="application"};
ServiceReference2.FetchRequestFetch1=newServiceReference2.FetchRequest();
CslaTest.ServiceReference2.DataPortalContext context =newServiceReference2.DataPortalContext();
Fetch1._context = context;
Fetch1._objectType=AppType;
Fetch1._criteria =Criteria;
var list = obj.Fetch(Fetch1);
Getting error as:
Type'CslaTest.BusinessLibrary.ApplicationCriteria'with data contract name 'ApplicationCriteria:http://schemas.datacontract.org/2004/07/CslaTest.BusinessLibrary'isnot expected.Considerusing a DataContractResolveror add any types not known statically to the list of known types -for example,byusing the KnownTypeAttribute attribute orby adding them to the list of known types passed to DataContractSerializer.'

Viewing all articles
Browse latest Browse all 764

Trending Articles