Need help about DSP and output templates

Hi,

I have a doubt, i am placing it here. I am able to use DSP and output templates for HTTP clients .I am able to pass input from the form and get the output of the service returned to a web browser(Here i am able to pass only string types as input).Now i need to know to pass inputs to a flowservice which expects document as input and at the same time how should i get the output (which is a document type) to the Http Client back