Dynamic proxy generation RRS feed

  • Question

  • ive been using

    for Dynamic Programming with WCF

    ive been using this library and it works amazing...ive used for WCF service and am able to get the the input parameters(class file here) for my class file here is inherited from base when i try to get the properties used am getting some one unknown like propertynamespecified for eg if i have property name as UserStatus..i get UserStatus and UserStatusSpecified there any way to get only the names ive used..?

    DynamicProxy dp = factory.CreateProxy(contractName);

           Type proxyType = dp.ProxyType;

           MethodInfo method = proxyType.GetMethod(methodName);

           ParameterInfo[] inputParameters = method.GetParameters();

           foreach (ParameterInfo pinfo in inputParameters)


               DynamicProxyClass requestProxy = new DynamicProxyClass(factory.ProxyAssembly, pinfo.ParameterType.ToString());

               Type requestType = pinfo.ParameterType;

               foreach (PropertyInfo propertyInfo in requestType.GetProperties())


                   Response.Write(propertyInfo.Name );




    earlier help is highly appreciated..

    Wednesday, November 13, 2013 2:11 PM


  • Hi,

    "Specified" fields are only generated on optional parameters that are structs. (int, datetime, decimal etc). All such variables will have additional variable generated with the name <variableName>Specified.

    This is a way of knowing if a parameter is really passed between the client and the server.

    To elaborate, an optional integer, if not passed, would still have the dafault value of 0.  How do you differentiate between this and the one that was actually  passed with a value 0 ? The "specified" field lets you know if the optional integer is passed or not. If the "specified" field is false, the value is not passed across. If it true, the integer is passed.

    Alternatively, you can consider using data types like int?, datatime? and this will avoid generation of the "specified" fields.

    Best Regards,
    Amy Peng

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, November 15, 2013 5:57 AM