m sorry my Qs title is a bitt odd, i didnt found the right words to explain. Neways,
I have a WCF RESTful API in which I have implemented Custom Parameter Inspector class which inherits IParameterInspector to catch AfterCall and BeforeCall Methods.
public class CustomParameterInspector : IParameterInspector
{
public void AfterCall(string operationName, object[] outputs, object returnValue, object correlationState)
{}
public object BeforeCall(string operationName, object[] inputs)
{
// I have to perform certain tasks here
}
}
now my service interface is like this
[OperationContract]
[CustomInspectorAttribute]
[WebInvoke(Method = "POST",
UriTemplate = "GetMyDetail")]
MyDetail GetMyDetail(MyDetail objMyDetail);
and service class is like this
public MyDetail GetMyDetail(MyDetail objMyDetail)
{}
if I post JSON from client then it works fine.... in input[0] i get its type as MyDetail
But if change the input parameter to Object like this
[OperationContract]
[CustomInspectorAttribute]
[WebInvoke(Method = "POST",
UriTemplate = "GetMyDetail")]
MyDetail GetMyDetail(Object objMyDetail);
public MyDetail GetMyDetail(Object objMyDetail)
{}
then it does not gives me null in inputs[0] in BeforeCall(string operationName, object[] inputs)
Can you tell me y is this so and how can i solve it, I really need to get it in object