Click here to Skip to main content
15,894,405 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
Hi All, 

I want help in MVC application for some different type of scenario  using WCF service is that 

1. MVC application 
2. WCF service 

MVC application : 
1 it include more than one data model class 
2 MVC application consume WCF service 

WCF Service : 

1 it have more that one class and methods 

2. one method is Service method 
  this method have Type parameter : for find class object and member 


now scenario is 

whenever i called action i want to create a class object which is written in MVC application 
and this object pass to wcf service method which have Type reference 

when wcf get the object from mvc application in the form of Type reference then I want to access the member and method of that object in WCF 

 and JSON format pass it to again MVC applicaiton 

means creating object passing to WCF service and access the method , member of that object then return back to MVC application 

 is it possible in WCF service 

Tell me how with example 
Posted

1 solution

The question is extremely unclear, so I cannot be 100%. So, the approximate question is: yes, you can create one object in one application, pass it to another application/process via WCF and re-create it there. (Withing the same process, it would not make any sense.) This is done in a type-agnostic way. You don't have to deal with JSON, XML or binary stream directly; you only define the data contract, which is done by adding appropriate attributes to some types and members.

Please see:
Using Data Contracts[^],
DataContractJsonSerializer Class (System.Runtime.Serialization.Json)[^],
DataContractSerializer Class (System.Runtime.Serialization)[^].

See also:
C# Corner: Data Contract in WCF[^],
Understanding different types of WCF Contracts[^].

—SA
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900