I have 4 classes: BaseStreamParameter
[DataContract]
[KnownType(typeof(StreamParameter))]
[KnownType(typeof(RepeatableStreamParameter))]
public class BaseStreamParameter
{
private bool pIsRepeatable;
[DataMember]
public bool IsRepeatable
{
get { return pIsRepeatable; }
set { pIsRepeatable = value; }
}
private bool pIsFBlock;
[DataMember]
public bool IsFBlock
{
get { return pIsFBlock; }
set { pIsFBlock = value; }
}
private string pParamName;
[DataMember]
public string ParamName
{
get { return pParamName; }
set { pParamName = value; }
}
public BaseStreamParameter(bool aIsRepeatable, bool aIsFBlock, string aParamName)
{
pIsFBlock = aIsFBlock;
pIsRepeatable = aIsRepeatable;
pParamName = aParamName;
}
public BaseStreamParameter(string aParamName)
{
pIsFBlock = false;
pIsRepeatable = false;
pParamName = aParamName;
}
RepeatableStreamParameter
[DataContract]
public class RepeatableStreamParameter : BaseStreamParameter
{
private List<BaseStreamParameter> pRepeatableParameters;
[DataMember]
public List<BaseStreamParameter> RepeatableParameters
{
get { return pRepeatableParameters; }
set { pRepeatableParameters = value; }
}
public RepeatableStreamParameter(bool aIsFBlock, string aParamName)
: base(true, aIsFBlock, aParamName)
{
pRepeatableParameters = new List<BaseStreamParameter>();
}
}
StreamParameter
[DataContract]
public class StreamParameter : BaseStreamParameter
{
private string pParamType;
[DataMember]
public string ParamType
{
get { return pParamType; }
set { pParamType = value; }
}
private string pParamValue;
[DataMember]
public string ParamValue
{
get { return pParamValue; }
set { pParamValue = value; }
}
private bool pIsEnum;
[DataMember]
public bool IsEnum
{
get { return pIsEnum; }
set { pIsEnum = value; }
}
private List<string> pEnumList;
[DataMember]
public List<string> EnumList
{
get { return pEnumList; }
set { pEnumList = value; }
}
public StreamParameter(bool aIsFBlock, string aParamName, string aParamType, string aParamValue, bool aIsEnum, List<string> aEnumList)
: base(false, aIsFBlock, aParamName)
{
pParamType = aParamType;
pParamValue = aParamValue;
pIsEnum = aIsEnum;
pEnumList = aEnumList;
}
public StreamParameter(bool aIsFBlock, string aParamName, string aParamType, string aParamValue)
: base(false, aIsFBlock, aParamName)
{
pParamType = aParamType;
pParamValue = aParamValue;
pIsEnum = false;
pEnumList = null;
}
}
StreamParameterContainer
[DataContract]
[KnownType(typeof(StreamParameterContainer))]
public class StreamParameterContainer : BaseStreamParameter
{
private List<BaseStreamParameter> pStreamParameters;
public StreamParameterContainer(string aParamName)
: base(aParamName)
{
pStreamParameters = new List<BaseStreamParameter>();
}
[DataMember]
public List<BaseStreamParameter> StreamParameters
{
get { return pStreamParameters; }
set { pStreamParameters = value; }
}
public int GetCountOfNonRepeatingParameters()
{
int count = 0;
foreach (BaseStreamParameter bsp in pStreamParameters)
{
if (bsp is StreamParameter)
count++;
}
return count;
}
}
So I have a StreamParameterContainer object whose StreamParameters property contains a RepeatableStreamParameter whose RepeatableParameters property contains 7 StreamParameter objects. This is all true when I make the call to the WCF web service. On the other end the RepeatableStreamParameter's RepeatableParameters property is empty.
Can any one tell me why?
is there someway to see what is being sent after I make the call in the client, but before it gets to the server?