Dynamically accessing parameters passed into WCF call RRS feed

  • Question

  • Is there a way to access the post data sent to a WCF service such that I can retrieve the parameter values dynamically?  How can I access the POST such that I can retrieve this information?

    Basically I have a lot of methods that I want to insert a generic method which will allow me to log the inputs.  Obviously I can just reference them directly, but I'd rather not have to do that hundreds of time through my whole service.  

            public void ObtainLongLock(string sInputOne, int iInputTwo)
                    //...Dynamically access sInputOne and iInputTwo

    I tried looking thorough System.Web.HttpContext.Current.Request.Form in hopes that it would be there.  I wasn't able to find it.


    Monday, August 6, 2012 9:12 PM


  • Send xml as your string paramter:

    [OperationContract] public void ObtainLongLock(string xml)


       XmlDocument doc = XmlDocument.Load(xml);


    Wednesday, August 8, 2012 6:40 PM

All replies