We study two-dimensional classically integrable field theory with independe
nt boundary conditions at each end, and obtain three possible generating fu
nctions for integrals of motion when this model is an ultralocal one. Class
ically integrable boundary conditions can be found when solving boundary K/- equations. In the quantum case, we also find that the unitarity conditio
n of the quantum R-matrix is sufficient to construct commutative quantities
with boundaries, and its reflection equations are obtained.