I've been using setOpacity and I've used this on both dynamic map services as well as feature layers.
I have a dojo horizontal slider defined as:
<div id="parcelOpacity"
data-dojo-type="dijit/form/HorizontalSlider" data-dojo-props="showButtons:'true', value:1, minimum:0, maximum:1">
Parcel Transparency
</div>
I have a listener associated with it:
on(registry.byId('parcelOpacity'), 'change', changeOpacity);
This is the function:
function changeOpacity(op) {
status_stateOwnParcelLayer.setOpacity(op);//this is an ArcGISDynamicMapServiceLayer
stateOwnFeatureLayer.setOpacity(op);//this is a featureLayer
}