I ran into this problem that is (almost) nowhere on the internet and thought I'd share the solution. GeoServer supports parametrized SQL views for Web Feature Services (WFS) but the documentation leaves out a crucial fact (in fact its clear they cut and pasted the docs for the same page for WMS), since in a WFS all the requests are GET requests, they tell you to simply tack on to the query string a key value string of the form:
viewparams=keyOne:valueOne;keyTwo:valueTwo;
However in the GetFeature request, we have a POST request with an XML based payload and no obvious way to include the viewparams string. How does one do that?