Hi Peter,
The refresh method just refreshes the document. During a refresh all data providers are refreshed, this mean that the query is executed and the data is fetched from the micro cube. During the query execution, any prompts and contexts in the document are raised.
Calling the refresh method before or after setting the prompts makes difference if in BI InfoView for the report prompts you have turned on option "Keep last values selected". If this option is on and you call refresh method after setting the prompts, it keeps the last value. If this option is off and you call refresh after setting the prompts, the prompts values will be gone and you will not have exact values.
Regarding the publications, you can go through the below links:
Hope this helps.
Regards,
Rajarsh