Search code examples
c#.netwcfwcf-client

WCF data marshalling


1st of all, apologies if this is a basic/simple WCF question, i'm a WCF newbie and haven't come across this so far.

Question 1 - Is there a way to see what data is marshalled on a wcf service call ?

and given the following definitions

Interface IX
{
   List<string> list;
   Dictionary<string,MyType> dict;
}

Interface IY : IX
{
   List<string> list2;
   Dictionary<string,MyType2> dict2;
}

Interface IService 
{
   DataSet MethodX( IX arg);
   DataSet MethodY( IY arg);
}

class service : IService { }
class A : IY { }

where the service is hosted on a separate machine

Question 2 - what gets transported across when calling MethodX & MethodY as follows

 A instance = new A();
 service s = new service();
 // init instance & Service
 s.MethodA(instance);              // what carries over to service on machine B ?
 s.MethodB(instance);              // same question - full A or only properties of IY ?

Solution

  • Answer 1: To see serialized data you can use WCF message logging.

    Answer 2: Nothing. Code will throw exception because there will be no serializable type for arg parameter.