We study surface and line operators in the GL-twisted N=4 gauge theory in
four dimensions. Their properties depend on the parameter t which determines
the BRST operator of theory. For t=i we propose a complete description of the
2-category of surface operators in terms of module categories. We also
determine the monoidal category of line operators which includes Wilson lines
as special objects. For t=1 and t=0 we only discuss surface and line operators
in the abelian case. Applications to the categorification of the local
geometric Langlands duality and its quantum version are briefly described. In
the appendices we discuss several 3d and 2d topological field theories with
gauge fields. In particular, we explain a relationship between the category of
branes in the gauged B-model and the equivariant derived category of coherent
sheaves.Comment: 60 pages, 8 figure