spatial solitons: the nonlinear effect can balance the diffraction. The electromagnetic field can change the refractive index of the medium while propagating, thus creating a structure similar to a graded-index fiber. If the field is also a propagating mode of the guide it has created, then it will remain confined and it will propagate without changing its shape
temporal solitons: if the electromagnetic field is already spatially confined, it is possible to send pulses that will not change their shape because the nonlinear effects will balance the dispersion. Those solitons were discovered first and they are often simply referred as "solitons" in optics.
Reference : wikipedia